This page is the shortest high-signal context dump for coding agents integrating TinyFish. Always use the official SDKs — they handle authentication, SSE streaming, retries, and typed responses so you don’t have to.Documentation Index
Fetch the complete documentation index at: https://docs.tinyfish.ai/llms.txt
Use this file to discover all available pages before exploring further.
For complete API reference in a single file, use llms-full.txt (218KB, includes all code examples). Note that
llms.txt is just an index — agents should use llms-full.txt for full context.MCP Server (Recommended for AI Assistants)
If you’re running inside an MCP-compatible host (Claude Code, Claude Desktop, Cursor, Windsurf), connect via MCP instead of the REST API — no API key management needed, OAuth handles auth automatically.Install the SDK
| API | Typical Latency | Suggested Timeout |
|---|---|---|
| Agent (sync) | 15-60s | 120s |
| Agent (SSE) | 15-60s (streaming) | N/A (SSE) |
| Search | 1-3s | 10s |
| Fetch | 1-20s | 150s |
| Browser (create) | 10-30s | 60s |
Authentication
Set your API key (get one from agent.tinyfish.ai/api-keys):TINYFISH_API_KEY from the environment automatically. See Authentication for more details.
Choose the Right TinyFish API
| API | Use it when | Docs |
|---|---|---|
| Agent | You want TinyFish to execute a goal on a real website | Agent reference |
| Search | You want ranked web results for a query | Search overview |
| Fetch | You want extracted page content from one or more URLs | Fetch overview |
| Browser | You want a remote browser session for direct Playwright/CDP control | Browser overview |
Quick Decision Tree
- Need data from a URL? — Agent API (goal-based extraction) or Fetch API (raw page content)
- Need search results? — Search API
- Need browser control? — Browser API (direct Playwright/CDP access)
SDK Examples
Agent — Streaming (Recommended)
Agent — Synchronous
Search
Fetch
Anti-Detection Mode
For sites with bot protection, add stealth mode and a proxy:Expected Latency
| API | Typical Latency | Suggested Timeout |
|---|---|---|
| Agent (sync) | 15-60s | 120s |
| Agent (SSE) | 15-60s (streaming) | N/A (SSE) |
| Search | 1-3s | 10s |
| Fetch | up to 30s per URL | 120s |
| Browser (create) | 10-30s | 60s |
Prompting
Goal quality determines success rate. Vague goals like “get the data” fail; crafted goals with explicit fields, output format, and edge-case handling succeed consistently.Common Gotchas
- Browser API session creation takes 10-30s — set
timeout=60on your HTTP client. - TypeScript needs
"type": "module"inpackage.jsonfor top-levelawait, or wrap code inasync function main() { ... }; main(). COMPLETEDstatus does not mean the goal succeeded — always checkresult_jsonfor failure signals like “captcha”, “blocked”, or “access denied”.- Fetch API has a 110s per-URL backend timeout — requests are also subject to a 120s CDN ceiling for the full batch. Set your client timeout to at least 150s.
Raw API Endpoints (cURL)
Raw API Endpoints (cURL)
What to Read Next
Agent reference
Goal-based automation, endpoint choice, runs, profiles, and proxies
Authentication
API key setup and troubleshooting
Search overview
Search query parameters and result shape
Fetch overview
Fetch multiple URLs and choose output formats
Browser overview
Create a remote browser session and connect via CDP
Examples
Copy-paste examples for common workflows
llms-full.txt
Complete API reference in a single file (218KB)