Skip to main content
GET
Get documentation context

Authorizations

Authorization
string
header
required

Get your API key at context7.com/dashboard. Treat your API key like a password and store it securely. Every key can read the management API (/v2/teamspaces/*), except personal data: member and invitation emails, library requesters, visitor questions, Docs7 reader searches, conversations, feedback and feature requests, and the GitHub account behind a build. To read those or make changes there, the key must be created with Write access ticked; other keys get 403 write_access_required.

Query Parameters

libraryId
string
required

Context7-compatible library ID — the URL path of the library on context7.com. Use /owner/repo for GitHub repositories, or /<source>/<id> for other sources (websites, llms.txt, GitLab/Bitbucket, etc.). Optionally suffix with /<version> or @<version> to pin a specific version. See Library ID format.

Required string length: 1 - 500
Pattern: ^/[^/]+/[^/]+([/@][^/]+)?$
query
string
required

User's original question or task - used for intelligent relevance ranking

Required string length: 1 - 500
type
enum<string>
default:txt

Response format type

Available options:
json,
txt
fast
enum<string>
default:false

When true, skip LLM reranking and return top vector-search results directly. Trades relevance quality for lower latency.

Available options:
true,
false
language
string

Optional programming language the caller writes in, such as Python or TypeScript. A soft ranking preference: the SDK and code examples in that language rank first, and other documentation is still returned when nothing in that language matches. Only the first 40 characters are used.

Response

Documentation context

Documentation context response

codeSnippets
object[]
required

Relevant code snippets

infoSnippets
object[]
required

Relevant documentation snippets

rules
object

Optional library-specific rules and guidelines

version
object

Present only when the library ID names a version that is not indexed. Says what was served instead, with the fields of each entry of the Search API's version.libraries. The text response states the same in a leading version note when the status is unverified.

Example: