Skip to main content
Open Google in a cloud browser using a Surfsky SDK or your existing automation framework.

Before you start

Get your API token and API base URL from the Surfsky dashboard. Replace YOUR_API_TOKEN and https://YOUR_API_HOST below with your account’s values.
Keep the token in your server environment, outside source control. These examples omit proxy to use the default pool available to your account. If your account has no pool, provide your own proxy as described in Proxies.

SDK quickstart

Requires Python 3.12 or newer.
Save as first_browser.py:
Both examples stop the session on completion or error. If cleanup fails, the browser stops after its inactivity timeout.

Connect your existing code

Follow the guide for your framework:

Using the API directly

1. Start a browser

Response:

2. Connect

Pass the returned ws_url to your framework’s CDP connection method. Use the existing browser context to work with the profile’s state. The default inactivity timeout is 30 seconds. To allow more time, set inactive_kill_timeout in the start request. For example, "browser_settings": {"inactive_kill_timeout": 300} allows 300 seconds of inactivity. To interact with the browser through HTTP requests, use the Scraping API with the returned internal_uuid.

3. Stop it

A running browser occupies 1 browser slot until it stops.
You can stop the browser in 3 ways:
  • Call a method that closes the remote browser, such as Puppeteer’s browser.close().
  • Leave it idle until inactive_kill_timeout expires.
  • Send the stop request below.
Replace INTERNAL_UUID with the value from your start response:
Playwright’s browser.close() over CDP only disconnects. Use the stop request or close it through CDP to end the session immediately.

If the example fails

See Errors for other API failures. Continue with Sessions to reuse browser state, or the Python and TypeScript SDK guides for browser actions and pooling.