Context7 Platform -- Up-to-date docs for AI agents
docs: correct search version fallback behavior (#3465)
context7[bot]1a28c5348a7f
diff --git a/docs/sdks/ts/commands/search.mdx b/docs/sdks/ts/commands/search.mdxindex 30f95d54..2252482e 100644--- a/docs/sdks/ts/commands/search.mdx+++ b/docs/sdks/ts/commands/search.mdx@@ -21,7 +21,7 @@ The SDK returns structured JSON by default, consistent with its other methods. SUp to four library names or Context7 library IDs. These hints narrow the search when you already know which products are relevant.</ParamField><ParamField path="version" type="string">- A version to search. Provide at least one library hint. With one library hint, the version is strict and Search returns 404 if no matching tag exists. With multiple libraries, it is a contextual preference.+ A version to search. Provide at least one library hint. With one library hint, Search serves the requested version; if no indexed tag matches it, Search serves the newest stable release of the same line or the current documentation. With multiple libraries, it is a contextual preference.</ParamField><ParamField path="language" type="string">A programming language to prefer when ranking snippets, such as `TypeScript` or `Python`. This is a preference, so Context7 can still return product documentation when a language-specific snippet is unavailable.diff --git a/docs/search-api.mdx b/docs/search-api.mdxindex 7b4daa64..aca2da22 100644--- a/docs/search-api.mdx+++ b/docs/search-api.mdx@@ -76,10 +76,12 @@ curl -G "https://context7.com/api/v3/search" \| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- || `query` | The question or task. Required. || `library` | A library name (`next.js`) or Context7 ID (`/vercel/next.js`). Repeat for up to four hints. |-| `version` | A version such as `15.4.0`. Requires at least one `library`. Strict with one library, a preference with several. |+| `version` | A version such as `15.4.0`. Requires at least one `library`. With one library, the nearest release if it is missing (below); with several, a preference. || `language` | A programming language to prefer, such as `TypeScript`. It is a preference, so language-neutral documentation can still appear. || `type` | `txt` (default) or `json`. |+With one `library`, Search serves the requested version. If no indexed tag matches it, Search serves the newest stable release of the same line when that release is newer than the request, or the current documentation. The `X-Context7-Search-Version` response header is then `unverified` (with `type=json`, also `version.status`).+If nothing matches, the API returns `404 no_documentation_found`. Treat it as an empty result.## Pricing