Before You Start
Create or copy a Client API key from API keys, then set local environment variables.1. Create a Session
Every request field is optional. Start with{} to use a coherent Linux fingerprint, a residential proxy with sticky rotation, a 600-second timeout, and keepAlive: false.
id: the browser session IDconnectUrl: a signed WebSocket URL for the active sessionsettings.id: an opaque ID for restoring saved identity and browser stateruntime: the effective timeout and reconnect behavior- lifecycle timestamps including
expiresAt
connectUrl as FLOPPY_CONNECT_URL in the process environment. Keep it out of source control and shell history.
2. Connect and Navigate
Cloud Browser does not acceptstartUrl. Connect first, then navigate with your automation client.
Playwright
Puppeteer
3. Stop the Session
Explicitly stop the session after the job. The operation is idempotent and synchronizes saved browser state.keepAlive: false, closing the relay also stops the session. With keepAlive: true, disconnecting releases the connection so you can reconnect until expiresAt; call stop when the job is finished.
Customize a New Browser
Send only the groups you need. This example sets viewport and fingerprint preferences, targets a US residential proxy, extends the runtime, and attaches caller-owned metadata.
For interval rotation, use
mode: "interval" with intervalMinutes set to 5, 10, 15, 20, or 60. Use mode: "perRequest" for a new proxy IP per request, or mode: "sticky" with an optional caller-defined stickyKey.
Import Cookies Before Launch
Cookie values are write-only. Import at most 100 cookies and provide exactly one ofurl or domain for each item.
merge. Use replace only when you intend to clear the saved cookies first. Never put real cookie values in documentation, logs, or support messages.
Reuse Saved Settings
Reusesettings.id to restore the same saved identity and browser state.
settings.id with browser or proxy; that prevents accidental identity mutation. You can still send cookies, runtime options, and metadata. One active session can use a settings ID at a time.
Each account can keep up to 20 saved settings. Session history includes settings.id, so you can recover an ID without a separate settings-list endpoint.
Inspect Sessions and Reconnect
Get one session to check its state and receive a freshly signedconnectUrl while it is active.
nextCursor back unchanged to load the next page. Session states are running, stopped, timedOut, and failed.
Open a Live View
Close any active Playwright or Puppeteer connection first, then request a fresh live-view URL.liveViewUrl in a browser. Treat it as a temporary secret and do not log or share it.
Delete Saved Settings
Stop any active session first, then delete the settings.204 when deletion succeeds. It returns settings_in_use instead of silently stopping an active session.
Errors and Recovery
Operational Limits
- Incoming WebSocket messages are limited to approximately 1 MiB. Very large CDP payloads, such as full-page screenshots or screencast frames, can close the relay.
- A Worker deployment can drop a live relay. With
keepAlive: true, get the session again and reconnect with the freshconnectUrlbeforeexpiresAt. - A signed connection URL admits one active relay and expires with its session.
Create a Session
Inspect every request field and response property.
List Sessions
Filter history and paginate with an opaque cursor.
API Conventions
Review authentication, errors, and WebSocket behavior.