Get Context
POST/api/v1/developer/get-context
Retrieve context entries for SDK documentation, CLI commands, or API endpoints. This endpoint searches indexed services and returns relevant documentation, code examples, and usage guides based on your query.
Request
Headers
Body Parameters
Free-text query to search and rank relevant context entries. Be specific about what you’re looking for (e.g., “how to make POST request”, “list S3 buckets”, “authentication example”).
The
index_id
from the list-indexes endpoint. This identifies which indexed service to query.Example Request
Response
Success Response (200)
Indicates if the request was successful
Error message if the request failed, null otherwise
Contains the response data
Query Best Practices
Write effective queries to get the most relevant context:Be Specific
Be Specific
Good: “how to make authenticated POST request with JSON body”Less Good: “POST request”Include relevant details like authentication, data formats, or specific operations.
Use Action Words
Use Action Words
Good: “create S3 bucket with public access”, “list all running containers”Less Good: “S3 bucket”, “containers”Start with verbs that describe what you want to accomplish.
Include Context
Include Context
Good: “Python requests library timeout configuration”Less Good: “timeout”Mention the library, tool, or framework when relevant.
Ask Complete Questions
Ask Complete Questions
Good: “How do I handle pagination in REST API responses?”Less Good: “pagination”Phrase your query as a question or complete thought.
Error Responses
400 - Missing index_id
400 - Missing index_id
index_id
in your request.404 - Index not found
404 - Index not found
index_id
doesn’t exist. Use list-indexes to see available services.401 - Missing API key
401 - Missing API key
401 - Invalid API key
401 - Invalid API key
404 - User account missing
404 - User account missing
404 - No API key found
404 - No API key found
Use Cases
AI-Powered Code Assistants
Enhance your AI coding assistant with up-to-date library documentation and examples
Developer Tools
Build IDE extensions that provide contextual help based on the user’s current task
Documentation Chatbots
Create chatbots that answer developer questions with accurate, indexed documentation
Learning Platforms
Power educational platforms with dynamic, query-based code examples and tutorials
Best Practices
First List, Then Query: Always call list-indexes first to discover available services and get their
index_id
values.Iterate Your Queries: If the returned context isn’t quite right, refine your query to be more specific or try different phrasing.
Context Size: The returned context is optimized for relevance but may be lengthy. Consider implementing pagination or truncation in your application if needed.