GitHub followers API
Accounts following a user, as GitHub REST user objects, paginated.
GET /v1/github/users/{handle}/followers1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/github/users/torvalds/followers",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "items": [ { "login": "sprsquish", "id": 206, "node_id": "MDQ6VXNlcjIwNg==", "avatar_url": "https://avatars.githubusercontent.com/u/206?v=4", "html_url": "https://github.com/sprsquish", "type": "User", "site_admin": false, "gravatar_id": "", "url": "https://api.github.com/users/sprsquish", "followers_url": "https://api.github.com/users/sprsquish/followers", "following_url": "https://api.github.com/users/sprsquish/following{/other_user}", "gists_url": "https://api.github.com/users/sprsquish/gists{/gist_id}", "starred_url": "https://api.github.com/users/sprsquish/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sprsquish/subscriptions", "organizations_url": "https://api.github.com/users/sprsquish/orgs", "repos_url": "https://api.github.com/users/sprsquish/repos", "events_url": "https://api.github.com/users/sprsquish/events{/privacy}", "received_events_url": "https://api.github.com/users/sprsquish/received_events", "user_view_type": "public" }, { "login": "pius", "id": 365, "node_id": "MDQ6VXNlcjM2NQ==", "avatar_url": "https://avatars.githubusercontent.com/u/365?v=4", "html_url": "https://github.com/pius", "type": "User", "site_admin": false, "gravatar_id": "", "url": "https://api.github.com/users/pius", "followers_url": "https://api.github.com/users/pius/followers", "following_url": "https://api.github.com/users/pius/following{/other_user}", "gists_url": "https://api.github.com/users/pius/gists{/gist_id}", "starred_url": "https://api.github.com/users/pius/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pius/subscriptions", "organizations_url": "https://api.github.com/users/pius/orgs", "repos_url": "https://api.github.com/users/pius/repos", "events_url": "https://api.github.com/users/pius/events{/privacy}", "received_events_url": "https://api.github.com/users/pius/received_events", "user_view_type": "public" }, "… 28 more" ], "page": 1, "per_page": 30, "has_more": true, "next_cursor": "eyJzIjoiZm9sbG93ZXJzOnRvcnZhbGRzIiwicCI6MiwibiI6MzB9"}Parameters
| Name | Type | Description |
|---|---|---|
handlepath · required | string | GitHub username, with or without the @, or a profile URL. Example: torvalds. |
per_pagequery | integer | Items per page, 1-100 (default 30). |
pagequery | integer | 1-indexed page number (default 1). |
afterquery | string | Cursor: the previous page’s next_cursor (instead of page). |
Response fields
200 with a GitHubUsersResponse, in GitHub’s own REST v3 objects.
| Field | Type | Description |
|---|---|---|
items | GitHubUser[] | |
page | integer | 1-indexed page this is. |
per_page | integer | |
has_more | boolean | |
next_cursor | string | null | Pass as after for the next page; null at the end. |
Status codes
| Status | Meaning |
|---|---|
200 | A page of users. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No public GitHub user, repository or issue by that name. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | GitHub is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
GitHub is a trademark of GitHub, Inc. We are not affiliated with or endorsed by GitHub.