REST API

The QuantSearch REST API allows you to build custom integrations, ingest content programmatically, and create your own search interfaces. API access is available on Pro and Enterprise plans.

Pro & Enterprise

API access requires a Pro or Enterprise subscription. Upgrade your plan to get API keys.

Base URLs

Purpose URL
Authenticated API https://www.quantsearch.ai/api
Public Search/Chat (CDN) https://cdn.quantsearch.ai/v1

Authentication

Authenticated API requests require an API key in the Authorization header:

curl https://www.quantsearch.ai/api/sites \
  -H "Authorization: Bearer YOUR_API_KEY"

Generate API keys in your Dashboard → API Keys.

Public Endpoints

These endpoints don't require authentication but need to be enabled in your site's public access settings:

Search

# GET request (cacheable via CDN)
curl "https://cdn.quantsearch.ai/v1/public/sites/{siteId}/search?q=how+to+reset+password"

# POST request (for complex queries)
curl -X POST https://cdn.quantsearch.ai/v1/public/sites/{siteId}/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "how to reset password",
    "limit": 10,
    "minScore": 0.3
  }'

Response:

{
  "query": "how to reset password",
  "results": [
    {
      "url": "https://example.com/help/reset-password",
      "title": "Password Reset Guide",
      "snippet": "To reset your password, click the 'Forgot Password' link...",
      "score": 0.89
    }
  ],
  "totalResults": 5,
  "timingMs": 45
}

Chat

curl -X POST https://cdn.quantsearch.ai/v1/public/sites/{siteId}/chat \
  -H "Content-Type: application/json" \
  -d '{
    "message": "how do I reset my password?",
    "sessionId": "optional-session-id"
  }'

Response:

{
  "response": "To reset your password, go to the login page and click 'Forgot Password'. Enter your email address and we'll send you a reset link. The link expires after 24 hours.",
  "sources": [
    {
      "url": "https://example.com/help/reset-password",
      "title": "Password Reset Guide",
      "relevance": 0.89
    }
  ],
  "sessionId": "sess_abc123"
}

Group Search (Federated)

Search across multiple sites in a group (Pro+ feature):

# Search across all sites in a group
curl "https://cdn.quantsearch.ai/v1/public/groups/{groupId}/search?q=password+reset"

Authenticated Endpoints

List Sites

curl https://www.quantsearch.ai/api/sites \
  -H "Authorization: Bearer YOUR_API_KEY"

Get Site

curl https://www.quantsearch.ai/api/sites/{siteId} \
  -H "Authorization: Bearer YOUR_API_KEY"

Create Site

curl -X POST https://www.quantsearch.ai/api/sites \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Documentation",
    "baseUrl": "https://docs.example.com",
    "crawlerConfig": {
      "maxPages": 1000,
      "maxDepth": 5
    }
  }'

Ingest Content

Ingest content directly without crawling:

curl -X POST https://www.quantsearch.ai/api/sites/{siteId}/pages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pages": [
      {
        "url": "https://example.com/page1",
        "title": "Page Title",
        "content": "Full page content here...",
        "summary": "Optional summary",
        "tags": ["tag1", "tag2"]
      }
    ]
  }'

Delete Content

curl -X DELETE https://www.quantsearch.ai/api/sites/{siteId}/pages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.com/page-to-delete"]
  }'

Rate Limits

Endpoint Type Limit
Public Search 60 requests/minute per IP
Public Chat 20 requests/minute per IP
Authenticated API 1000 requests/minute per key

Rate limit headers are included in responses:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1702500000

Errors

The API returns standard HTTP status codes:

Code Meaning
200 Success
400 Bad request (invalid parameters)
401 Unauthorized (invalid or missing API key)
403 Forbidden (origin not allowed, or feature not enabled)
404 Not found
429 Rate limit exceeded
500 Server error

Error responses include a JSON body:

{
  "error": "Rate limit exceeded",
  "retryAfter": 30
}

OpenAPI Specification

Download the full OpenAPI specification for code generation and API exploration.