Skip to main content
The Scraping API loads pages in a Surfsky browser over plain HTTP and returns the rendered HTML. It also waits for content, takes screenshots, and solves CAPTCHAs, with no framework connection to hold open. Use it when you need HTML or a screenshot and do not want to hold a WebSocket connection. For forms, multiple tabs, or click sequences, use a framework or an SDK. To have a coding agent set this up in your project, give it the setup prompt.
For clicks, typing, and scrolling, use human-emulation commands through the SDK or CDP. The Scraping API’s human_actions option only performs random browsing actions; it does not accept a custom sequence.
Scraping more than one page? Send the URLs as a batch to one browser instead of starting a browser per page.

Prerequisites

Set your API token and base URL. The examples start a browser with an empty request body, which uses your account’s default proxy pool. Proxy, fingerprint, and other start options are in the API reference.

Run an example

The examples use a one-time profile. To reuse a saved login, pass a persistent profile UUID to the session call instead.
The SDK examples print 200 followed by HTML containing Example Domain. The curl example returns the JSON response described below.

Click, type, and scroll

For a specific input sequence, use client.browser() instead of the client.session() and profiles.scrape() workflow. Its input methods call Surfsky’s Human.* primitives. After creating a client, run this on your target form, replacing the URL and selector:
The SDK stops the browser when the block or scope exits. Use this as a separate workflow: the HTTP scraper takes over the page and closes extra tabs, so do not combine it with CDP actions in the same browser. See Human emulation for the underlying commands.

Request parameters

POST /profiles/{internal_uuid}/scrape accepts: wait_for with a selector for the content you need is more reliable than networkidle, which can time out on pages with background traffic. The gateway gives each /scrape call 120 seconds in total, covering every page in a batch. timeout and wait apply inside that budget.

Read the response

success reports whether the Surfsky request succeeded. data.status is the target site’s HTTP status, so a 200 from Surfsky can carry a 403 or a challenge page from the site. Check the target status and content. screenshot is present only when requested; decode it with Base64 to get a PNG.

Scrape several pages

Whenever your job allows it, send several URLs to one browser instead of starting a browser per page. Each start costs time and a browser slot, and the pages in a batch share the same cookies. Send them as an array of request objects to the same endpoint:
Pages run one after another in request order, and data comes back as an array in that order; failed items carry error and status_code instead of a page. Keep a batch within the 120-second limit, and use several browsers when you need pages fetched in parallel.

Stop the session

The SDK stops the session when its scope exits, including on errors. For direct HTTP requests, stop the browser with the internal_uuid from the start response:
Otherwise the browser stops after the inactivity timeout. Do not mix the Scraping API with CDP automation in the same browser; the scraper takes over the page and closes extra tabs.