Skip to main content
get/v2/context
Request example
Response
get/v2/context

Query parameters

libraryIdstringrequired#
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: ^/[^/]+/[^/]+([/@][^/]+)?$

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

Length: 1–500

typeenum<string>#
Response format type

Default: "txt"

Options:jsontxt
fastenum<string>#
When true, skip LLM reranking and return top vector-search results directly. Trades relevance quality for lower latency.

Default: "false"

Options:truefalse
languagestring#
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.

Responses

Documentation context
codeSnippetsobject[]required#
Relevant code snippets
infoSnippetsobject[]required#
Relevant documentation snippets
rulesobject#
Optional library-specific rules and guidelines
versionobject#
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.