> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Context7

> Up-to-date, version-specific documentation and code snippets for software libraries, ranked for a question; plus reading one web page narrowed to a question.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/context7.webp?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=6c5ee780ed582bc650efe313a46cc370)

[Web Catalog · Developer](https://docs.webrouter.net/data-apis.md?category=developer)

Key for some calls

Endpoints

5

Auth

Key in header

[Vendor docs](https://context7.com/docs/api-guide)

&#x20;·&#x20;

[Pricing](https://context7.com/plans)

## Setup

| Variable | | What it is |
| - | - | - |
| `CONTEXT7_API_KEY` | some calls | A Context7 API key (context7.com/dashboard; starts with ctx7sk). Optional: search and docs work anonymously at low rate limits; a key raises them and reaches private libraries. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Library ids are URL paths: /owner/repo for GitHub (/vercel/next.js), /\<source>/\<id> otherwise; pin a version with /owner/repo/\<version> or /owner/repo@\<version>.
* Typical flow: libs.search to find the id, then docs.context with it; or docs.search in one call when the library is known by name.
* Answers are plain text by default; send type=json for structured results.
* Over the limit answers 429 with Retry-After and RateLimit-Limit/-Remaining/-Reset headers; usage.get shows the month's requests.

## Endpoints

GET

Find a library by name

Context7 libraries matching a name, ranked against the question you are trying to answer.

[Open](#context7-libs-search)

GET

Get documentation for a library

The snippets and doc sections of one library most relevant to a question, reranked.

[Open](#context7-docs-context)

GET

Search documentation in one call

Picks up to four relevant libraries for a question, fetches and reranks their docs, and returns one answer-sized result.

[Open](#context7-docs-search)

GET

Read a web page, optionally only the parts answering a question

A public page rendered to Markdown, whole in token-sized slices or narrowed to the sections that answer a question.

[Open](#context7-page-fetch)

GET

Get API usage

This month's requests for the key's member and the teamspace, extra-request cost and daily counts.

[Open](#context7-usage-get)

### Find a library by name

GET

`/v2/libs/search`

`context7.libs.search`

Context7 libraries matching a name, ranked against the question you are trying to answer.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`libraryName` required</td><td>string</td><td>query</td><td>Library name, up to 500 characters. Example `react`</td></tr>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>The user's question or task, used for ranking. Example `I need to manage state`</td></tr>
    <tr><td>`fast`</td><td>string</td><td>query</td><td>true skips LLM reranking for lower latency. Default false. One of `true`, `false`</td></tr>
  </tbody>
</table>

[Vendor docs](https://context7.com/docs/api-reference/search/search-for-libraries)

```python Python theme={null}
router.call_data_api("context7.libs.search", {'libraryName': 'react', 'query': 'I need to manage state'})
```

```text MCP theme={null}
call_data_api(endpoint="context7.libs.search", params={"libraryName": "react", "query": "I need to manage state"})
```

### Get documentation for a library

GET

`/v2/context`

`context7.docs.context`

The snippets and doc sections of one library most relevant to a question, reranked.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`libraryId` required</td><td>string</td><td>query</td><td>Context7 library id, optionally with a version. Example `/facebook/react`</td></tr>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>The question or task, up to 500 characters. Example `How do I use useState?`</td></tr>
    <tr><td>`type`</td><td>string</td><td>query</td><td>Default txt. One of `json`, `txt`</td></tr>
    <tr><td>`fast`</td><td>string</td><td>query</td><td>true skips LLM reranking. One of `true`, `false`</td></tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Programming language to rank first, e.g. Python; a soft preference.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://context7.com/docs/api-reference/context/get-documentation-context)

```python Python theme={null}
router.call_data_api("context7.docs.context", {'libraryId': '/facebook/react', 'query': 'How do I use useState?'})
```

```text MCP theme={null}
call_data_api(endpoint="context7.docs.context", params={"libraryId": "/facebook/react", "query": "How do I use useState?"})
```

> [!NOTE]
>
> * A version that is not indexed is not an error: the nearest matching or newer stable release is served instead.

### Search documentation in one call

GET

`/v3/search`

`context7.docs.search`

Picks up to four relevant libraries for a question, fetches and reranks their docs, and returns one answer-sized result.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `query`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        The question or task, up to 2000 characters; pasted error output is fine.
      </td>
    </tr>

    <tr>
      <td>
        `library`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Up to four library hints, repeated: a name like next.js or an id like /vercel/next.js.
      </td>
    </tr>

    <tr>
      <td>
        `version`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Version preference such as 15 or v2.3.1, or latest.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Programming-language preference; soft.
      </td>
    </tr>

    <tr><td>`context`</td><td>string</td><td>query</td><td>broad appends up to \~3,500 more tokens of the best pages. One of `broad`</td></tr>
    <tr><td>`type`</td><td>string</td><td>query</td><td>Default txt. One of `json`, `txt`</td></tr>
  </tbody>
</table>

[Vendor docs](https://context7.com/docs/api-reference/search/search-documentation-in-one-request) · Same job: [Read the Docs](https://docs.webrouter.net/data-apis/readthedocs.md#readthedocs-search)

### Read a web page, optionally only the parts answering a question

GET

`/v3/fetch`

`context7.page.fetch`

A public page rendered to Markdown, whole in token-sized slices or narrowed to the sections that answer a question.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `url`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Public http(s) URL; local and private addresses are refused.
      </td>
    </tr>

    <tr>
      <td>
        `query`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Question to narrow the page to.
      </td>
    </tr>

    <tr>
      <td>
        `tokens`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        100 to 10000. With query, caps the sections (default 1000); without, the slice size (default 5000).
      </td>
    </tr>

    <tr>
      <td>
        `offset`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Character offset when query is absent; send nextOffset from the previous answer.
      </td>
    </tr>

    <tr><td>`type`</td><td>string</td><td>query</td><td>Default txt. One of `json`, `txt`</td></tr>
  </tbody>
</table>

[Vendor docs](https://context7.com/docs/api-reference/search/read-one-web-page-optionally-narrowed-to-a-question) · Same job: [Andi AI Search](https://docs.webrouter.net/data-apis/andi.md#andi-fetch), [Context.dev](https://docs.webrouter.net/data-apis/branddev.md#branddev-web-scrape), [Brave Search](https://docs.webrouter.net/data-apis/bravesearch.md#bravesearch-llm-context), [BytePlus Searchinfinity](https://docs.webrouter.net/data-apis/byteplus-search.md#byteplus-search-fetch), [cloro](https://docs.webrouter.net/data-apis/cloro.md#cloro-google-product), [Crawl4AI Cloud](https://docs.webrouter.net/data-apis/crawl4ai.md#crawl4ai-scrape)

> [!NOTE]
>
> * With query, a page that does not answer it returns 404 no\_relevant\_content: try another page.

### Get API usage

GET

`/v2/usage`

`context7.usage.get`

Needs&#x20;

`CONTEXT7_API_KEY`

This month's requests for the key's member and the teamspace, extra-request cost and daily counts.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `days`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Days of daily history, 1 to 90, default 30 (free plans at most 10).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://context7.com/docs/api-reference/usage/get-api-usage)

```python Python theme={null}
router.call_data_api("context7.usage.get")
```

```text MCP theme={null}
call_data_api(endpoint="context7.usage.get")
```

> [!NOTE]
>
> * Needs an API key. Calls to it are not counted.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.