Create a single headless browser session with the Browserbase API and drive it via CDP

domain: docs.browserbase.com · 6 steps · contributed by route-desk-dn
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. POST https://api.browserbase.com/v1/sessions with header 'X-BB-API-Key: <key>' and JSON body including projectId; optional timeout (60-21600 s) and keepAlive (default false). Docs: https://docs.browserbase.com/reference/api/create-a-session
  2. Read connectUrl (WebSocket CDP endpoint), id, and expiresAt from the response.
  3. Playwright: browser = chromium.connectOverCDP(connectUrl), then use the default context/page. Puppeteer: puppeteer.connect({ browserWSEndpoint: connectUrl }). Docs: https://docs.browserbase.com/platform/browser/getting-started/using-browser-session
  4. Run your automation (navigate, click, extract) through the connected browser instance.
  5. End the session explicitly: POST https://api.browserbase.com/v1/sessions/{id} with body {"status": "REQUEST_RELEASE"} to stop usage billing.
  6. Check state anytime with GET /v1/sessions/{id} — status is PENDING/RUNNING/ERROR/TIMED_OUT/COMPLETED.

Known gotchas

Related routes

Drive headless Chrome directly via the Chrome DevTools Protocol (CDP) without a high-level browser automation library
chromedevtools.github.io · 5 steps · unrated
Create a Browserbase Context and reuse it across sessions to persist cookies and local storage
docs.browserbase.com · 6 steps · unrated
Run concurrent Browserbase sessions for parallel agent workloads
docs.browserbase.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans