context7

Fetch version-specific library documentation and code examples via the Context7 REST API.

Updated Nov 7, 2024
One-click install
npx skills add https://github.com/jeremysball/dotfiles --skill context7-jeremysball
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context7
Source: https://github.com/jeremysball/dotfiles/tree/main/.pi/skills-archive/context7
Command: npx skills add https://github.com/jeremysball/dotfiles --skill context7-jeremysball

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM training data often contains outdated or hallucinated API references for libraries. This Skill retrieves current, version-specific documentation and code examples from the Context7 API so answers are grounded in real docs. ## Core Features & Use Cases - Library Search: Find Context7-compatible library IDs (e.g., /facebook/react) using the /api/v2/libs/search endpoint with LLM-powered ranking. - Documentation Context: Query the /api/v2/context endpoint to get reranked documentation snippets and code examples for a specific library and question. - Use Case: When writing code against FastAPI and unsure of the current dependency injection syntax, query Context7 for /tiangolo/fastapi with the question "dependency injection" to receive accurate, current examples instead of relying on stale training data. ## Quick Start Ask the assistant to look up the current documentation for the React useState hook using Context7.

Frequently Asked Questions about context7

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get up-to-date library documentation with Context7?

First call the /api/v2/libs/search endpoint with the library name to find its library ID, then call /api/v2/context with that libraryId and a natural language query. Both endpoints accept plain curl requests with optional Bearer token authentication.

What is the Context7 library ID format?

Library IDs follow the /org/project pattern, such as /facebook/react, /tiangolo/fastapi, or /numpy/numpy. Use the libs/search endpoint to find the correct ID for any indexed library.

Do I need an API key to use the Context7 API?

An API key is optional but recommended. Without a key, requests are rate-limited per IP; with a free key from context7.com/dashboard set as CONTEXT7_API_KEY, you get higher rate limits based on your plan.

Why does Context7 return no results for my library?

No results usually means the libraryId format is wrong, the library is not indexed, or the query is too narrow. Verify the ID uses the /org/project format, check coverage at context7.com, and try broader search terms.

How do I fix Context7 429 rate limit errors?

A 429 response means you exceeded the request limit. Wait and retry, obtain a free API key for higher limits, cache responses for repeated queries, and batch related documentation lookups.