Create Session
curl --request POST \
--url https://api.example.com/browser/sessions \
--header 'Content-Type: application/json' \
--data '
{
"capabilities": [
"<string>"
],
"extensions": [
"<string>"
],
"proxyUrl": "<string>",
"proxy": {
"location": "<string>",
"provider": "<string>",
"sticky": true
},
"timeout": 123
}
'import requests
url = "https://api.example.com/browser/sessions"
payload = {
"capabilities": ["<string>"],
"extensions": ["<string>"],
"proxyUrl": "<string>",
"proxy": {
"location": "<string>",
"provider": "<string>",
"sticky": True
},
"timeout": 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({
capabilities: ['<string>'],
extensions: ['<string>'],
proxyUrl: '<string>',
proxy: {location: '<string>', provider: '<string>', sticky: true},
timeout: 123
})
};
fetch('https://api.example.com/browser/sessions', 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/browser/sessions",
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([
'capabilities' => [
'<string>'
],
'extensions' => [
'<string>'
],
'proxyUrl' => '<string>',
'proxy' => [
'location' => '<string>',
'provider' => '<string>',
'sticky' => true
],
'timeout' => 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/browser/sessions"
payload := strings.NewReader("{\n \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 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/browser/sessions")
.header("Content-Type", "application/json")
.body("{\n \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions")
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 \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"cdpUrl": "<string>",
"liveViewUrl": "<string>",
"capabilities": [
"<string>"
],
"extensions": [
"<string>"
],
"proxyUrl": "<string>",
"proxy": {},
"createdAt": 123,
"expiresAt": 123
}Sessions
Create Session
Create a persistent, remote-controlled browser session with optional stealth, extensions, and proxy settings.
POST
/
browser
/
sessions
Create Session
curl --request POST \
--url https://api.example.com/browser/sessions \
--header 'Content-Type: application/json' \
--data '
{
"capabilities": [
"<string>"
],
"extensions": [
"<string>"
],
"proxyUrl": "<string>",
"proxy": {
"location": "<string>",
"provider": "<string>",
"sticky": true
},
"timeout": 123
}
'import requests
url = "https://api.example.com/browser/sessions"
payload = {
"capabilities": ["<string>"],
"extensions": ["<string>"],
"proxyUrl": "<string>",
"proxy": {
"location": "<string>",
"provider": "<string>",
"sticky": True
},
"timeout": 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({
capabilities: ['<string>'],
extensions: ['<string>'],
proxyUrl: '<string>',
proxy: {location: '<string>', provider: '<string>', sticky: true},
timeout: 123
})
};
fetch('https://api.example.com/browser/sessions', 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/browser/sessions",
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([
'capabilities' => [
'<string>'
],
'extensions' => [
'<string>'
],
'proxyUrl' => '<string>',
'proxy' => [
'location' => '<string>',
'provider' => '<string>',
'sticky' => true
],
'timeout' => 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/browser/sessions"
payload := strings.NewReader("{\n \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 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/browser/sessions")
.header("Content-Type", "application/json")
.body("{\n \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions")
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 \"capabilities\": [\n \"<string>\"\n ],\n \"extensions\": [\n \"<string>\"\n ],\n \"proxyUrl\": \"<string>\",\n \"proxy\": {\n \"location\": \"<string>\",\n \"provider\": \"<string>\",\n \"sticky\": true\n },\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"cdpUrl": "<string>",
"liveViewUrl": "<string>",
"capabilities": [
"<string>"
],
"extensions": [
"<string>"
],
"proxyUrl": "<string>",
"proxy": {},
"createdAt": 123,
"expiresAt": 123
}Overview
Creates a new browser session backed by a sandboxed VM. The session stays alive until it hitstimeout of inactivity, you destroy it explicitly, or it expires at expiresAt.
Returns a cdpUrl you can attach to with any Chrome DevTools Protocol client (Playwright, Puppeteer, chromedp), plus a liveViewUrl for an interactive noVNC view.
Body
string[]
Runtime capabilities to enable on the session. Supported values include
stealth (anti-bot evasion) and recording (server-side MP4 capture).string[]
Extension IDs to load into the browser. Upload extensions first via
POST /browser/extensions.string
Raw proxy URL (e.g.
http://user:pass@host:port). Mutually exclusive with proxy.object
integer
default:"900000"
Idle timeout in ms before the session auto-terminates. Default 15 minutes.
Example Request
curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"capabilities": ["stealth"],
"proxy": { "location": "us", "provider": "oxylabs", "sticky": true },
"timeout": 1800000
}'
Response
Success Response (201)
string
Session ID (UUID). Use this as
{id} in all other browser session endpoints.string
Current state — typically
ready when the session is immediately usable.string
Chrome DevTools Protocol WebSocket URL. Attach any CDP client here.
string
Shareable noVNC URL for interactive live view.
string[]
Capabilities enabled on this session.
string[]
Extension IDs loaded into the browser.
string
Raw proxy URL, when the session was created with
proxyUrl.object
Managed proxy info —
enabled, provider, location, sticky.integer
Unix epoch milliseconds when the session was created.
integer
Unix epoch milliseconds when the session will auto-expire absent activity.
{
"id": "baa3f390-fa6e-4a24-b84a-a575a5f3a9c7",
"status": "ready",
"cdpUrl": "wss://cdp.scrapengine.io/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7",
"liveViewUrl": "https://live.scrapengine.io/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7",
"capabilities": ["stealth"],
"extensions": [],
"proxy": { "enabled": true, "provider": "oxylabs", "location": "us", "sticky": true },
"createdAt": 1714000000000,
"expiresAt": 1714001800000
}
Error Responses
| Status | Description |
|---|---|
400 | Invalid body — e.g. more than 20 extensions requested, or a validation error on a field. |
401 | Unauthorized — invalid or missing API key. |
503 | Maximum concurrent sessions reached for this account, the browser pool cannot allocate a sandbox, or VM initialization failed. |
Was this page helpful?