Prerequisites
Set your API token and base URL, then install the package for your language below. Puppeteer provides a JavaScript/TypeScript API. The Java and .NET examples use the community ports Jvppeteer and Puppeteer Sharp. For Python, use async Playwright: the Python port Pyppeteer is unmaintained. The examples use 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.- JavaScript
- Java (Jvppeteer)
- .NET (Puppeteer Sharp)
Requires Node.js 24 or newer, or Bun, for Save as Run it:
await using. Puppeteer’s JavaScript API is asynchronous; the same calls work in TypeScript.surfsky-puppeteer.mjs:defaultViewport: null keeps the window size from the profile’s fingerprint. Without it Puppeteer forces its own 800x600 viewport.
Click, type, and scroll
Prefer human emulation over Puppeteer’s own click, type, and scroll.Human.* commands move the cursor and type with human timing, and they run through a page-level CDP session. Replace the selector with an input on your page:
Stop the session
In the JavaScript example,browser.disconnect() only drops the Puppeteer connection; the SDK stops the browser when the session scope exits, including on errors.
The Java and .NET examples close the remote browser in finally. If you start a session through the API and the framework cannot connect, stop it using the internal_uuid from the start response: