The Agent API is the right choice when TinyFish should decide the browser actions. If you need direct browser control instead, use the Browser API.
Canonical Endpoints
| Endpoint | Pattern | Best for |
|---|---|---|
/run | Synchronous | Quick tasks and simple integrations |
/run-async | Start then poll | Long tasks and batch processing |
/run-sse | Live event stream | Real-time progress in user-facing apps |
Before You Start
Get your API key
Create an API key at agent.tinyfish.ai/api-keys.
X-API-Key header. See Authentication for the full setup and troubleshooting guide.
Your First Request
What Success Looks Like
/run. If you want to start work and poll later, use /run-async.
When to Use Agent vs the Other APIs
- Use Agent when TinyFish should decide the browser actions from your goal.
- Use Browser when you want to drive Playwright or CDP yourself.
- Use Fetch when you already know the URLs and only need extracted page content.
- Use Search when you need ranked search results rather than page automation.
Writing Good Goals
A goal is the plain-English instruction you pass in thegoal field. TinyFish uses it to decide what to click, type, extract, and return.
Good goals are:
- specific about the output you want
- explicit about the page or flow to follow
- clear about response format when you need structured JSON
Read Next
Agent reference
Full request schema, run lifecycle, browser profiles, and errors
Endpoint selection
Choose between
/run, /run-async, and /run-sseRuns
Understand status, polling, and completion
Goal prompting guide
Write more reliable automation instructions
Authentication
API key setup and troubleshooting