Skip to main content

surfsky-cli

CLI for Surfsky, an antidetect cloud browser.

Requires Python 3.12+ on macOS, Windows or Linux.

Install

uv tool install surfsky-cli

Or install with pipx install surfsky-cli or pip install surfsky-cli.

Credentials

Get your API token and base URL from the dashboard.

macOS / Linux:

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

Windows (PowerShell):

$env:SURFSKY_API_TOKEN = 'your-token'
$env:SURFSKY_API_BASE_URL = 'your-base-url'

Verify with surfsky status. Flags --api-token and --base-url override the environment. Credentials are not stored. Session records go in ~/.surfsky; set SURFSKY_HOME to change the directory.

Scrape

surfsky scrape https://example.com                         # Markdown
surfsky scrape https://example.com --only-main-content     # omit navigation, footers, forms
surfsky scrape https://example.com -f markdown,links --json --pretty
surfsky scrape https://example.com -f screenshot -o shot.png
surfsky scrape https://example.com --proxy premium --country us --os mac

Formats: markdown (default), html, raw_html, links, screenshot. One format returns content; multiple formats return JSON. html is cleaned; raw_html is unchanged. Scrape screenshots are base64 unless saved with -o in text mode.

By default, scrape closes its browser when finished. --keep leaves it running and returns its ID. --profile ID uses a saved profile. --session ID reuses the active tab; omit the URL to read its current page.

Browser sessions

surfsky session start --proxy premium --proxy-type mobile --country us
export SURFSKY_SESSION='returned-session-id'
surfsky goto https://google.com
surfsky type 'textarea[name=q]' surfsky
surfsky press Enter -s
surfsky get text
surfsky screenshot -o results.png
surfsky session stop

Replace returned-session-id with the ID from session start. On PowerShell, use $env:SURFSKY_SESSION = 'returned-session-id'. You can also pass --session ID on each command; unique ID prefixes work.

Sessions bill per minute, including idle time, until stopped or the idle timeout expires. Set --idle-timeout SECONDS when starting a session. surfsky status checks the selected session's connection and resets its idle timer. surfsky session devtools prints live view and DevTools URLs.

-s returns a snapshot with @N references for click, type and fill. CSS selectors and text=words also work. Take a new snapshot after navigation or a tab switch; each snapshot replaces the references.

Sessions and scrapes accept --proxy premium|shared|URL, --proxy-type mobile, --country, --region, --city, and --os win|mac|android. See surfsky proxy --help for location lists and quota commands.

To save logins, create a profile with surfsky profile create acct --country us --os win, then use its ID with surfsky session start --profile ID.

Agents and scripts

surfsky skill --install writes agent instructions to .claude/skills/surfsky-cli/SKILL.md and .agents/skills/surfsky-cli/SKILL.md. Rerun it after upgrading the CLI. surfsky skill prints the instructions.

  • --json or SURFSKY_JSON=1: success returns ok: true; errors return ok: false with code, message, hint and retryable under error. JSON errors go to stdout; text errors go to stderr.
  • -o FILE saves output; --pretty indents JSON. For screenshot, -o saves PNG and --json returns its path and size.
  • Exit codes: 0 success, 1 error, 2 usage, 3 missing or expired session, 4 authentication, 5 timeout, 6 not found or stale reference, 7 quota or plan limit.

Development

uv sync --all-groups
uv run pytest -q

Release files for surfsky-cli 0.0.7

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-cli 0.0.7
File Size Uploaded
surfsky_cli-0.0.7.tar.gz 53.7 kB Details

Built distribution (wheel)

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

Total release size: 97.0 kB

Release files / surfsky_cli-0.0.7.tar.gz

Download URL surfsky_cli-0.0.7.tar.gz
Size 53.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad5b0f121f6d4926d6f935377aaa9d7e4ea00c83ba41efbea44fda5280845c3c
BLAKE2b-256 checksum
How to use checksums
183545358a4f11e2c1df770e2c6ba66de2bb36d5257744a9e61c8735b7e1d0ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","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_cli-0.0.7-py3-none-any.whl

Download URL surfsky_cli-0.0.7-py3-none-any.whl
Size 43.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf5c5264dbb81ab0e98a77fcba23ad09d372fd526c4b55448b96bc9924f28961
BLAKE2b-256 checksum
How to use checksums
33c1df48b9bc940fd7d33aeb726ab32f7ab467b2d361e6260ddb2e452c1e7371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","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 history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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