Skip to main content
GET
/
v1
/
browser
/
session
Get Browser Session
curl --request GET \
  --url https://api.driver.dev/v1/browser/session \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.driver.dev/v1/browser/session"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.driver.dev/v1/browser/session', 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.driver.dev/v1/browser/session",
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.driver.dev/v1/browser/session"

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.driver.dev/v1/browser/session")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.driver.dev/v1/browser/session")

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
{
  "sessionId": "<string>",
  "servedBy": "<string>",
  "createdAt": "<string>",
  "stoppedAt": "<string>",
  "cdpUrl": "<string>",
  "note": "<string>",
  "bandwidthBytes": 1
}
{
"error": "<string>"
}
{
"error": "Session not found"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Your Driver API key. Get one at https://app.driver.dev

Query Parameters

sessionId
string
required

The ID of the browser session to retrieve.

Example:

"example-session-id"

Response

Successfully retrieved browser session.

sessionId
string
required

The ID of the created browser session.

status
enum<string>
required

The status of the session.

Available options:
starting,
active,
completed,
error
servedBy
string
required

The node ID that is serving this session.

createdAt
string
required

The ISO 8601 timestamp when the session was created.

stoppedAt
string | null
required

The ISO 8601 timestamp when the session was stopped, or null if it is still active.

cdpUrl
string<uri> | null
required

The URL to access the Chrome DevTools Protocol for this session, or null if not available.

note
string | null
required

An optional note attached to the session, or null if not set.

bandwidthBytes
integer

The total bandwidth used by the session in bytes.

Required range: x >= 0