GitHub user repositories API
A user’s public repositories with stars, forks, language and topics, paginated.
GET /v1/github/users/{handle}/repos1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/github/users/sindresorhus/repos?sort=pushed",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "items": [ { "id": 55832243, "name": "eslint-plugin-unicorn", "full_name": "sindresorhus/eslint-plugin-unicorn", "owner": { "login": "sindresorhus", "id": 170270, "node_id": "MDQ6VXNlcjE3MDI3MA==", "avatar_url": "https://avatars.githubusercontent.com/u/170270?v=4", "html_url": "https://github.com/sindresorhus", "type": "User", "site_admin": false, "gravatar_id": "", "url": "https://api.github.com/users/sindresorhus", "followers_url": "https://api.github.com/users/sindresorhus/followers", "following_url": "https://api.github.com/users/sindresorhus/following{/other_user}", "gists_url": "https://api.github.com/users/sindresorhus/gists{/gist_id}", "starred_url": "https://api.github.com/users/sindresorhus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sindresorhus/subscriptions", "…": "5 more fields" }, "private": false, "html_url": "https://github.com/sindresorhus/eslint-plugin-unicorn", "description": "More than 300 powerful ESLint rules", "fork": false, "homepage": "", "language": "JavaScript", "stargazers_count": 5300, "watchers_count": 5300, "forks_count": 499, "open_issues_count": 2, "…": "67 more fields" }, { "id": 2335886, "name": "sindresorhus.github.com", "full_name": "sindresorhus/sindresorhus.github.com", "owner": { "login": "sindresorhus", "id": 170270, "node_id": "MDQ6VXNlcjE3MDI3MA==", "avatar_url": "https://avatars.githubusercontent.com/u/170270?v=4", "html_url": "https://github.com/sindresorhus", "type": "User", "site_admin": false, "gravatar_id": "", "url": "https://api.github.com/users/sindresorhus", "followers_url": "https://api.github.com/users/sindresorhus/followers", "following_url": "https://api.github.com/users/sindresorhus/following{/other_user}", "gists_url": "https://api.github.com/users/sindresorhus/gists{/gist_id}", "starred_url": "https://api.github.com/users/sindresorhus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sindresorhus/subscriptions", "…": "5 more fields" }, "private": false, "html_url": "https://github.com/sindresorhus/sindresorhus.github.com", "description": "Personal website of Sindre Sorhus", "fork": false, "homepage": "http://sindresorhus.com/", "language": "JavaScript", "stargazers_count": 401, "watchers_count": 401, "forks_count": 73, "open_issues_count": 0, "…": "67 more fields" }, "… 28 more" ], "page": 1, "per_page": 30, "has_more": true, "next_cursor": "eyJzIjoicmVwb3M6c2luZHJlc29yaHVzOm93bmVyOnB1c2hlZDoiLCJwIjoyLCJuIjozMH0"}Parameters
| Name | Type | Description |
|---|---|---|
handlepath · required | string | GitHub username, with or without the @, or a profile URL. Example: torvalds. |
typequery | "all" | "owner" | "member" | owner (default), member or all. One of all, owner, member. |
sortquery | "created" | "updated" | "pushed" | "full_name" | full_name (default), created, updated or pushed. One of created, updated, pushed, full_name. |
directionquery | "asc" | "desc" | asc for full_name, desc otherwise, by default. One of asc, desc. |
sincequery | string | Only items on or after this date (YYYY-MM-DD or ISO 8601). |
untilquery | string | Only items on or before this date (that whole UTC day for YYYY-MM-DD). |
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 GitHubReposResponse, in GitHub’s own REST v3 objects.
| Field | Type | Description |
|---|---|---|
items | GitHubRepo[] | |
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 repositories. |
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.