Skip to main content

Base URL

All API requests should be made to:
https://www.goharvest.ai/api/v1/developer/

Core Endpoints

1. Get Context

POST /get-context Search across all indexed documentation to retrieve relevant code examples and usage guides.
  • Purpose: Search all available indexed services for specific documentation and examples
  • Returns: Array of documentation chunks ranked by relevance with scores
  • Use Case: Power AI assistants, chatbots, or developer tools with up-to-date documentation
  • Error codes:
    • 400: No subscription found
    • 404: User account not found
    • 401: API key missing or invalid API key

2. Add Index

POST /add-index Add a new index with a source URL for indexing SDK/CLI/API documentation.
  • Purpose: Create custom indexes for your own documentation or third-party services
  • Returns: Created index details including index_id and indexing status
  • Use Case: Index internal APIs, third-party documentation, or any web-based docs
  • Error codes:
    • 400: Invalid URL
    • 403: Subscription required
    • 409: URL already indexed or indexing in progress
    • 401: API key missing or invalid API key

Authentication

All endpoints require API key authentication via the API-Key header:
curl -H "API-Key: your-api-key" https://www.goharvest.ai/api/v1/developer/

Response Formats

All endpoints return JSON responses with a consistent structure:
{
  "ok": true,
  "error": null,
  "data": { /* endpoint-specific data */ }
}
  • HTTP Status Codes: Standard REST conventions (200, 400, 401, 404, etc.)

Rate Limits

  • API endpoints: 100 requests per minute per API key
  • Context retrieval: Unlimited queries based on your subscription plan

Error Handling

All endpoints return structured error responses:
{
  "detail": "Error description",
  "status_code": 404
}
Common error codes:
  • 400: Missing required parameters
  • 401: Invalid or missing API key
  • 404: Resource not found (index, user account)
  • 429: Rate limit exceeded

Getting Started

To start using the API:
  1. Get your API key from the Harvest dashboard
  2. Optionally, use add-index to create custom indexes for your own documentation
  3. Use get-context to search across all available documentation

Example Workflow

import requests

# 1. Add a custom index (optional)
response = requests.post(
    "https://www.goharvest.ai/api/v1/developer/add-index",
    headers={"API-Key": "your-api-key", "Content-Type": "application/json"},
    json={
        "index_name": "My Internal API",
        "url": "https://docs.mycompany.com/api"
    }
)
index_id = response.json()['data']['index_id']
print(f"Created new index: {index_id}")

# 2. Search for relevant documentation
response = requests.post(
    "https://www.goharvest.ai/api/v1/developer/get-context",
    headers={"API-Key": "your-api-key", "Content-Type": "application/json"},
    json={"query": "Python requests library POST with authentication"}
)
chunks = response.json()['data']['context']
print(f"Found {len(chunks)} relevant chunks:")
for chunk in chunks:
    print(f"Score: {chunk['score']:.2f}")
    print(f"Content: {chunk['content'][:200]}...\n")
The get-context endpoint automatically searches across all your available indexes (both public and your own).

Next Steps