---
title: "Search documentation in one request"
method: GET
path: "/v3/search"
tags: ["Search"]
---

# Search documentation in one request

`GET /v3/search`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v3/search`
- Auth: one of:
  - none
  - HTTP bearer

Select up to four relevant Context7 libraries, retrieve their documentation in parallel, deduplicate and globally rerank the evidence, and return one bounded response. Optional library, version, and language values improve routing and ranking.

## Query parameters

- `query` string, required
- `type` 'json' | 'txt'
- `library` string[]
- `version` string
- `language` string
- `context` 'broad'

## Response `200`

Bounded documentation evidence from the selected libraries

- SearchContextResponse: Documentation context response
  - `codeSnippets` object[], required: Relevant code snippets with their selected library
    - `codeTitle` string, required: Title of the code snippet
    - `codeDescription` string, required: Description of what the code does
    - `codeLanguage` string, required: Primary programming language
    - `codeTokens` integer, required: Token count for the snippet
    - `codeId` string, required: URL to source location
    - `pageTitle` string, required: Title of the documentation page
    - `codeList` CodeExample[], required: Code examples in different languages
      - `language` string, required: Programming language
      - `code` string, required: The actual code content
    - `isDynamic` boolean: Whether this snippet was recovered from the dynamic source-code index instead of the primary docs index
    - `sourceFile` string: Repo-relative source file path for dynamic snippets
    - `libraryId` string, required: Context7 library ID that produced this snippet
    - `rank` integer, required: 1-based position in the reranked order shared by codeSnippets and infoSnippets. Sort both lists together by rank to read the evidence in the order the text response gives it.
  - `infoSnippets` object[], required: Relevant documentation snippets with their selected library
    - `pageId` string: URL to source page
    - `breadcrumb` string: Navigation breadcrumb path
    - `content` string, required: The documentation content
    - `contentTokens` integer, required: Token count for the content
    - `libraryId` string, required: Context7 library ID that produced this snippet
    - `rank` integer, required: 1-based position in the reranked order shared by codeSnippets and infoSnippets. Sort both lists together by rank to read the evidence in the order the text response gives it.
  - `rules` object: Optional global rules and library-scoped guidelines
    - `global` string[]: Global team rules that apply to every returned library
    - `libraryOwn` string[]: Rules defined by the library owner
    - `libraryTeam` string[]: Library-specific rules from the team
    - `libraries` object[]: Rules scoped to a specific returned library
      - `libraryId` string, required
      - `libraryOwn` string[], required
      - `libraryTeam` string[], required
  - `version` object: Present when a version was requested by the version parameter or a version-like library tag. Says what each returned library served.
    - `libraryId` string, required: The library id served, including the served tag when one was matched.
    - `requested` string, required: The version parameter, when given.
    - `served` string, nullable, required: The indexed tag served: the matching tag or, when unverified, the newest stable release of the requested line that is newer than the request. Null when current documentation was served instead.
    - `status` 'verified' | 'unverified', required: Worst outcome across the returned libraries.
    - `libraries` object[], required
      - `libraryId` string, required: The library id as it appears on the returned snippets, including the served tag when one was matched.
      - `requested` string, required: The version requested for this library.
      - `served` string, nullable, required: The indexed tag served: the matching tag or, when unverified, the newest stable release of the requested line that is newer than the request. The requested version when the source id pins it. Null when current documentation was served instead.
      - `status` 'verified' | 'unverified', required

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Invalid or missing API key
- `402`: Payment Required - the teamspace's configured monthly spending limit has been reached. A teamspace owner or admin can raise the limit in billing settings, or the cap will reset at the start of the next billing month.
- `404`: No documentation matched the question or library hints
- `429`: Too Many Requests - Rate limit exceeded
- `503`: Documentation search could not be completed

## Changes

- **2026-10-21** `34f73d976536`: 1 info
  - added the optional property `allOf[#/components/schemas/ContextResponse]/version` to the response with the `200` status
- **2026-10-21** `38811399ea5f`: 11 breaking, 4 warning, 2 info
  - the `allOf[#/components/schemas/ContextResponse]/codeSnippets/items/` response's property type changed from `object` to no type for status `200`
  - the `allOf[#/components/schemas/ContextResponse]/infoSnippets/items/` response's property type changed from `object` to no type for status `200`
  - removed the required property `allOf[#/components/schemas/ContextResponse]/codeSnippets/items/codeDescription` from the response with the `200` status
  - removed the required property `allOf[#/components/schemas/ContextResponse]/codeSnippets/items/codeId` from the response with the `200` status
  - …13 more
- **2026-10-20** `9e5560d55af5`: 1 info
  - added the new optional `query` request parameter `context`
- **2026-10-20** `19655ce5cbe1`: 2 info
  - added the required property `allOf[subschema #2]/codeSnippets/items/allOf[subschema #2]/rank` to the response with the `200` status
  - added the required property `allOf[subschema #2]/infoSnippets/items/allOf[subschema #2]/rank` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v3/search/get.md)

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) - [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/context7/apis/context7-public-api/revisions/945f7834fa8c?raw)
