# Cloud browser API - CDP over WebSocket | Spider

Cloud browser API on a Rust engine. Connect Playwright or Puppeteer over CDP, hold up to 1,000 open sessions and send any through residential proxies.

Canonical: https://spider.cloud/docs/api/browser/

wss\://browser.spider.cloud/v1/browser · CDP

## Cloud browser API reference

The cloud browser runs on a custom engine built from the ground up. Connect over WebSocket with Playwright's `connectOverCDP()`, Puppeteer's `connect()`, or the [spider-browser ](https://www.npmjs.com/package/spider-browser)TypeScript library which adds AI extraction and natural language actions on top.

## Connection

browser.spider.cloud CDP

wss\://browser.spider.cloud/v1/browser

?token=YOUR-API-KEY

Tier

Country

Params rewrite the socket URL. Everything else is handled for you.

```
import { SpiderBrowser } from "spider-browser"

const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY! })
await browser.init() // sessions, retries and geo-routing handled for you
```

## What you get

- Native engine

  A real browser engine written for automation, so pages render the way they do for a person.

- AI native

  Extraction and actions via natural language.

- Open protocols

  CDP over WebSocket. Any client that speaks it works.

- Concurrency 1,000 open sessions

  Per account, opened at up to 100 a minute.

- Residential proxies 199+ countries

  Geo-route any session with the country param.

- Session recording

  Screencast and interaction capture, replay from the dashboard.

## Session parameters

`token` string query required

Your API key, starting with sk-. A signed-in dashboard session token also works.

`s` integer 1-3 query default: automatic

Proxy quality level. 1 is standard, 2 is residential, 3 is mobile. Higher levels are harder to block. Omit it and Spider raises the level itself after a failure.

`country` string query optional

Two-letter country code for proxy geo-routing.

Tip

Append these as query params to the WebSocket URL. Spider handles everything else, including TLS, headers and proxy rotation.

## Examples

```
import { SpiderBrowser } from "spider-browser"

const browser = new SpiderBrowser({
  apiKey: process.env.SPIDER_API_KEY!,
})
await browser.init()
await browser.page.goto("https://example.com")

// extract structured data with AI
const prices = await browser.extract("Get all product prices")

// perform actions with natural language
await browser.act("Add the cheapest item to the cart")

// take a screenshot
const screenshot = await browser.page.screenshot()

await browser.close()
```

[spider-browser on npm ](https://www.npmjs.com/package/spider-browser)· [GitHub ](https://github.com/spider-rs/spider-browser)· [Benchmarks ](https://github.com/spider-rs/benchmark)· [Session recordings](/playground/)
