
Context7
- 377 installs
- 3 repo stars
- Updated January 23, 2026
- dotneet/claude-code-marketplace
context7 is a Claude Code skill that fetches up-to-date library and framework documentation through the Context7 API so developers coding against React, Next.js, Prisma, or other packages get current APIs instead of stal
About
context7 is a research plugin skill in dotneet/claude-code-marketplace that calls Context7 at https://context7.com/api/v2 with a CONTEXT7_API_KEY (ctx7sk- prefix). Its 3-step workflow resolves a library ID via GET /libs/search using libraryName and query, retrieves snippets via GET /context with libraryId and query, then answers with code examples and source URLs. Triggers include explicit "use context7" requests, library API questions, version-specific docs, and uncertain API details. The bundled references/api_reference.md documents authentication, trustScore selection, and 404/429 error handling. Use context7 whenever framework docs may have changed since model training—middleware setup, hook APIs, or package migrations.
- Pulls version-aware docs for popular libraries
- Cuts stale-training-data API mistakes in generated code
- Works as a marketplace connector inside Claude Code
- Speeds integration work with authoritative references
- Improves accuracy for fast-moving JS and cloud SDKs
Context7 by the numbers
- 377 all-time installs (skills.sh)
- Ranked #2,046 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dotneet/claude-code-marketplace --skill context7Add your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 377 |
|---|---|
| repo stars | ★ 3 |
| Last updated | January 23, 2026 |
| Repository | dotneet/claude-code-marketplace ↗ |
How do you get up-to-date library docs in Claude Code?
Fetch up-to-date library and framework documentation via Context7 so Claude answers and code changes match current APIs.
Who is it for?
Developers implementing against fast-moving JavaScript, Python, or web frameworks who need version-accurate API docs during agent-assisted coding.
Skip if: Tasks with no external library dependency, offline-only environments without CONTEXT7_API_KEY, or questions answerable from the local codebase alone.
When should I use this skill?
The user asks how to use a library API, requests code examples, says "use context7", or needs version-specific framework documentation verification.
What you get
Resolved Context7 library IDs, retrieved documentation snippets with trustScore metadata, version-matched code examples, and cited documentation source URLs.
- Version-matched code examples
- API explanations with documentation URLs
- Resolved Context7 library IDs
By the numbers
- 3-step workflow across Context7 /libs/search and /context API v2 endpoints
- Bundled references/api_reference.md documents Context7 authentication and error codes
Files
Context7
Overview
Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.
When to Use
Use this skill in the following cases:
1. Explicit instruction: When the user instructs "use context7" or "check the latest documentation" 2. Library usage questions: When asked about how to use a specific library's API, hooks, or functions 3. Code example requests: When asked for code examples using a specific library 4. Version-specific information: When library information for a specific version is needed 5. Uncertain API information: When your knowledge might be outdated and latest information verification is needed
Workflow
Step 1: Resolve Library ID
First, obtain the Context7 ID for the target library.
API call:
curl "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=CONTEXT_QUERY" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"Example:
# Search for React library
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"Criteria for selecting from response:
trustScore: Trust score (higher is better)totalSnippets: Number of available documents (more means richer information)versions: Verify that the required version is included
Step 2: Retrieve Documentation
Use the resolved library ID to retrieve specific documentation.
API call:
curl "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=SPECIFIC_QUERY" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"Example:
# Retrieve information about React's useEffect
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect cleanup function" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"Query best practices:
- Use specific queries ("useEffect cleanup function" rather than "hooks")
- Be clear about the purpose ("authentication middleware", "form validation", etc.)
Step 3: Respond to User
Respond to the user's question based on the retrieved documentation.
Information to include in the response:
- Retrieved code examples
- API explanations
- Documentation source URLs (for reference)
Examples
Example 1: React Hook Usage
User: "How do I write a cleanup function with React's useEffect?"
Execution steps: 1. Library search: libraryName=react, query=useEffect cleanup 2. Documentation retrieval: libraryId=/facebook/react, query=useEffect cleanup function 3. Respond with the latest code examples and best practices
Example 2: Next.js Routing
User: "Use context7 to show me how to implement authentication middleware with Next.js App Router"
Execution steps: 1. Library search: libraryName=next.js, query=middleware authentication 2. Documentation retrieval: libraryId=/vercel/next.js, query=middleware authentication route protection 3. Respond with the latest App Router compatible middleware implementation
Example 3: Multiple Libraries Combination
User: "How to create a button component using TailwindCSS and shadcn/ui"
Execution steps: 1. Resolve IDs for each library 2. Retrieve documentation for both 3. Respond with a combined implementation example
Error Handling
| Error | Solution |
|---|---|
| 404 (Not Found) | Search again with a different library name (e.g., "nextjs" → "next.js") |
| 429 (Rate Limit) | Wait a moment and retry |
| Empty response | Retry with a more general query |
Resources
For detailed API specifications, see references/api_reference.md.
- Endpoint details
- Response field descriptions
- Rate limit information
- Error code list
Context7 API Reference
Overview
Context7 is a service that provides LLMs with the latest library documentation. It solves the problem of outdated training data and non-existent APIs (hallucinations).
API Endpoints
Base URL
https://context7.com/api/v2Authentication
Authorization: Bearer CONTEXT7_API_KEYThe API key starts with the ctx7sk- prefix.
---
1. Library Search API
Endpoint
GET /libs/searchQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| libraryName | string | Yes | Library name to search (e.g., "react", "next.js") |
| query | string | No | Additional context query |
Response
{
"libraries": [
{
"id": "/facebook/react",
"name": "React",
"description": "A JavaScript library for building user interfaces",
"totalSnippets": 1250,
"trustScore": 9.5,
"benchmarkScore": 95,
"versions": ["18.2.0", "18.3.0", "19.0.0"]
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Context7 library ID (/org/project format) |
| name | string | Library display name |
| description | string | Library description |
| totalSnippets | number | Number of available documentation snippets |
| trustScore | number | Trust score (0-10) |
| benchmarkScore | number | Benchmark score (0-100) |
| versions | string[] | List of available versions |
Example
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
-H "Authorization: Bearer ctx7sk-xxx"---
2. Documentation Retrieval API
Endpoint
GET /contextQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| libraryId | string | Yes | Context7 library ID (e.g., "/facebook/react") |
| query | string | Yes | Search query (e.g., "useEffect cleanup") |
| page | number | No | Page number (1-10, default: 1) |
Response
{
"documentation": [
{
"title": "useEffect Hook",
"content": "# useEffect\n\nThe `useEffect` Hook lets you synchronize a component with an external system...",
"source": "https://react.dev/reference/react/useEffect"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
| title | string | Documentation title |
| content | string | Documentation content in Markdown format |
| source | string | Original documentation source URL |
Example
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect" \
-H "Authorization: Bearer ctx7sk-xxx"---
Rate Limits
| Tier | Requests/min |
|---|---|
| No API Key | 10 |
| Free | 100 |
| Pro | 1000 |
| Enterprise | Custom |
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 404 | Not Found - Library not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Best Practices
1. Always resolve library ID before use: Don't guess library IDs directly; first obtain the accurate ID through the search API 2. Use specific queries: Specific queries like "useEffect cleanup function" are more effective than "hooks" 3. Error handling: When receiving 404, try searching with a different library name
Related skills
How it compares
Use context7 when you need live, version-specific framework docs during coding; use local codebase search when the answer is already in repository source files.
FAQ
What API key does the context7 skill require?
The context7 skill requires a CONTEXT7_API_KEY environment variable sent as a Bearer token to https://context7.com/api/v2. Context7 API keys use the ctx7sk- prefix according to the bundled API reference.
How does context7 select the right library match?
The context7 skill calls GET /libs/search with libraryName and query, then prefers higher trustScore, richer totalSnippets, and responses that include the requested version before calling GET /context.
When should context7 run during development?
The context7 skill should run when users ask library API questions, request examples, need version-specific docs, or explicitly say "use context7." It is meant to verify APIs that may have changed since model training.