Browser API sessions are isolated and do not persist cookies or storage by themselves. For reusable login state, use Browser Context Profiles: create a setup session, connect your controller to
cdp_url, save it, then run Agent API automations with use_profile: true.Before You Start
1
Get your API key
Create a key at agent.tinyfish.ai/api-keys.
2
Store it in your environment
3
Install the required packages
X-API-Key header. See Authentication for the full setup and troubleshooting guide.
Your First Request
Session creation typically takes 10-30 seconds. Set your HTTP client timeout to at least 60 seconds.
What Success Looks Like
cdp_url:
Pass
cdp_url (the WebSocket URL) to connect_over_cdp. Do not use base_url — it is for polling session status via /pages, not for Playwright connections.When to Use Browser vs the Other APIs
- Use Browser when you want direct Playwright or CDP control.
- Use Agent when TinyFish should decide the browser actions from a goal.
- Use Fetch when you only need extracted content from one or more URLs.
- Use Search when you need ranked search results, not a browser session.
Session Lifecycle
Read Next
API Reference
Request and response schema
Authentication
API key setup
Browser Context Profiles
Persist login state for future Agent API runs
Browser Profiles
Configure browser runtime behavior for automation runs
Key Concepts
Understand when to use Agent vs Browser
For coding agents
One page that routes an agent to the right TinyFish API