curl -sS "https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
// Step 1: fetch the discovery document
const discovery = await fetch(
"https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
).then((response) => response.json());
// Step 2: open a WebSocket using the pre-built URL
const socket = new WebSocket(discovery.webSocketDebuggerUrl);
socket.addEventListener("open", () => {
console.log("CDP WebSocket connected");
});
{
"Browser": "Chrome/136.0.0.0",
"Protocol-Version": "1.3",
"User-Agent": "Mozilla/5.0 ...",
"V8-Version": "13.6.233.8",
"WebKit-Version": "537.36 (@revision)",
"webSocketDebuggerUrl": "wss://api.adscrawl.net/cdp/sessions/SESSION_ID/devtools/browser/BROWSER_ID?token=<data-token>"
}
Remote CDP
Discover CDP Endpoint
Retrieve the Chrome DevTools Protocol discovery JSON for a session, including the pre-rewritten WebSocket debugger URL.
GET
/
cdp
/
sessions
/
{sessionId}
/
json
/
version
curl -sS "https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
// Step 1: fetch the discovery document
const discovery = await fetch(
"https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
).then((response) => response.json());
// Step 2: open a WebSocket using the pre-built URL
const socket = new WebSocket(discovery.webSocketDebuggerUrl);
socket.addEventListener("open", () => {
console.log("CDP WebSocket connected");
});
{
"Browser": "Chrome/136.0.0.0",
"Protocol-Version": "1.3",
"User-Agent": "Mozilla/5.0 ...",
"V8-Version": "13.6.233.8",
"WebKit-Version": "537.36 (@revision)",
"webSocketDebuggerUrl": "wss://api.adscrawl.net/cdp/sessions/SESSION_ID/devtools/browser/BROWSER_ID?token=<data-token>"
}
Retrieve the Chrome DevTools Protocol discovery JSON for a session. The response includes a
webSocketDebuggerUrl pre-rewritten to the public, session-scoped CDP WebSocket path. Use it directly rather than constructing the URL manually.
string
required
Session ID returned by
POST /cdp/sessions or GET /cdp/sessions.string
required
The data token already embedded in the
cdpBaseUrl returned when the session was created. Do not substitute your x-api-key here.Response
string
Chrome version string, e.g.
Chrome/136.0.0.0.string
CDP protocol version, e.g.
1.3.string
The browser’s User-Agent string.
string
V8 engine version.
string
WebKit version.
string
Pre-rewritten WebSocket URL for the browser CDP endpoint. Pass this directly to your CDP client.
| Status | Meaning |
|---|---|
200 | Chrome discovery JSON with a rewritten webSocketDebuggerUrl. |
401 | The data token is missing or invalid. |
404 / 409 / 410 | The session is missing, stopping, or expired. |
502 | Failed to fetch upstream CDP discovery from the cloud backend. |
503 | The session backend is unavailable. |
Connect over WebSocket
Upgrade to a WebSocket connection to the browser’s CDP endpoint. CDP messages are proxied bidirectionally between your client and the Chromium instance running in the cloud. Use thewebSocketDebuggerUrl returned by the discovery endpoint rather than constructing this URL manually.
string
required
Current CDP session ID.
string
required
Browser target ID from the discovery endpoint. Prefer copying the full
webSocketDebuggerUrl directly instead of assembling this path yourself.string
required
The same data token used for discovery: embedded in
cdpBaseUrl and in the webSocketDebuggerUrl returned by the discovery endpoint.| Status | Meaning |
|---|---|
101 | WebSocket upgrade succeeded; CDP messages are now proxied bidirectionally. |
401 | The data token is missing or invalid. |
404 / 409 / 410 | The session is missing, stopping, or expired. |
502 | The cloud backend CDP connection failed before the 101 upgrade. |
503 | The session backend is unavailable. |
curl -sS "https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
// Step 1: fetch the discovery document
const discovery = await fetch(
"https://api.adscrawl.net/cdp/sessions/SESSION_ID/json/version?token=DATA_TOKEN"
).then((response) => response.json());
// Step 2: open a WebSocket using the pre-built URL
const socket = new WebSocket(discovery.webSocketDebuggerUrl);
socket.addEventListener("open", () => {
console.log("CDP WebSocket connected");
});
{
"Browser": "Chrome/136.0.0.0",
"Protocol-Version": "1.3",
"User-Agent": "Mozilla/5.0 ...",
"V8-Version": "13.6.233.8",
"WebKit-Version": "537.36 (@revision)",
"webSocketDebuggerUrl": "wss://api.adscrawl.net/cdp/sessions/SESSION_ID/devtools/browser/BROWSER_ID?token=<data-token>"
}