Skip to main content
The quickest way to try Surfsky is to open a single page in a cloud browser. Do it with a Surfsky SDK, with your existing automation framework, or through the API directly.

Before you start

In the Surfsky dashboard:
  1. Copy your API token.
  2. Pick the region closest to the machine that runs your code and copy the API base URL shown for it.
Replace YOUR_API_TOKEN and https://YOUR_API_HOST below with those values.

SDK quickstart

The SDK is the recommended way to work with Surfsky. It controls the browser directly, without the extra scripts and bindings that Playwright, Puppeteer, and ChromeDriver inject into the page, and it does almost everything you need from an automation library.
Requires Python 3.12 or newer.
Save as first_browser.py:
Run it:
Both examples use a one-time profile, so the session is destroyed when the script finishes, together with its cookies and anything else the browser stored. If you want to keep a login and reuse it on the next run, use a persistent profile instead, as in the Python and TypeScript examples.

Connect your existing code

Follow the guide for your framework:

Using the API directly

1. Start a browser

Start a browser on a one-time profile. It lives for a single session, and its state is discarded when the browser stops:
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.