{"openapi":"3.1.0","info":{"title":"Next.js Documentation Search API","version":"1.0.0","description":"Search the public Next.js documentation index. This read-only API powers documentation search on nextjs.org and does not expose account or deployment data.","contact":{"name":"Next.js documentation","url":"https://nextjs.org/docs"}},"servers":[{"url":"https://nextjs.org"}],"externalDocs":{"description":"Next.js documentation index","url":"https://nextjs.org/docs/llms.txt"},"tags":[{"name":"Documentation search"}],"paths":{"/api/search":{"get":{"operationId":"searchNextjsDocumentation","summary":"Search the Next.js documentation","description":"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.","tags":["Documentation search"],"parameters":[{"name":"query","in":"query","required":false,"description":"Documentation topic to search for. Values longer than 10,000 characters are truncated.","schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"description":"Optional comma-separated scope, such as router:app,version:stable. Supported router values are app and pages; versions are listed in the POST request schema.","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching documentation pages and snippets.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SortedSearchResult"}}}}},"500":{"description":"The search service is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"searchNextjsDocumentationByVersion","summary":"Search a selected documentation version and router","description":"Searches the public documentation index with an explicit version and router scope. This is a read-only search operation; the request body selects the search scope and does not create or change data.","tags":["Documentation search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Matching documentation passages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"description":"The JSON body, query, version, or routerType is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The search service is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"SearchRequest":{"type":"object","required":["query","version","routerType"],"properties":{"query":{"type":"string","minLength":1,"description":"Documentation topic to search for; whitespace-only values are rejected, and values longer than 10,000 characters are truncated."},"version":{"type":"string","enum":["13","14","15","stable"],"description":"Documentation version identifier. Use one of the currently served versions in this list."},"routerType":{"type":"string","enum":["app","pages","both"],"description":"Which Next.js router to include in the results."}}},"SearchResponse":{"type":"object","required":["hits","nbHits","query","provider"],"properties":{"hits":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"}},"nbHits":{"type":"integer","minimum":0},"query":{"type":"string"},"provider":{"type":"string","const":"upstash"}},"additionalProperties":false},"SearchHit":{"type":"object","required":["title","pageTitle","content","path","objectID"],"properties":{"title":{"type":"string"},"pageTitle":{"type":"string"},"content":{"type":"string"},"path":{"type":"string"},"section":{"type":"string"},"anchor":{"type":"string"},"objectID":{"type":"string"}},"additionalProperties":false},"SortedSearchResult":{"type":"object","required":["content","id","type","url"],"properties":{"breadcrumbs":{"type":"array","items":{"type":"string"}},"content":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["heading","page","text"]},"url":{"type":"string","format":"uri-reference","description":"Path to the matching documentation page or anchor."}},"additionalProperties":false},"ErrorResponse":{"type":"object","required":["error","code","message","resolution"],"properties":{"error":{"type":"string","description":"Legacy plain-text mirror of message.","deprecated":true},"code":{"type":"string","enum":["invalid_json","invalid_query","invalid_parameters","internal_error"],"description":"Machine-readable error code."},"message":{"type":"string","description":"What went wrong."},"resolution":{"type":"string","description":"A suggested next step for resolving the error."}},"additionalProperties":false}}}}