GitHub v3 REST API

Search labels

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

When searching for labels, you can get text match metadata for the label name and description fields when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

For example, if you want to find labels in the linguist repository that match bug, defect, or enhancement. Your query might look like this:

q=bug+defect+enhancement&repository_id=64778136

The labels that best match the query appear first in the search results.

get
{protocol}://{hostname}/api/v3/search/labels

Query Parameters

repository_idintegerrequired

The id of the repository.

qstringrequired

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.

sortstring

Sorts the results of your query by when the label was created or updated. Default: best match

Allowed values:createdupdated

orderstring

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.

Allowed values:descasc

Default:desc

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

total_countintegerrequired
incomplete_resultsbooleanrequired
itemsarray[object]required

Label Search Result Item

Show Child Parameters
get/search/labels
 
application/json

Search repositories

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

When searching for repositories, you can get text match metadata for the name and description fields when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:

q=tetris+language:assembly&sort=stars&order=desc

This query searches for repositories with the word tetris in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.

When you include the mercy preview header, you can also search for multiple topics by adding more topic: instances. For example, your query might look like this:

q=topic:ruby+topic:rails

get
{protocol}://{hostname}/api/v3/search/repositories

Query Parameters

qstringrequired

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 GitHub.com. To learn more about the format of the query, see Constructing a search query. See “Searching for repositories” for a detailed list of qualifiers.

sortstring

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

Allowed values:starsforkshelp-wanted-issuesupdated

orderstring

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.

Allowed values:descasc

Default:desc

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

total_countintegerrequired
incomplete_resultsbooleanrequired
itemsarray[object]required

Repo Search Result Item

Show Child Parameters
get/search/repositories
 
application/json

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.

When searching for topics, you can get text match metadata for the topic’s short_description, description, name, or display_name field when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:

q=ruby+is:featured

This query searches for topics with the keyword ruby and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.

get
{protocol}://{hostname}/api/v3/search/topics

Query Parameters

qstringrequired

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 GitHub.com. To learn more about the format of the query, see Constructing a search query.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

total_countintegerrequired
incomplete_resultsbooleanrequired
itemsarray[object]required

Topic Search Result Item

Show Child Parameters
get/search/topics
 
application/json

Search users

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

When searching for users, you can get text match metadata for the issue login, email, and name fields when you pass the text-match media type. For more details about highlighting search results, see Text match metadata. For more details about how to receive highlighted search results, see Text match metadata.

For example, if you’re looking for a list of popular users, you might try this query:

q=tom+repos:%3E42+followers:%3E1000

This query searches for users with the name tom. The results are restricted to users with more than 42 repositories and over 1,000 followers.

get
{protocol}://{hostname}/api/v3/search/users

Query Parameters

qstringrequired

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 GitHub.com. To learn more about the format of the query, see Constructing a search query. See “Searching users” for a detailed list of qualifiers.

sortstring

Sorts the results of your query by number of followers or repositories, or when the person joined GitHub Enterprise Server. Default: best match

Allowed values:followersrepositoriesjoined

orderstring

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.

Allowed values:descasc

Default:desc

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

total_countintegerrequired
incomplete_resultsbooleanrequired
itemsarray[object]required

User Search Result Item

Show Child Parameters
get/search/users
 
application/json

List teams

Lists all teams in an organization that are visible to the authenticated user.

get
{protocol}://{hostname}/api/v3/orgs/{org}/teams

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired

Response

application/json

Response

Groups of organization members that gives permissions on specified repositories.

idintegerrequired
node_idstringrequired
namestringrequired
slugstringrequired
descriptionstring | nullrequired
privacystring
permissionstringrequired
permissionsobject
Show Child Parameters
urlstring(uri)required
html_urlstring(uri)required

Example:https://github.com/orgs/rails/teams/core

members_urlstringrequired
repositories_urlstring(uri)required
parentobject | nullrequired

Groups of organization members that gives permissions on specified repositories.

Show Child Parameters
get/orgs/{org}/teams
 
application/json