Skip to main content

surfsky

Python SDK for Surfsky, a cloud-based antidetect browser.

Install

uv add surfsky

Or pip install surfsky. Requires Python 3.12+.

Quick start

Get your API token and base URL from the dashboard:

export SURFSKY_API_TOKEN='your-token'
export SURFSKY_API_BASE_URL='your-base-url'
import asyncio

from surfsky import AsyncSurfsky, PremiumProxy


async def main():
    async with AsyncSurfsky() as client:
        async with client.browser(proxy=PremiumProxy(country="us")) as browser:
            await browser.goto("https://example.com")
            print(await browser.title())


asyncio.run(main())

The browser context stops the session on exit. Sessions are billed until stopped, including idle time. You can also pass api_token and base_url directly to the client.

Browser methods are async; timeouts are in seconds. Surfsky provides synchronous REST calls. Browser input uses Surfsky's human emulation.

Profiles and proxies

A profile preserves its fingerprint, proxy and cookies across sessions. Inside the client context:

from surfsky import Fingerprint

profile = await client.profiles.create(
    title="account-1",
    fingerprint=Fingerprint(os="win", os_arch="x86", os_version="11"),
    proxy=PremiumProxy(country="us"),
)
async with client.browser(profile_uuid=profile.uuid) as browser:
    await browser.goto("https://example.com/login")

Reuse the profile ID for subsequent sessions. proxy accepts PremiumProxy for residential or mobile IPs, SharedProxy for testing, or your own proxy URL. client.proxies lists locations and quota.

Parallel browsers

client.map distributes items across a browser pool. Inside the client context:

async def title(browser, url):
    await browser.goto(url)
    return await browser.title()


urls = ["https://example.com", "https://example.org"]
for result in await client.map(title, urls, concurrency=2):
    print(result.item, result.value if result.ok else result.error)

Without a concurrency limit, the pool uses your plan's maximum. Results include per-item errors.

To use a browser from the pool:

async with client.browsers() as pool:
    async with pool.lease() as browser:
        await browser.goto("https://example.com")
        print(await browser.title())

lease() waits for a free browser and returns it to the pool on exit. Cookies and browser state persist between leases.

Reference and examples

client.session() exposes a CDP URL for external browser clients. See the Playwright and Selenium examples. Install example dependencies with uv sync --group examples.

Development

uv sync --all-extras
uv run ruff check . && uv run ty check && uv run pytest

Live tests require credentials and bill your account:

SURFSKY_LIVE_TESTS=1 uv run pytest tests/test_live_concurrency.py

License

MIT

Metadata

Release files for surfsky 0.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for surfsky 0.0.16
File Size Uploaded Provenance
surfsky-0.0.16.tar.gz 79.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for surfsky 0.0.16
File Interpreter ABI Platform
surfsky-0.0.16-py3-none-any.whl Python 3 none any Details

Total release size: 119.9 kB

Release files / surfsky-0.0.16.tar.gz

Download URL surfsky-0.0.16.tar.gz
Size 79.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a9393f113d520323097cb0e5ff69462ab22599465684a42dca1ab8f0c309f0ba
BLAKE2b-256 checksum
How to use checksums
12393cecddb2a82f7fe0dbf30d8ec2d654783d25fea3c505e6be07f9d8e6f13b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / surfsky-0.0.16-py3-none-any.whl

Download URL surfsky-0.0.16-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5977e52da54bed791982d103e2e912b75a1e4e1238aaf043adde61fe9bf091ff
BLAKE2b-256 checksum
How to use checksums
f0b9a874b17d2a6bac82197d8c04158110aecbfb72efb06ac93c78837cd32cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for surfsky 0.0.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page