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.

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

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