GET /search/repositories — GitHub API
GitHub token (optional for public resources); https://api.github.com
GitHub APISearch repositories
Search requires q; add qualifiers like language: and stars:>N to narrow results. Sort by stars, forks or updated with order asc/desc, and paginate with per_page (max 100) and page. Public repository search works without authentication, though a bearer token raises your rate limit. The response returns total_count, incomplete_results and an items array of matching repositories. See the GitHub repository search docs.
- Base URL
- https://api.github.com
- Auth
- Authorization: Bearer <GITHUB_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
→ 362 tokens · Vary: Accept
Critical gotchas
GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.
Fine-grained tokens only authorize repositories and permissions selected when the token is created.
cURL
curl -X GET 'https://api.github.com/search/repositories?q=language%3Atypescript+stars%3A%3E1000&sort=stars&order=desc&per_page=30&page=1' \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2026-03-10'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | Yes | The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. |
| sort | query | string | No | Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) |
| order | query | string | No | Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. |
| per_page | query | integer | No | The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." |
| page | query | integer | No | The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." |
Response 200 OK
{
"total_count": 0,
"incomplete_results": true,
"items": [
{
"id": 0,
"name": "string",
"full_name": "string",
"html_url": "https://example.com"
}
]
} Get a free GitHub API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.