---
title: "Search labels"
method: GET
path: "/search/labels"
tags: ["search"]
---

# 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](https://docs.github.com/enterprise-cloud@latest/rest/guides/using-pagination-in-the-rest-api).

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/enterprise-cloud@latest/rest/search/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.

## Query parameters

- `repository_id` integer, required
- `q` string, required
- `sort` 'created' | 'updated'
- `order` 'desc' | 'asc'
- `per_page` integer
- `page` integer

## Response `200`

Response

- object
  - `total_count` integer, required
  - `incomplete_results` boolean, required
  - `items` LabelSearchResultItem[], required
    - `id` integer, required
    - `node_id` string, required
    - `url` string, uri, required
    - `name` string, required
    - `color` string, required
    - `default` boolean, required
    - `description` string, nullable, required
    - `archived_at` string, date-time, nullable, required — Timestamp indicating when the label was archived, or `null` if it has not been archived.
    - `archived_by` SimpleUser, required — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
      - `user_view_type` string
    - `score` number, required
    - `text_matches` object[]
      - `object_url` string
      - `object_type` string, nullable
      - `property` string
      - `fragment` string
      - `matches` object[]
        - `text` string
        - `indices` integer[]

## Other responses

- `304` — Not modified
- `403` — Forbidden
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

## Changes

- **2026-09-14** `2ce994d97d6e` — 2 info
  - added the required property `items/items/archived_at` to the response with the `200` status
  - added the required property `items/items/archived_by` to the response with the `200` status

[Change history](https://skmtc.dev/github/apis/enterprise-cloud/changes/search/labels/get.md)

---

[API](https://skmtc.dev/github/apis/enterprise-cloud.md) · [All operations](https://skmtc.dev/github/apis/enterprise-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/github/apis/enterprise-cloud/revisions/e9af1ee5b414?raw)
