Search for specific items on GitHub.
7 endpoints tagged search, each listing its
parameters and possible responses. Search or scroll the index below to
jump to a specific endpoint.
No endpoints match your search.
GET /search/code
Searches for query terms inside of a file. This method returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. See "Searching code" for a detailed list of qualifiers. |
sort | query | no | This field is closing down. Sorts the results of your query. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: best match |
order | query | no | This field is closing down. 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 503 | Service unavailable | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
GET /search/commits
Find commits via various criteria on the default branch (usually main). This method returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. See "Searching commits" for a detailed list of qualifiers. |
sort | query | no | Sorts the results of your query by author-date or committer-date. Default: best match |
order | query | 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
GET /search/issues
Find issues by state and keyword. This method returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. See "Searching issues and pull requests" for a detailed list of qualifiers. |
sort | query | no | Sorts the results of your query by the number of comments, reactions, reactions-+1, reactions--1, reactions-smile, reactions-thinking_face, reactions-heart, reactions-tada, or interactions. You can also sort results by how recently the items were created or updated, Default: best match |
order | query | 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
advanced_search | query | no | Set to true to use advanced search. |
search_type | query | no | The type of search to perform on issues. When not specified, the default is lexical search. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 503 | Service unavailable | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /search/labels
Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
repository_id | query | yes | The id of the repository. |
q | query | yes | The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see Constructing a search query. |
sort | query | no | Sorts the results of your query by when the label was created or updated. Default: best match |
order | query | 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /search/repositories
Find repositories via various criteria. This method returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. See "Searching for repositories" for a detailed list of qualifiers. |
sort | query | 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 |
order | query | 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 503 | Service unavailable | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
GET /search/topics
Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results per page. See "Searching topics" for a detailed list of qualifiers.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
GET /search/users
Find users via various criteria. This method returns up to 100 results per page.
| Name | In | Required | Description |
|---|---|---|---|
q | query | 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. See "Searching users" for a detailed list of qualifiers. |
sort | query | no | Sorts the results of your query by number of followers or repositories, or when the person joined GitHub. Default: best match |
order | query | 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 | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 503 | Service unavailable | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |