Get browser task status
curl --request GET \
--url https://api.pre.dev/browser-agent/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pre.dev/browser-agent/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pre.dev/browser-agent/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pre.dev/browser-agent/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pre.dev/browser-agent/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pre.dev/browser-agent/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/browser-agent/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439011",
"total": 1,
"completed": 1,
"results": [
{
"url": "https://example.com",
"status": "RUNNING",
"queuePosition": 0,
"attempts": 1
}
],
"totalCreditsUsed": 0,
"status": "processing"
}
Browser Agents
Get run status and results
Retrieve a browser run, individual task outcomes, retry counts, and optional execution timelines.
GET
/
browser-agent
/
{id}
Get browser task status
curl --request GET \
--url https://api.pre.dev/browser-agent/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pre.dev/browser-agent/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pre.dev/browser-agent/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pre.dev/browser-agent/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pre.dev/browser-agent/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pre.dev/browser-agent/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/browser-agent/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439011",
"total": 1,
"completed": 1,
"results": [
{
"url": "https://example.com",
"status": "RUNNING",
"queuePosition": 0,
"attempts": 1
}
],
"totalCreditsUsed": 0,
"status": "processing"
}
Use the


Every browser task is charged a 0.1-credit floor when you submit it, so you need available credits to start. When the task finishes, it is charged any usage above the floor, whether it succeeded or not. Only an
Inspect task
Each status has an example body in the response examples. See errors and retries.
id returned by task submission. A run is also called a batch in the API and SDK types.
curl --fail-with-body "https://api.pre.dev/browser-agent/$BATCH_ID" \
-H "Authorization: Bearer $PREDEV_API_KEY"
Batch and task states
Batchstatus is processing, completed, or failed. Stop polling on either terminal state. A completed batch may contain unsuccessful tasks.
| Task status | Meaning | Charge |
|---|---|---|
PENDING | Waiting to run | The floor, charged at submission |
RUNNING | Execution has started | Nothing more; a retried attempt adds no charge |
SUCCESS | The task succeeded | The floor, plus any usage above it |
BLOCKED | The site blocked the task | The floor, plus any usage above it |
CAPTCHA_FAILED | A challenge could not be completed | The floor, plus any usage above it |
TIMEOUT | The execution budget expired | The floor, plus any usage above it |
LOOP | Repeated actions prevented progress | The floor, plus any usage above it |
NO_TARGET | The requested target or usable result was not found | The floor, plus any usage above it |
ERROR | Another execution failure; read error | The floor and nothing more |
EXHAUSTED | The run stopped responding before it finished, and no retry could finish it in time | The floor and nothing more |
ERROR or EXHAUSTED task keeps the floor and nothing more.
In-progress results
results is aligned to task order. An entry can be a terminal result, a PENDING/RUNNING stub, or null when task details are unavailable. Pending entries need not include data, durationMs, or creditsUsed.
The detail response counts result slots in completed, including synthesized entries. Use status, not completed === total or array length, to decide whether the run is finished.
Additional fields can include:
| Field | Meaning |
|---|---|
name / taskNames | Generated display names, when available |
results[i].attempts | Execution attempts; greater than one indicates a retry |
results[i].queuePosition | Advisory position for pending work; zero for running work, or null if unavailable |
results[i].instruction, input, output | Original task inputs when available |
totalCreditsUsed | Sum of reported task credit usage |
status before using data. Treat display names, queue position, and timestamps as optional.
Event timeline
SetincludeEvents=true when you need execution evidence:
curl --fail-with-body "https://api.pre.dev/browser-agent/$BATCH_ID?includeEvents=true" \
-H "Authorization: Bearer $PREDEV_API_KEY"
results[i].events contains available task events. liveEvents[i] can contain events for unfinished tasks; completed slots can be empty arrays. These fields can remain present after batch completion.
An event uses { type, timestamp, iteration?, data }, where timestamp is Unix time in milliseconds. Types include navigation, plan, action, screenshot, validation, done, error, and lifecycle events. Accept unfamiliar event types and inspect their payloads instead of assuming a closed list.
Screenshot payloads can contain inline image data rather than a URL. Events vary by execution path and are not guaranteed for every step. Timelines can be large, so omit them from routine status checks. The existing-run stream provides a snapshot followed by live updates.
Errors
| Status | When |
|---|---|
400 | id is not a valid run ID |
401 | Missing or invalid key |
404 | No run with this ID in your account |
Authorizations
apiKeyAuthxApiKey
Your pre.dev workspace API key (pdk_...) from Integrations, Built-in tab: https://pre.dev/projects/integrations?tab=built-in
Path Parameters
24-character record ID.
Pattern:
^[a-fA-F0-9]{24}$Query Parameters
Response
Batch with available results and optional events.
24-character record ID.
Pattern:
^[a-fA-F0-9]{24}$Ordered by task index. Slots can be null or partial until a result arrives.
Show child attributes
Show child attributes
Available options:
processing, completed, failed Counts result slots, including pending/running placeholders or nulls. Do not use this as the completion signal.
Per-task events when includeEvents=true and live events are available.
Show child attributes
Show child attributes
Was this page helpful?

