← All tags

Search API Reference

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.

Search code

GET /search/code

Searches for query terms inside of a file. This method returns up to 100 results per page.

Parameters

NameInRequiredDescription
qqueryyesThe 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.
sortquerynoThis 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
orderquerynoThis 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
503Service unavailableyes
422Validation failed, or the endpoint has been spammed.yes
403Forbiddenyes

Search commits

GET /search/commits

Find commits via various criteria on the default branch (usually main). This method returns up to 100 results per page.

Parameters

NameInRequiredDescription
qqueryyesThe 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.
sortquerynoSorts the results of your query by author-date or committer-date. Default: best match
orderquerynoDetermines 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno

Search issues and pull requests

GET /search/issues

Find issues by state and keyword. This method returns up to 100 results per page.

Parameters

NameInRequiredDescription
qqueryyesThe 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.
sortquerynoSorts 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
orderquerynoDetermines 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
advanced_searchquerynoSet to true to use advanced search.
search_typequerynoThe type of search to perform on issues. When not specified, the default is lexical search.

Responses

StatusDescriptionHas JSON body
200Responseyes
503Service unavailableyes
422Validation failed, or the endpoint has been spammed.yes
304Not modifiedno
403Forbiddenyes
401Requires authenticationyes

Search labels

GET /search/labels

Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results per page.

Parameters

NameInRequiredDescription
repository_idqueryyesThe id of the repository.
qqueryyesThe 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.
sortquerynoSorts the results of your query by when the label was created or updated. Default: best match
orderquerynoDetermines 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
404Resource not foundyes
403Forbiddenyes
422Validation failed, or the endpoint has been spammed.yes

Search repositories

GET /search/repositories

Find repositories via various criteria. This method returns up to 100 results per page.

Parameters

NameInRequiredDescription
qqueryyesThe 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.
sortquerynoSorts the results of your query by number of stars, forks, or help-wanted-issues or how recently the items were updated. Default: best match
orderquerynoDetermines 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
503Service unavailableyes
422Validation failed, or the endpoint has been spammed.yes
304Not modifiedno

Search topics

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.

Parameters

NameInRequiredDescription
qqueryyesThe 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno

Search users

GET /search/users

Find users via various criteria. This method returns up to 100 results per page.

Parameters

NameInRequiredDescription
qqueryyesThe 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.
sortquerynoSorts the results of your query by number of followers or repositories, or when the person joined GitHub. Default: best match
orderquerynoDetermines 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_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno
503Service unavailableyes
422Validation failed, or the endpoint has been spammed.yes