API · GitHub
GET /github/search/repos
Search GitHub repositories by keyword, language, stars and more.
| Request | GET /v1/github/search/repos |
| Operation id | github.search.repos |
| Cost | 1 credit, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Search GitHub repositories by keyword, language, stars and more.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | yes | GitHub repository search query. Example: language:rust stars:>5000. |
sort | "stars" | "forks" | "help-wanted-issues" | "updated" | no | Sort field (default: best match). One of stars, forks, help-wanted-issues, updated. |
order | "asc" | "desc" | no | desc (default) or asc. One of asc, desc. |
since | string | no | Only items on or after this date (YYYY-MM-DD or ISO 8601). |
until | string | no | Only items on or before this date (that whole UTC day for YYYY-MM-DD). |
per_page | integer | no | Items per page, 1-100 (default 30). |
page | integer | no | 1-indexed page number (default 1). |
after | string | no | Cursor: the previous page’s next_cursor (instead of page). |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | Matching repositories. | GitHubRepoSearchResponse |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | No public GitHub user, repository or issue by that name. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | GitHub is temporarily unavailable. Retryable; nothing was charged. | Error |
GitHubRepoSearchResponse fields
| Field | Type | Description |
|---|---|---|
total_count | integer | |
incomplete_results | boolean | |
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. |
Errors use one shape everywhere; see Errors for every code and what to do.