Skip to Content

Browsing

Browser automation: a natural-language task carried out by an LLM agent, or a custom Python script of your own.

Endpoints

MethodPathDescription
POST/api/v1/browsing/asyncCreate a task, return task_id at once
POST/api/v1/browsing/syncCreate a task, wait for the result
GET/api/v1/browsing/statusStatus 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 }
FieldDescription
taskNatural-language instruction
scriptCustom Python, see Custom Scripts; enabled per API key
timeout_secThe task’s budget in seconds, at most 1200 (20 minutes). Omitted: 10 minutes
fanoutHow many parallel runs for the task, 1–10, default 1; the first result wins
filter.country_iso_includedThe countries the task may run from (["DE", "US"]); GET /api/v1/supply/countries says which are available now
filter.country_iso_excludedThe countries it must not run from; not together with country_iso_included. RU is always excluded
session_keyEach task of a session runs independently of the others
screenshots.modefinal_only, every_step or on_navigation
screenshots.full_pageWhole page rather than the viewport
emulate_humanHuman-like input: slower
max_stepsCap on the agent’s steps, 1–500; reaching it fails the task with what it found so far
ttl_daysHow long the request and result are kept, 1–30, default 7
uv_argsExtra 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 taskStepsTime
One page: open, read, answer3–10under a minute
One page with a form or a search on it10–301–3 minutes
Several pages, one after another5–10 per pageabout a minute per page
Eight or nine pages in one task40–905–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 async at once and polled with status. 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: 900 and max_steps sized to the work, so a task that wanders is stopped with what it found rather than with nothing.
  • Run two in parallel. fanout: 2 on 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.