Skip to content

Chrome DevTools Protocol (CDP)

The /devtools endpoints provide session management capabilities that follow the Chrome DevTools Protocol (CDP). These endpoints allow you to create persistent browser sessions, manage multiple tabs, and interact with browsers using CDP commands. This is useful for advanced automation, debugging, and remote browser control.

CDP endpoints can be accessed from any environment that supports WebSocket connections, including local development machines, external servers, and CI/CD pipelines. This means you can connect to Browser Rendering from Node.js scripts, Puppeteer, Playwright, or any CDP-compatible client.

Before you begin, make sure you create a custom API Token with the Browser Rendering - Edit permission. For more information, refer to REST API — Before you begin.

What is CDP?

The Chrome DevTools Protocol (CDP) is a remote debugging protocol that allows you to instrument, inspect, debug, and profile Chromium-based browsers. It is the same protocol used by Chrome DevTools to control and monitor the browser. Popular browser automation libraries like Puppeteer and Playwright provide high-level APIs over the Chrome DevTools Protocol, making it easier to automate common tasks.

Use cases

The browser sessions endpoints enable you to:

  • Create and manage persistent browser sessions — Launch browser instances that remain active for extended periods
  • Open, close, and list browser tabs (targets) — Manage multiple debuggable targets (pages, iframes, etc.) within a single browser instance
  • Connect via WebSocket to send CDP commands — Automate browser actions programmatically
  • View live browser sessions using Chrome DevTools UI — Debug and inspect remote browser sessions visually
  • Integrate with existing CDP clients — Use standard CDP clients like Puppeteer or custom WebSocket implementations

How it works

Once you acquire a browser session, you can interact with it in two ways:

CDP over WebSocket

Connect to the WebSocket endpoint /devtools/browser to acquire a session and send CDP commands directly over the connection. This is the standard way to use CDP and works with any CDP client, including Puppeteer, Playwright, and MCP clients.

HTTP API

HTTP endpoints are also available to manage the browser lifecycle without using WebSockets. These follow the standard CDP HTTP endpoints:

  1. Create sessionPOST /devtools/browser
  2. List tabsGET /devtools/browser/{session_id}/json/list
  3. Create tabPUT /devtools/browser/{session_id}/json/new
  4. Close tabDELETE /devtools/browser/{session_id}/json/close/{target_id}
  5. Close sessionDELETE /devtools/browser/{session_id}

Check the API reference for the full list of endpoints.

Troubleshooting

If you have questions or encounter an error, see the Browser Rendering FAQ and troubleshooting guide.