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"
}API reference
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
Inspect task
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 |
|---|---|
PENDING | Waiting to run |
RUNNING | Execution has started |
SUCCESS | The task succeeded |
BLOCKED | The site blocked the task |
CAPTCHA_FAILED | A challenge could not be completed |
TIMEOUT | The execution budget expired |
LOOP | Repeated actions prevented progress |
NO_TARGET | The requested target or usable result was not found |
ERROR | Another execution failure; read error |
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.
A malformed ID returns 400. An unknown or inaccessible run returns 404.Authorizations
apiKeyAuthxApiKey
Use a pre.dev API key from https://pre.dev/projects/key.
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?

