CLI & SDKs

CLI & SDKs

Webshare publishes an official command-line interface and SDKs for Node.js, Python and Go. They are built on this API and open source on GitHub (opens in a new tab).

CLI

webshare is the official command-line interface. It lists and exports proxies, builds proxy URLs, shows usage statistics and manages IP authorizations, plans and sub-users.

Install

Install with Homebrew (opens in a new tab):

terminal
brew install webshare-proxy/tap/webshare

Each release includes a checksums.txt file to verify the download.

Authenticate

Sign in through your browser:

terminal
webshare login
webshare whoami

login opens the Webshare consent screen and asks for the access the CLI's commands need. The CLI stores the token in your operating system's keychain, or in a file only you can read when there is no keychain. The token refreshes by itself.

The CLI then shows up on the Connected Apps (opens in a new tab) page of your dashboard. Run webshare logout to revoke the login.

Run your first command

terminal
# Check who you're logged in as
webshare whoami
 
# Export your proxy list as CSV
webshare proxies list --format csv --limit 0 > proxies.csv
 
# See bandwidth and request stats
webshare stats
 
# Make a request through a rotating proxy
curl --proxy "$(webshare proxy-url --rotate)" https://ipv4.webshare.io/

On a terminal the output is a table. In a pipe it is plain text with no headers or colors, and --json gives JSON. Commands that work on a plan accept --plan and use your active plan without it. See the CLI README (opens in a new tab) for every command.

SDKs

The SDKs wrap this API with typed clients. They read your API key from the WEBSHARE_API_KEY environment variable.

Requires Node.js 20 or newer. Ships ESM and CommonJS builds with TypeScript types.

terminal
npm install @webshare-proxy/sdk
example.mjs
import { Webshare } from '@webshare-proxy/sdk'
 
const client = new Webshare() // reads WEBSHARE_API_KEY
const page = await client.proxies.list({ mode: 'direct' })
console.log(page.results[0])

npm (opens in a new tab) · GitHub (opens in a new tab)

Most proxy operations are scoped to a plan. Without a plan ID, the API uses your account's default plan. To pick one, list your plans and pass the plan's ID. Each SDK's README on GitHub shows how.