API Documentation

Everything you need to integrate SearchClaw into your application.

Authentication

Every request requires an API key. Pass it via the X-API-Key header or as a Bearer token.

# Option 1: X-API-Key header
curl https://api.searchclaw.dev/v1/search?q=hello \
  -H "X-API-Key: sc_live_xxxxxxxxxxxxxxxxxx"

# Option 2: Bearer token
curl https://api.searchclaw.dev/v1/search?q=hello \
  -H "Authorization: Bearer sc_live_xxxxxxxxxxxxxxxxxx"

Key prefixes: Production keys start with sc_live_ and sandbox keys start with sc_test_. Sandbox keys return mock data and are not metered.

Base URL

https://api.searchclaw.dev/v1

All endpoints are relative to this base URL. HTTPS is required.

Rate Limiting

Rate limits are per API key and depend on your plan tier. Limits are enforced using a sliding window algorithm.

Plan Rate Limit Monthly Credits
Free1 req/sec1,000
Starter5 req/sec15,000
Pro20 req/sec100,000
Scale50 req/sec500,000

When rate limited, you'll receive a 429 response with a Retry-After header indicating seconds to wait.

Error Handling

All errors return a consistent JSON format:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry after 2 seconds.",
    "status": 429
  }
}
Status Code Description
400invalid_requestMissing or invalid parameters
401unauthorizedMissing or invalid API key
403forbiddenAPI key doesn't have access to this resource
429rate_limit_exceededToo many requests
402credits_exhaustedMonthly credits used up
500internal_errorServer error — retry with backoff

Endpoints

GET

/v1/search/ai

LLM-optimized search that returns RAG-ready results. Costs 2 credits per query.

Premium endpoint: Results include longer snippets (up to 500 chars), markdown formatting, deduplication, relevance ranking, and a context field with concatenated top-3 snippets ready for RAG injection.

Parameters

Same parameters as /v1/search.

Example Request

curl "https://api.searchclaw.dev/v1/search/ai?q=kubernetes+pod+restart+policy" \
  -H "X-API-Key: sc_live_xxxxxxxxxx"

Example Response

{
  "query": "kubernetes pod restart policy",
  "context": "A PodSpec has a restartPolicy field with possible values Always, OnFailure, and Never. The default value is Always. The restart policy applies to all containers in the Pod...",
  "results": [
    {
      "title": "Pod Lifecycle | Kubernetes",
      "url": "https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/",
      "snippet": "A PodSpec has a restartPolicy field with possible values Always, OnFailure, and Never...",
      "source": "google",
      "position": 1
    }
  ],
  "meta": {
    "credits_used": 2,
    "cached": true,
    "response_time_ms": 12
  }
}
GET

/v1/news

Search for news articles. Returns results with publication dates, source names, and thumbnails.

Parameters

Same parameters as /v1/search.

Example Response

{
  "query": "AI startups 2026",
  "results": [
    {
      "title": "Top AI Startups to Watch in 2026",
      "url": "https://example.com/article",
      "snippet": "The AI landscape continues to evolve rapidly...",
      "published_date": "2026-03-01T10:30:00Z",
      "source_name": "TechCrunch",
      "thumbnail": "https://example.com/thumb.jpg",
      "position": 1
    }
  ],
  "meta": {
    "total_results": 10,
    "cached": false,
    "response_time_ms": 456,
    "engines_used": ["google news", "bing news"]
  }
}
GET

/v1/images

Search for images. Returns thumbnails, source URLs, and dimensions.

Parameters

Same parameters as /v1/search.

Example Response

{
  "query": "golden retriever puppy",
  "results": [
    {
      "title": "Golden Retriever Puppy",
      "thumbnail_url": "https://example.com/thumb.jpg",
      "source_url": "https://example.com/page",
      "width": 1200,
      "height": 800,
      "source_name": "Example.com",
      "position": 1
    }
  ],
  "meta": {
    "total_results": 10,
    "cached": false,
    "response_time_ms": 289,
    "engines_used": ["google images", "bing images"]
  }
}
GET

/v1/suggest

Autocomplete suggestions for a partial query. Fast, cached aggressively.

Parameters

Param Type Required Description
qstringYesPartial query for autocomplete

Example Request

curl "https://api.searchclaw.dev/v1/suggest?q=kube" \
  -H "X-API-Key: sc_live_xxxxxxxxxx"

Example Response

[
  "kubernetes",
  "kubernetes tutorial",
  "kubernetes vs docker",
  "kubernetes pods",
  "kubelet"
]
GET

/v1/usage

Check your current billing period usage, remaining credits, and plan information.

Example Request

curl "https://api.searchclaw.dev/v1/usage" \
  -H "X-API-Key: sc_live_xxxxxxxxxx"

Example Response

{
  "plan": "pro",
  "billing_period": {
    "start": "2026-03-01T00:00:00Z",
    "end": "2026-03-31T23:59:59Z"
  },
  "credits": {
    "total": 100000,
    "used": 14523,
    "remaining": 85477
  },
  "rate_limit": {
    "requests_per_second": 20
  },
  "usage_today": {
    "queries": 342,
    "cache_hit_rate": 0.64
  }
}

Response Headers

Every API response includes these headers:

Header Description Example
X-RateLimit-LimitMax requests per second20
X-RateLimit-RemainingRemaining requests in window17
X-RateLimit-ResetUnix timestamp when limit resets1709571600
X-Credits-UsedCredits consumed by this request1
X-Credits-RemainingCredits left in billing period14523

SDKs

Official client libraries for quick integration.

Python

pip install searchclaw

from searchclaw import SearchClaw
client = SearchClaw(api_key="sc_live_xxxxxxxxxx")
results = client.search("your query")

Node.js

npm install searchclaw

import { SearchClaw } from 'searchclaw';
const client = new SearchClaw({ apiKey: 'sc_live_xxxxxxxxxx' });
const results = await client.search('your query');