Page Actions
curl --request POST \
--url https://api.example.com/v1/sessions/{id}/navigate \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"wait_until": "<string>",
"timeout": 123,
"script": "<string>",
"selector": "<string>",
"text": "<string>",
"kind": "<string>",
"max_length": 123,
"timeout_ms": 123,
"direction": "<string>",
"amount": 123
}
'import requests
url = "https://api.example.com/v1/sessions/{id}/navigate"
payload = {
"url": "<string>",
"wait_until": "<string>",
"timeout": 123,
"script": "<string>",
"selector": "<string>",
"text": "<string>",
"kind": "<string>",
"max_length": 123,
"timeout_ms": 123,
"direction": "<string>",
"amount": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
wait_until: '<string>',
timeout: 123,
script: '<string>',
selector: '<string>',
text: '<string>',
kind: '<string>',
max_length: 123,
timeout_ms: 123,
direction: '<string>',
amount: 123
})
};
fetch('https://api.example.com/v1/sessions/{id}/navigate', 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.example.com/v1/sessions/{id}/navigate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'wait_until' => '<string>',
'timeout' => 123,
'script' => '<string>',
'selector' => '<string>',
'text' => '<string>',
'kind' => '<string>',
'max_length' => 123,
'timeout_ms' => 123,
'direction' => '<string>',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions/{id}/navigate"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions/{id}/navigate")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions/{id}/navigate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
Page Actions
Drive the browser — navigate, click, type, extract, wait, scroll
POST
/
v1
/
sessions
/
{id}
/
navigate
Page Actions
curl --request POST \
--url https://api.example.com/v1/sessions/{id}/navigate \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"wait_until": "<string>",
"timeout": 123,
"script": "<string>",
"selector": "<string>",
"text": "<string>",
"kind": "<string>",
"max_length": 123,
"timeout_ms": 123,
"direction": "<string>",
"amount": 123
}
'import requests
url = "https://api.example.com/v1/sessions/{id}/navigate"
payload = {
"url": "<string>",
"wait_until": "<string>",
"timeout": 123,
"script": "<string>",
"selector": "<string>",
"text": "<string>",
"kind": "<string>",
"max_length": 123,
"timeout_ms": 123,
"direction": "<string>",
"amount": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
wait_until: '<string>',
timeout: 123,
script: '<string>',
selector: '<string>',
text: '<string>',
kind: '<string>',
max_length: 123,
timeout_ms: 123,
direction: '<string>',
amount: 123
})
};
fetch('https://api.example.com/v1/sessions/{id}/navigate', 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.example.com/v1/sessions/{id}/navigate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'wait_until' => '<string>',
'timeout' => 123,
'script' => '<string>',
'selector' => '<string>',
'text' => '<string>',
'kind' => '<string>',
'max_length' => 123,
'timeout_ms' => 123,
'direction' => '<string>',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions/{id}/navigate"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions/{id}/navigate")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions/{id}/navigate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"wait_until\": \"<string>\",\n \"timeout\": 123,\n \"script\": \"<string>\",\n \"selector\": \"<string>\",\n \"text\": \"<string>\",\n \"kind\": \"<string>\",\n \"max_length\": 123,\n \"timeout_ms\": 123,\n \"direction\": \"<string>\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_bodyPage Actions
Every running session exposes action endpoints that execute real CDP commands inside the browser. All actions require session authentication and return the standard{ "data": ... } envelope.
Navigate
POST /v1/sessions/{id}/navigate
string
required
Absolute URL to navigate to.
string
default:"load"
Lifecycle event to wait for:
load, domcontentloaded, or none. (wait is accepted as an alias.)number
default:"30"
Navigation timeout in seconds.
Response
{ "data": { "status": "complete", "url": "https://example.com/", "title": "Example" } }
Execute Script
POST /v1/sessions/{id}/execute
string
required
JavaScript evaluated in the page context. Promises are awaited; the resolved value is returned.
Response
{ "data": { "result": "Example Domain" } }
Click
POST /v1/sessions/{id}/click
string
required
CSS selector of the element to click.
Type
POST /v1/sessions/{id}/type
string
required
CSS selector of the input element.
string
required
Text to type. The element’s value is replaced and
input/change events are dispatched.Extract
POST /v1/sessions/{id}/extract
string
default:"body"
CSS selector of elements to extract.
string
default:"text"
text (innerText) or html (outerHTML).number
Truncate the combined content to this many characters.
Response
{ "data": { "selector": "h1", "content": ["Example Domain"] } }
Wait For Selector
POST /v1/sessions/{id}/wait
string
required
CSS selector to wait for.
number
default:"30000"
Maximum wait in milliseconds. Returns
504 on timeout.Scroll
POST /v1/sessions/{id}/scroll
string
default:"down"
up, down, top, or bottom.number
default:"500"
Pixels to scroll for
up/down.Errors
| Status | Meaning |
|---|---|
400 | Missing/invalid parameters (e.g. no selector). |
404 | Session not found or already destroyed. |
502 | The browser rejected the command (element missing, script exception). |
504 | wait timed out before the selector appeared. |