# Search topics

From **GitHub v3 REST API**.

`GET /search/topics`

Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://docs.github.com/articles/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](https://docs.github.com/enterprise-server@3.0/rest/reference/search#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.

## Parameters

### `q`

- Location: query
- Required: true
- Type: `string`

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](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).

### `per_page`

- Location: query
- Required: false
- Type: `integer`
- Default: `30`

Results per page (max 100)

### `page`

- Location: query
- Required: false
- Type: `integer`
- Default: `1`

Page number of the results to fetch.

## Responses

### `200`

Response

### `application/json`

- Type: `object`

```json
{
  "incomplete_results": false,
  "items": [
    {
      "created_at": "2016-11-28T22:03:59Z",
      "created_by": "Yukihiro Matsumoto",
      "curated": true,
      "description": "Ruby was developed by Yukihiro \"Matz\" Matsumoto in 1995 with the intent of having an easily readable programming language. It is integrated with the Rails framework to create dynamic web-applications. Ruby's syntax is similar to that of Perl and Python.",
      "display_name": "Ruby",
      "featured": true,
      "name": "ruby",
      "released": "December 21, 1995",
      "score": 1,
      "short_description": "Ruby is a scripting language designed for simplified object-oriented programming.",
      "updated_at": "2017-10-30T18:16:32Z"
    },
    {
      "created_at": "2016-12-09T17:03:50Z",
      "created_by": "David Heinemeier Hansson",
      "curated": true,
      "description": "Ruby on Rails (Rails) is a web application framework written in Ruby. It is meant to help simplify the building of complex websites.",
      "display_name": "Rails",
      "featured": true,
      "name": "rails",
      "released": "December 13 2005",
      "score": 1,
      "short_description": "Ruby on Rails (Rails) is a web application framework written in Ruby.",
      "updated_at": "2017-10-30T16:20:19Z"
    },
    {
      "created_at": "2016-12-07T00:07:02Z",
      "created_by": "Guido van Rossum",
      "curated": true,
      "description": "Python is a dynamically typed programming language designed by Guido Van Rossum. Much like the programming language Ruby, Python was designed to be easily read by programmers. Because of its large following and many libraries, Python can be implemented and used to do anything from webpages to scientific research.",
      "display_name": "Python",
      "featured": true,
      "name": "python",
      "released": "February 20, 1991",
      "score": 1,
      "short_description": "Python is a dynamically typed programming language.",
      "updated_at": "2017-10-27T22:45:43Z"
    },
    {
      "created_at": "2016-12-16T21:53:08Z",
      "created_by": "Tom Preston-Werner",
      "curated": true,
      "description": "Jekyll is a blog-aware, site generator written in Ruby. It takes raw text files, runs it through a renderer and produces a publishable static website.",
      "display_name": "Jekyll",
      "featured": true,
      "name": "jekyll",
      "released": "2008",
      "score": 1,
      "short_description": "Jekyll is a simple, blog-aware static site generator.",
      "updated_at": "2017-10-27T19:00:24Z"
    },
    {
      "created_at": "2016-12-16T21:53:45Z",
      "created_by": "Hampton Catlin, Natalie Weizenbaum, Chris Eppstein",
      "curated": true,
      "description": "Sass is a stylesheet language with a main implementation in Ruby. It is an extension of CSS that makes improvements to the old stylesheet format, such as being able to declare variables and using a cleaner nesting syntax.",
      "display_name": "Sass",
      "featured": true,
      "name": "sass",
      "released": "November 28, 2006",
      "score": 1,
      "short_description": "Sass is a stable extension to classic CSS.",
      "updated_at": "2018-01-16T16:30:40Z"
    },
    {
      "created_at": "2016-12-17T20:30:44Z",
      "created_by": "Max Howell",
      "curated": true,
      "description": "Homebrew is a package manager for Apple's macOS operating system. It simplifies the installation of software and is popular in the Ruby on Rails community.",
      "display_name": "Homebrew",
      "featured": true,
      "name": "homebrew",
      "released": "2009",
      "score": 1,
      "short_description": "Homebrew is a package manager for macOS.",
      "updated_at": "2018-02-06T16:14:56Z"
    }
  ],
  "total_count": 6
}
```

```json
{"properties":{"incomplete_results":{"type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/topic-search-result-item"},"type":"array"},"total_count":{"type":"integer"}},"required":["total_count","incomplete_results","items"],"type":"object"}
```

### `304`

Not modified

### `415`

Preview header missing

### `application/json`

- Type: `object`

```json
{"properties":{"documentation_url":{"type":"string"},"message":{"type":"string"}},"required":["message","documentation_url"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/search/topics
```
