Search labels
Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/[email protected]/rest/overview/resources-in-the-rest-api#pagination). 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](https://docs.github.com/[email protected]/rest/reference/search#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.
/search/labels- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Query Parameters
- repository_id integerrequired
The id of the repository.
- q stringrequired
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](https://docs.github.com/[email protected]/rest/reference/search#constructing-a-search-query).
- sort stringoptional
Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/[email protected]/rest/reference/search#ranking-search-results)
- order stringoptional
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 integeroptional
Results per page (max 100)
- page integeroptional
Page number of the results to fetch.
Responses
Response
items array[Label Search Result Item object]required
items Label Search Result Item objectLabel Search Result Item
Label Search Result Item
Not modified
Forbidden
Resource not found
Validation failed