Get documentation context
rank gives that order. A version in the library ID that is not indexed is not an error: a ready tag that matches the requested numbers is served (15 serves v15.1.8); otherwise, for a patch newer than every indexed tag of its own minor, that minor’s newest tag (v16.2.9 for 16.2.10); otherwise the newest stable release of the requested line when it is newer than the request (v2.3.1 for 2.0.0; below 1.0, the same minor), or else the library’s current documentation. A prerelease tag serves only a request for that prerelease. On a library whose versions Context7 maintains (one version per minor line), a tag of the requested minor counts as the requested version. The text response then starts with a version note when the served documentation is not the requested version (on a library whose versions Context7 maintains, a tag of the requested minor counts as the requested version and gets no note), and the JSON response carries a version object. A version that is not indexed for a public GitHub library is queued for indexing in the background, so a later request for it can be answered. A branch or channel name that is not indexed (/owner/repo/canary), or a version with nothing ready to serve, still returns 404 version_not_found. When the requested library has moved to another library ID, the response serves the new library (up to three moves, keeping the requested version): the text output starts with a one-line note that names the old and new IDs, and the JSON output’s libraryId is the new ID.Authorization
Query parameters
/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: ^/[^/]+/[^/]+([/@][^/]+)?$
Length: 1–500
true, skip LLM reranking and return top vector-search results directly. Trades relevance quality for lower latency.Default: "false"
truefalsePython 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.15.4.3. It wins over a version in libraryId. A value copied from a package file (^15.4.3, ~1.2, 15.x) keeps its first version. latest (any case) is the same as no version; any other value with no version (any) is a 400 validation_error with the message Invalid version, as on /v3/search. A version with indexed documentation is served as is. Otherwise a patch newer than every indexed version of its own minor gets that minor's newest version (v16.2.9 for 16.2.10); else the smallest indexed version above it in its major serves it (versions are tagged at the newest release of a group of releases whose docs barely differ, so that version covers the releases below it); for an old major newer than all its indexed versions, that major's newest version; else the current documentation. The response then names the version served (a Version note in text, the version field in JSON), except on a library whose versions Context7 maintains (one version per minor line), where a version of the requested minor counts as the requested version and gets no note.Pattern: ^([Ll][Aa][Tt][Ee][Ss][Tt]|(.*[^A-Za-z0-9._])?[Vv]?[0-9].*)$
Responses
version.Example:"/vercel/next.js"
version.libraries. The text response states the same in a leading version note when the status is unverified.