Browserless API Guide: REST Endpoints, CDP WebSockets, and When to Use It

Browserless API gives you two connection models: REST endpoints for screenshot/PDF/scrape, and CDP WebSockets for Playwright or Puppeteer. Setup, tradeoffs, and when to self-host.

March 14, 2026 · 3 min read

Browserless API sits in the boring but valuable layer of the stack: managed browsers, stable browser endpoints, and task-shaped HTTP routes. If you already have Playwright or Puppeteer code, you can point it at Browserless over CDP. If you just need output like a screenshot or PDF, you can skip session code entirely and hit a REST route.

CDP
Primary connection model
REST
Task-shaped endpoints
PW + PPTR
Library compatibility
Cloud + Docker
Deployment paths

What Browserless API Actually Is

Browserless has three layers that people often blur together: its managed Browsers as a Service offering, its REST API, and its newer BrowserQL surface. For the `browserless api` query, the real answer is simpler: Browserless exposes remote browsers through WebSockets and exposes browser jobs through HTTP.

The official quick start recommends CDP WebSockets for both Playwright and Puppeteer. The API reference then layers on task endpoints for screenshots, PDFs, content extraction, scraping, sessions, and browser management.

Where Browserless fits

Browserless is closer to infrastructure than framework. It does not replace Playwright MCP or an agent harness. It gives those tools a browser surface that is already scaled, queued, monitored, and externally reachable.

REST vs WebSocket

This is the key architecture choice. Browserless supports both because they solve different operational problems.

FactorREST endpointsCDP WebSocket
Best forScreenshots, PDFs, scrape jobs, single-purpose server tasksMulti-step flows, full browser control, existing Playwright/Puppeteer code
Programming modelOne HTTP request per taskPersistent browser session
ComplexityLowerHigher
Control surfaceOpinionated endpoint payloadsFull automation library API
Operational overheadMinimal in app codeMore lifecycle handling in app code
Migration pathUseful for greenfield capture jobsBest for teams already standardized on Playwright or Puppeteer

If your product needs a browser as a function, REST is attractive. If your product needs a browser as a long-lived remote runtime, WebSockets are the better fit.

Quick Start

Browserless publishes a cloud WebSocket endpoint pattern on its quick-start page. The cloud path is operationally the fastest because you do not have to manage Chrome versions, patches, or worker pools.

Connect Puppeteer to Browserless cloud

import puppeteer from 'puppeteer-core';

const TOKEN = 'YOUR_API_TOKEN';

const browser = await puppeteer.connect({
  browserWSEndpoint: `wss://production-sfo.browserless.io?token=${TOKEN}`,
});

const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
await browser.close();

Typical REST call shape

curl -X POST https://production-sfo.browserless.io/chrome/screenshot?token=YOUR_API_TOKEN \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com",
    "options": {
      "fullPage": true
    }
  }'

The exact route and payload vary by endpoint family, but that shape is the point: REST mode hides browser orchestration; WebSocket mode exposes it.

Endpoint Families

The current Browserless API reference is broad enough that you should think in endpoint families rather than individual routes.

Capture endpoints

Screenshot, PDF, performance, and content endpoints for rendering output without writing your own browser lifecycle code.

Scrape endpoints

Scrape- and content-oriented routes for HTML retrieval or extraction-style jobs where you want data, not a long-running session.

Session and browser management

Session creation, cleanup, reconnects, and browser lifecycle control for teams running automation at higher concurrency.

Playwright and CDP WebSockets

Dedicated WebSocket paths for Chromium CDP plus Playwright browser variants such as chromium/playwright and firefox/playwright.

Soft boundary to keep in mind

Browserless also markets BrowserQL and anti-bot workflows. Those are real parts of the product, but they are not necessary to understand the `browserless api` use case. For this keyword, the cleanest page is still REST plus WebSockets.

Browserless vs Plain Playwright

The question is not whether Browserless replaces Playwright. It does not. The question is whether you want to run Playwright against your own browser fleet or against Browserless infrastructure.

ConcernPlain Playwright on your infraPlaywright via Browserless
Browser patching and versioningYou own itManaged by Browserless cloud or image upgrades
Queueing and concurrency controlsYou build itBuilt in and configurable
Cross-region capacityYour ops problemAvailable in managed service
Debugging live sessionsCustom tooling or vendor add-onsBuilt-in debugger/session surfaces are part of Browserless positioning
Code portabilityNative Playwright APIStill native Playwright API
Best fitTeams with strong browser infra alreadyTeams that want browser execution without browser ops

If you want a higher-level, agent-driven browser stack, compare Browserless with tools like Browser Use. If you just want to stop managing headless Chrome fleets, Browserless is the more direct answer.

Cloud vs Self-Hosted

Browserless supports both hosted and Docker-based deployment. Hosted is the fastest path to value. Self-hosted is the answer when compliance, traffic shape, or data locality force the browser runtime back into your environment.

DimensionBrowserless cloud APIBrowserless Docker
Time to first taskMinutesLonger
Infrastructure ownershipLowHigh
Best use caseStartups, prototypes, bursty workloadsRegulated environments, stable internal workloads, data sovereignty
Scaling and queueingManagedConfigured by you
Operational burdenLowerHigher
Recommended next readBrowserless Docker guideYou are here next if you need self-hosting

FAQ

Is Browserless API only for scraping?

No. Scraping is one major use case, but Browserless also targets screenshots, PDFs, testing, automation, and persistent browser sessions. The product surface is broader than scraping.

Can Browserless API return screenshots without Playwright code?

Yes. That is the main reason to use the REST side. You can call a screenshot route directly instead of managing a session yourself.

When is Browserless overkill?

If you have a small internal script, low concurrency, and no operational pain, plain Playwright or Puppeteer on a single VM may be enough. Browserless becomes more compelling when browser lifecycle, scaling, and reliability start consuming team time.

Ship browser automation changes without fragile patches

Browser automation code tends to sprawl across helpers, selectors, retries, and session code. Morph merges model-generated updates back into those files directly, without diff-format roulette.