List Sessions
curl --request GET \
--url https://api.example.com/browser/sessionsimport requests
url = "https://api.example.com/browser/sessions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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.example.com/browser/sessions"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/browser/sessions")
.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::Get.new(url)
response = http.request(request)
puts response.read_body{
"sessions": [
{}
]
}Sessions
List Sessions
List active browser sessions owned by the caller.
GET
/
browser
/
sessions
List Sessions
curl --request GET \
--url https://api.example.com/browser/sessionsimport requests
url = "https://api.example.com/browser/sessions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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.example.com/browser/sessions"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/browser/sessions")
.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::Get.new(url)
response = http.request(request)
puts response.read_body{
"sessions": [
{}
]
}Overview
Returns all currently-active browser sessions owned by the authenticated user. Expired or destroyed sessions are not returned.Example Request
curl -X GET "https://api.scrapengine.io/api/v1/browser/sessions" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY"
Response
Success Response (200)
object[]
Array of session objects. Each has the same shape as the response of
POST /browser/sessions: id, status, cdpUrl, liveViewUrl, capabilities, extensions, proxy, createdAt, expiresAt.{
"sessions": [
{
"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": [],
"createdAt": 1714000000000,
"expiresAt": 1714001800000
}
]
}
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized — invalid or missing API key. |
Was this page helpful?
⌘I