{"openapi":"3.0.3","info":{"title":"anysearch","version":"0.1.0","description":"Unified search + scrape + agent gateway over a pooled TinyFish key ring. Search (30 rpm/key) and Fetch (150 urls/min/key) limits are lifted across N keys with slot reservation, with bounded queueing and one 429 failover. `links`/`image_links`/`format`/`ttl`/selectors pass through to TinyFish."},"servers":[{"url":"https://anysearch.site","description":"production"}],"security":[{"XApiKey":[]}],"paths":{"/search":{"get":{"summary":"Web search","description":"Ranked web results via the pooled TinyFish Search API.","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"},"description":"Search query"},{"name":"max_results","in":"query","schema":{"type":"integer","default":5,"minimum":1,"maximum":20}}],"responses":{"200":{"description":"Search results"},"401":{"description":"Missing or invalid X-API-Key"},"429":{"description":"All keys busy beyond admission budget"}}}},"/search/batch":{"post":{"summary":"Batch web search","description":"Fire up to 10 independent queries concurrently and return all results in one response — one round trip instead of N. Each query still consumes its own pool rate-limit slot; a per-query failure lands in that entry's `error` field rather than failing the whole batch.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["queries"],"properties":{"queries":{"type":"array","items":{"type":"string"},"maxItems":10},"max_results":{"type":"integer","default":5,"minimum":1,"maximum":20}}}}}},"responses":{"200":{"description":"results[]: {query, data} on success or {query, error} on failure"},"400":{"description":"queries[] missing or exceeds 10"},"401":{"description":"Missing or invalid X-API-Key"}}}},"/fetch":{"post":{"summary":"Scrape URLs","description":"Fetch one or more URLs (max 10) and extract content. Passes through TinyFish Fetch params: format (markdown|html|json), links, image_links, ttl, include_selectors, exclude_selectors, purpose.","requestBody":{"content":{"application/json":{"schema":{"type":"object","anyOf":[{"required":["urls"]},{"required":["url"]}],"properties":{"url":{"type":"string","format":"uri","description":"Single URL alias"},"urls":{"type":"array","items":{"type":"string"},"maxItems":10},"fallback":{"type":"string","enum":["none","firecrawl"],"description":"Opt-in renderer; configured Worker secret required; markdown without selectors only"},"format":{"type":"string","enum":["markdown","html","json"],"default":"markdown"},"links":{"type":"boolean","default":false},"image_links":{"type":"boolean","default":false},"ttl":{"type":"integer","description":"cache freshness in seconds; 0 = live"},"include_selectors":{"type":"array","items":{"type":"string"},"maxItems":20},"exclude_selectors":{"type":"array","items":{"type":"string"},"maxItems":20},"purpose":{"type":"string"}}}}}},"responses":{"200":{"description":"Extracted results (per-URL errors in errors[])"},"401":{"description":"Missing or invalid X-API-Key"}}}},"/agent":{"post":{"summary":"Autonomous research agent","description":"DeepSeek-V4-Flash ReAct loop over search + scrape + social tools. Give it a task; it gathers evidence and answers with citations. Response: { answer, steps: [{tool, args, result}], sources: {url: text} } — every scraped page's text is returned so citations can be byte-checked.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string"},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"default":"medium"}}}}}},"responses":{"200":{"description":"{ answer, steps, sources }"},"401":{"description":"Missing or invalid X-API-Key"}}}},"/mcp":{"post":{"summary":"Model Context Protocol endpoint","description":"Streamable HTTP MCP server exposing tools: search, scrape, agent, social. Codex and Claude Code can connect directly.","responses":{"200":{"description":"MCP JSON-RPC response"},"401":{"description":"Missing or invalid X-API-Key"}}}},"/health":{"get":{"summary":"Pool health","security":[],"description":"Pool/account readiness. Empty pool returns 503. Unauthenticated.","responses":{"200":{"description":"Pool status"}}}},"/admin/accounts":{"post":{"summary":"Register a TinyFish key (operator)","description":"Adds a completed-signup key to the KV pool; live within ~1 minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"email":{"type":"string"}}}}}},"responses":{"200":{"description":"Key registered"},"401":{"description":"Missing or invalid X-API-Key"}}}}},"components":{"securitySchemes":{"XApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Per-user key (`as-…`) from https://anysearch.site/dashboard; also accepted as `Authorization: Bearer`. Free tier: 500 credits/month (search 1, fetch 1/url, social 1, agent 10) → 402 QUOTA_EXCEEDED when spent. @opactor.com / @anymorph.ai accounts are unlimited."}}}}