---
title: "Search the Next.js documentation"
method: GET
path: "/api/search"
tags: ["Documentation search"]
---

# Search the Next.js documentation

`GET /api/search`

## Request

- Base URL: `https://nextjs.org`
- URL: `https://nextjs.org/api/search`
- Auth: none declared

Returns matching documentation pages and snippets. The optional tag scopes results, for example router:app,version:stable. An omitted or unrecognized scope defaults to the stable App Router documentation. Empty queries return an empty array.

## Query parameters

- `query` string
- `tag` string

## Response `200`

Matching documentation pages and snippets.

- SortedSearchResult[]
  - `breadcrumbs` string[]
  - `content` string, required
  - `id` string, required
  - `type` 'heading' | 'page' | 'text', required
  - `url` string, uri-reference, required: Path to the matching documentation page or anchor.

## Other responses

- `500`: The search service is temporarily unavailable.

---

[API](https://skmtc.dev/nextjs/apis/next-js-documentation-search-api.md) - [All operations](https://skmtc.dev/nextjs/apis/next-js-documentation-search-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nextjs/apis/next-js-documentation-search-api/revisions/9d2f52b94ef3?raw)
