POST /api/v1/browsing/async
Creates a browsing task and returns task_id immediately.
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
task | string | One of task / script | Natural-language instruction |
script | string | One of task / script | Custom Python snippet — requires API key permission; request access via chat in the dashboard |
filter.country_iso | string | No | Route to nodes in a country (e.g. DE, US) |
session_key | string | No | Group tasks into a shared session (max 128 chars) |
timeout | uint32 | No | Client timeout in ms (max 3 hours) |
fanout | uint32 | No | Nodes to race (1–10, default 1) |
screenshots.mode | string | If screenshots set | final_only, every_step, or on_navigation |
screenshots.full_page | bool | No | Full-page capture (default true) |
country_iso_exclude | string[] | No | Exclude countries; RU is added by default |
uv_args | string | No | Extra Python packages for custom scripts (max 1024 chars) |
Unknown JSON fields are rejected (400).
Response (200):
{ "task_id": "web:550e8400-e29b-41d4-a716-446655440000" }curl -sS -X POST "https://llm.dat.ai/api/v1/browsing/async" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "Open https://example.com and summarize the page",
"filter": { "country_iso": "DE" },
"screenshots": { "mode": "final_only", "full_page": true },
"fanout": 1,
"timeout": 600000
}'POST /api/v1/browsing/sync
Same request body as async. Blocks until the task completes or times out.
Response (200):
{
"task_id": "web:...",
"success": true,
"payload": { "...": "..." },
"execution_time_ms": 12345
}On failure, success is false and error contains a message. Timeout returns 504 with "Task timeout".
GET /api/v1/browsing/status
Poll task status and result.
Query: task_id (required)
curl -sS "https://llm.dat.ai/api/v1/browsing/status?task_id=web:YOUR_TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"Response (200):
{
"task_id": "web:...",
"status": "completed",
"created_at": "2026-01-13T12:34:56Z",
"assigned_at": "2026-01-13T12:34:57Z",
"started_at": "2026-01-13T12:35:00Z",
"completed_at": "2026-01-13T12:35:42Z",
"success": true,
"payload": { "...": "..." },
"execution_time_ms": 42000
}status | Meaning |
|---|---|
queued | Waiting for a node |
assigned | Node selected |
running | Executing |
completed | Finished (includes success, payload, optional error) |
failed | Failed |
cancelled | Cancelled |
success, payload, and error are included only when status is completed.
GET /api/v1/browsing/screenshots/task_id/filename
Download a screenshot captured during a browsing task.
curl -sS "https://llm.dat.ai/api/v1/browsing/screenshots/web%3AYOUR_TASK_ID/step-001.png" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o screenshot.pngtask_idandfilenamemust be URL-encoded in the path- Returns the image file on success (200)
- 403 if the task belongs to another account
- 404 if the task or screenshot does not exist
Screenshots are only available when screenshots was set in the create request. Files are kept for up to 3 days, then deleted automatically.