Get documentation context
Retrieve intelligent, LLM-reranked documentation context for natural language queries. Returns the most relevant code snippets and documentation for your specific question.
1 min read
get/v2/context
Request example
Response
get/v2/context
Query parameters
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.Length: 1–500Pattern: ^/[^/]+/[^/]+([/@][^/]+)?$
User's original question or task - used for intelligent relevance ranking
Length: 1–500
When
true, skip LLM reranking and return top vector-search results directly. Trades relevance quality for lower latency.Default: "false"
Options:
truefalseResponses
Documentation context
Relevant code snippets
Show child attributesHide child attributes
Title of the code snippet
Description of what the code does
Primary programming language
Token count for the snippet
URL to source location
Title of the documentation page
Code examples in different languages
Whether this snippet was recovered from the dynamic source-code index instead of the primary docs index
Repo-relative source file path for dynamic snippets
Relevant documentation snippets