Skip to main content

API Reference

Execute Task

Send browser automation actions to a worker.

POST https://api.browserworker.app/v1/
POST https://api.browserworker.app/v1/execute

Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_BEARER_TOKEN
Content-TypeYesapplication/json or multipart/form-data

Request Body (JSON)

{
"actions": [
{ "openNewTab": "https://example.com" },
{ "click": ".submit-btn" },
{ "screenshot": "viewport" }
],
"workerId": "-Om8E6V_dV3w8mb27ikb",
"timeout": 30000,
"config": {
"actionTimeout": 5000,
"continueOnError": true
},
"session": {
"preserve": true
}
}

Parameters

FieldTypeRequiredDefaultDescription
actionsarrayYesArray of action objects to execute sequentially
workerIdstringNoauto-selectTarget a specific worker by ID
timeoutnumberNo30000Task timeout in ms (clamped to plan max)
config.actionTimeoutnumberNo10000Default per-action timeout in ms
config.continueOnErrorbooleanNotrueContinue executing if an action fails
sessionobjectNoSession management options (see Sessions)
filesarrayNoFiles to upload (see File Upload)

Request Body (Multipart Form-Data)

For binary file uploads, use multipart/form-data:

Content-Type: multipart/form-data

payload: {"actions": [...], "workerId": "..."} (JSON string)
files: (binary file attachments)

Success Response (200)

{
"success": true,
"taskId": "task_eb09bd2804b99ecb_1771839792",
"workerId": "-Om8GAObZSvE8trPMPZF",
"workerName": "My PC",
"data": {
"success": true,
"url": "https://files.browserworker.app/screenshots/..."
},
"duration": 6388
}
FieldDescription
successtrue if the task completed without errors
taskIdUnique task identifier
workerIdThe worker that executed the task
workerNameHuman-readable worker name
dataResult from the last action (or accumulated results)
durationTotal execution time in milliseconds
sessionIdSession ID (only if session.preserve was set)

Error Responses

CodeDescription
400Invalid actions format or missing required fields
401Invalid or missing bearer token
403Worker doesn't belong to you, or feature not available on your plan
404No available workers found
408Task timed out waiting for worker response
409Worker is busy, offline, or session mismatch
429Daily task limit reached (Free plan: 50/day)

Error Response Body

{
"error": "Task timed out",
"taskId": "task_...",
"workerId": "-Om8GAObZSvE8trPMPZF",
"timeout": 30000
}

Action Format

Each action is an object with a single key (the action name) and a value:

// String value
{ "click": "#submit-btn" }

// Array value
{ "fill": ["input[name=email]", "user@example.com"] }

// With options
{ "click": "#submit-btn", "options": { "delay": 500, "iframe": "#content" } }

// Nested structure (control flow)
{ "loop": { "each": ".item", "do": [{ "click": "$this" }] } }

Selectors

BrowserWorker supports both CSS selectors and XPath expressions. XPath is auto-detected when the selector starts with / or //.

{ "click": ".my-button" }
{ "click": "//button[contains(text(), 'Submit')]" }

Options

Most actions accept an options object for additional configuration:

{
"click": "#submit",
"options": {
"timeout": 5000,
"iframe": "#content-frame",
"continueOnError": true,
"showClick": true
}
}

See each action's documentation for supported options.

Health Check

GET https://api.browserworker.app/health

Returns 200 OK — no authentication required.