AnySearch API Reference

Unified search infrastructure for AI

API Base URLhttps://api.anysearch.com

Two steps to plug AI-grade search into your app: grab an API key from the dashboard (or skip it and try the free anonymous tier), then fire your first search request.

Anonymous request (per-IP free quota)

BASH
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

curl -X POST https://api.anysearch.com/v1/search \

-H "Content-Type: application/json" \

-d '{

"query": "What is quantum computing?",

"max_results": 5

}'

Authenticated request (with API key)

BASH
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7

curl -X POST https://api.anysearch.com/v1/search \

-H "Authorization: Bearer ss_sk_your_api_key_here" \

-H "Content-Type: application/json" \

-d '{

"query": "What is quantum computing?",

"max_results": 5

}'

Authentication

The AnySearch search API (/v1/*) supports flexible authentication. You can decide whether to send an API key based on where you are in your product lifecycle:

ModeHeader formatQuota & rate limit policy
AnonymousNo Authorization headerRate-limited per client IP and metered against the daily free quota.
AuthenticatedAuthorization: Bearer ss_sk_xxxBilled against the paid quota attached to the key, with higher concurrency limits.
Heads up: If you send an Authorization header but the key is invalid, disabled, or expired, the gateway returns 401 Unauthorized or 403 Forbidden — it will not silently fall back to anonymous mode.

API Endpoints

The unified search endpoint. The gateway routes the query to the best providers based on intent, then fuses and re-ranks the results.

API key optional (anonymous traffic is rate-limited per IP and consumes the daily free quota)

Request parameters

FieldDescription
query (string) *Search query.
max_results (int)Number of results to return. Defaults to 10. Range: 1–100.
domains (string[])Domain filter, e.g. ["tech", "academic"].
tags (string[])Sub-domain tags in the form {domain}.{sub_domain}.
content_types (string[])Content-type filter, e.g. ["web", "news"].
zone (string)Region: cn or intl.
language (string)Preferred language, e.g. zh-CN or en.
providers (string[])Explicit list of providers to use.
constraint.freshness (string)Recency window: day, week, month, year.
constraint.from (string)Start time (RFC3339).
constraint.to (string)End time (RFC3339).

Request example

BASH
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9

curl -X POST https://api.anysearch.com/v1/search \

-H "Authorization: Bearer ss_sk_test_key" \

-H "Content-Type: application/json" \

-d '{

"query": "Go 1.22 release notes",

"max_results": 5,

"domains": ["code", "tech"],

"content_types": ["web", "doc"]

}'

Response example

JSON (200 OK)
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21

{

"results": [

{

"title": "Go 1.22 Release Notes",

"url": "https://go.dev/doc/go1.22",

"description": "Go 1.22 is a major release...",

"content": "Detailed content here...",

"source": "web",

"score": 0.87,

"quality_score": 0.95,

"published_at": "2024-02-06T00:00:00Z"

}

],

"metadata": {

"total_results": 1,

"search_time_ms": 342,

"routes_queried": 2,

"routes_succeeded": 2,

"request_id": "req_abc123"

}

}

Response Format

A successful 200 response returns a JSON body with a results array and a metadata object.

Result fields

FieldDescription
title (string)Result title.
url (string)Original source URL.
description (string)Short summary.
content (string)Cleaned-up body content.
raw_content (string)Original body content before cleaning.
source (string)Generic source type, such as web, code, academic, doc, or news.
score (float)Relevance score reported by the provider itself.
quality_score (float)Composite quality score from the Scorer, on a 0–1 scale (optional).
signal_scores (object)Per-signal debug scores (optional).
published_at (string)Publication timestamp in RFC3339 (optional).

Metadata fields

FieldDescription
total_results (int)Total number of results returned.
search_time_ms (int)End-to-end search latency in milliseconds.
routes_queried (int)Number of provider routes attempted.
routes_succeeded (int)Number of provider routes that returned results successfully.
cached (bool)Whether the response came from the gateway cache.
capability_errors (array)Errors from individual capabilities (internal provider names are never leaked).
request_id (string)Tracing ID for the request.

Full response example

JSON (200 OK)
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28

{

"results": [

{

"title": "Chernobyl disaster - Wikipedia",

"url": "https://en.wikipedia.org/wiki/Chernobyl_disaster",

"description": "The Chernobyl disaster began on 26 April 1986 ...",

"content": "On 26 April 1986, reactor No. 4 ...",

"raw_content": "...",

"source": "web",

"score": 0.87,

"quality_score": 0.78,

"signal_scores": {

"freshness": 12,

"authority": 31

},

"published_at": "1986-04-26T01:23:00Z"

}

],

"metadata": {

"total_results": 5,

"search_time_ms": 412,

"routes_queried": 2,

"routes_succeeded": 2,

"request_id": "req_01HXXXXXXX",

"cached": false,

"capability_errors": []

}

}

Error Codes

Every error response includes a request_id field. 429 responses also carry Retry-After and X-RateLimit-* headers.

StatuscodeDescription
400Invalid request parameters (empty query, bad domain/zone/freshness, etc.)
400invalid_providerUnknown provider name in providers list
401Invalid, disabled, or unknown API key (authenticated requests only)
402daily_free_quota_exhaustedAnonymous IP free quota exhausted (see Auto-Registration Flow)
402quota_exhaustedPaid quota on the API key exhausted
403API key expired or account disabled
403private_capability_not_enabledPrivate provider not bound to this key
429rate_limit_exceeded_userPer-user rate limit hit
429rate_limit_exceededPer-key/IP rate limit hit
503quota_check_failedQuota check service unavailable
503provider_unavailablePinned provider is offline
503capability_temporarily_unavailableRouted capability temporarily down

Error response example

JSON (402)
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

{

"code": "quota_exhausted",

"error": "quota exhausted",

"message": "You've hit your quota limit. Top up to keep using the API.",

"request_id": "req_xxx"

}

Enum Reference

Allowed values for the enum fields most commonly used in API calls.

Domains (22 values)

generalcodetechfashiontravelhomeecommercegamingfilmmusicfinanceacademiclegalbusinessipsecurityeducationhealthreligiongeoenvironmentenergy

Content Types (9 values)

webnewscodedocacademicdataimagevideoaudio

Zone (2 values)

cnintl

Freshness (4 values)

dayweekmonthyear