Browsing
Browser automation: a natural-language task carried out by an LLM agent, or a custom Python script of your own.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/browsing/async | Create a task, return task_id at once |
| POST | /api/v1/browsing/sync | Create a task, wait for the result |
| GET | /api/v1/browsing/status | Status and result by task_id |
| GET | /api/v1/browsing/screenshots/{task_id}/{filename} | Download a screenshot |
See the API Reference for request and response details.
Task IDs
Browsing tasks use the prefix web: (e.g. web:550e8400-e29b-41d4-a716-446655440000).
Request body (summary)
Either task (natural language) or script (custom Python) is required.
{
"task": "Open https://example.com and summarize the page",
"filter": { "country_iso_included": ["DE"] },
"screenshots": {
"mode": "final_only",
"full_page": true
},
"fanout": 1,
"timeout_sec": 600
}| Field | Description |
|---|---|
task | Natural-language instruction |
script | Custom Python, see Custom Scripts; enabled per API key |
timeout_sec | The task’s budget in seconds, at most 1200 (20 minutes). Omitted: 10 minutes |
fanout | How many parallel runs for the task, 1–10, default 1; the first result wins |
filter.country_iso_included | The countries the task may run from (["DE", "US"]); GET /api/v1/supply/countries says which are available now |
filter.country_iso_excluded | The countries it must not run from; not together with country_iso_included. RU is always excluded |
session_key | Each task of a session runs independently of the others |
screenshots.mode | final_only, every_step or on_navigation |
screenshots.full_page | Whole page rather than the viewport |
emulate_human | Human-like input: slower |
max_steps | Cap on the agent’s steps, 1–500; reaching it fails the task with what it found so far |
ttl_days | How long the request and result are kept, 1–30, default 7 |
uv_args | Extra Python packages for a custom script |
POST /api/v1/browsing/async answers with the task’s id at once; sync with the result:
{ "task_id": "web:fa8cf4c6-2e74-4e55-aa4b-76b74971043e" }{
"task_id": "web:fa8cf4c6-2e74-4e55-aa4b-76b74971043e",
"success": true,
"payload": "{\"success\":true,\"result\":\"The page title of https://example.com is 'Example Domain'.\",\"steps\":2,\"no_result\":false,\"traffic_in\":473,\"traffic_out\":722}",
"step_cnt": 2,
"execution_time_ms": 21889,
"traffic_in": 473,
"traffic_out": 722,
"traffic_total": 1195
}A request the server will not take answers with 400 and the reason, a task that failed
with success: false and error:
{ "error": "task or script is required" }{
"task_id": "web:8b733a4f-9b21-464f-b4c4-176f0a55cdc4",
"success": false,
"error": "RuntimeError: the task did not finish within 1 steps",
"payload": "{\"success\":false,\"error_type\":\"RuntimeError\",\"error_message\":\"the task did not finish within 1 steps\",\"max_steps\":1,\"steps\":1,\"result\":\"The task could not be completed because the step limit was reached before any navigation or data collection could occur. No page titles were retrieved.\",\"traffic_in\":0,\"traffic_out\":0}",
"step_cnt": 1,
"execution_time_ms": 10250
}Status values
queued → assigned → completed | failed | cancelled
assigned covers the whole run: the task has been picked up and is working. When the task
is over, the status response also carries success, payload, error,
execution_time_ms and the traffic the task spent (traffic_in, traffic_out,
traffic_total). A failed task says why in error. See the reference.
Sizing a task
An agent task is paid for in steps and in time, and both are bounded: steps from the
account’s quota, time by timeout_sec (10 minutes when omitted, 20 at most). What a task
costs, from tasks run on the service:
| The task | Steps | Time |
|---|---|---|
| One page: open, read, answer | 3–10 | under a minute |
| One page with a form or a search on it | 10–30 | 1–3 minutes |
| Several pages, one after another | 5–10 per page | about a minute per page |
| Eight or nine pages in one task | 40–90 | 5–10 minutes |
So a task over eight or nine pages needs timeout_sec of 600 or more, and at the
default budget it fails about half the time with the task did not finish within N ms.
Three things make long tasks reliable:
- Split them. One task per page, or per two or three, started with
asyncat once and polled withstatus. Each is short, each failure is its own, and the account pays only for the tasks that succeeded. - Give them time and a cap.
timeout_sec: 900andmax_stepssized to the work, so a task that wanders is stopped with what it found rather than with nothing. - Run two in parallel.
fanout: 2on a long task: if one run is lost, the second is what makes that a delay rather than a failure.
A custom script spends no steps and is bounded by
timeout_sec alone; the same advice on splitting applies.
How long the result is kept
The request and the result are kept for 7 days by default, up to 30 with ttl_days;
screenshot files for 5 days. See the reference.