Control a complete workflow
Navigate between pages, fill forms and wait for the elements your script needs before reading content. Keep related actions in the same browser session.
Playwright Cloud Browser
Keep browser logic in your Node.js application. Connect over CDP to navigate pages, fill forms and collect results in a temporary remote session.
01 / OVERVIEW
AdsCrawl provides temporary remote browser sessions for Playwright through the Chrome DevTools Protocol (CDP). Create a session with POST /cdp/sessions, then pass the returned webSocketDebuggerUrl to chromium.connectOverCDP. Explicitly release the session when the workflow finishes.
02 / USE CASES
Navigate between pages, fill forms and wait for the elements your script needs before reading content. Keep related actions in the same browser session.
Run the Playwright client from your Node.js service while AdsCrawl runs the remote browser. Your service does not launch a local Chromium process for this connection.
Use a finally block to call DELETE /cdp/sessions/:sessionId. Treat cleanup as part of your task so failed page actions do not leave the session running.
03 / QUICKSTART
Requires Node.js and Playwright (npm install playwright). Set the ADSCRAWL_API_KEY environment variable on your server first.
Full request and response reference →import { chromium } from "playwright";
const base = "https://api.adscrawl.net";
const headers = {
"x-api-key": process.env.ADSCRAWL_API_KEY,
"content-type": "application/json",
};
const res = await fetch(base + "/cdp/sessions", {
method: "POST", headers,
body: JSON.stringify({ idleTimeoutMs: 600000 }),
});
if (!res.ok) throw new Error(await res.text());
const session = await res.json();
try {
const browser = await chromium.connectOverCDP(
session.cdpBaseUrl
);
const page = await browser.contexts()[0].newPage();
await page.goto("https://www.adscrawl.net");
console.log(await page.title());
} finally {
const stopped = await fetch(
base + "/cdp/sessions/" + session.sessionId,
{ method: "DELETE", headers }
);
if (!stopped.ok) throw new Error(await stopped.text());
}Keep API keys on the server. For HTTP 402 check your balance; for 429 reduce concurrency and retry with backoff.
05 / FAQ
No. This example connects over CDP with chromium.connectOverCDP. Use the documented CDP session interface rather than assuming a Playwright browser-server endpoint.
No. The session is temporary. Reusable Cloud Browser profiles are managed through a separate API.
The client connects to the remote browser. It does not launch a local browser; install the Playwright client package required by your application.