Direct Engineering Answer

Webshare exposes two distinct control planes: REST API v2 (https://proxy.webshare.io/api/v2/proxy/list/ authenticated via Authorization: Token <API_KEY>) for dynamic pool synchronization, IP whitelisting, and automated download URLs, plus the p.webshare.io backbone gateway for instant HTTP (:80) and SOCKS5 (:1080) routing with username suffixes like -rotate, -US, and sticky -{session_id} across all plans—including the 10-IP free tier.

API Base & Auth
proxy.webshare.io/api/v2/ · Token Header
Backbone Gateway
p.webshare.io (:80 HTTP / :1080 SOCKS5)
Rotation Suffixes
-rotate · -{country} · -{session_id}
Auth Modes
User/Pass + IP Whitelist (sourceip)
2026 Verified Webshare Tier

Start With 10 Free Shared IPs (No Credit Card Required)

Spin up HTTP & SOCKS5 credentials or whitelist your server IP via REST API v2 in under two minutes.

Activate Free Tier → View 5x13 Matrix

Webshare REST API v2 Architecture, Token Auth & Plan Discovery

Manual CSV copy-pasting breaks production scraping pipelines the moment Webshare replaces a stale IP, your autoscaling Kubernetes nodes change egress CIDRs, or you add regional capacity. Webshare solves programmatic infrastructure synchronization through REST API v2 (`https://proxy.webshare.io/api/v2/`), an explicit JSON control plane included across every tier from the permanent 10-IP free account up through bulk enterprise deployments.

Authentication relies on a clean static bearer token sent inside the HTTP header `Authorization: Token <API_KEY>` (note the `Token` prefix rather than `Bearer`). Every account creates an API key inside the Webshare dashboard, and multi-tenant teams can isolate workloads cleanly using sub-user contexts so staging jobs never read production billing quotas or manipulate live IP whitelists.

Understanding the division between Webshare's control plane and data plane prevents architectural mistakes. REST API v2 handles metadata operations: querying active proxy allocations via `GET /api/v2/proxy/list/`, reading current proxy configuration (`GET /api/v2/proxy/config/`), managing authorized IP whitelist entries (`/api/v2/proxy/ipauthorization/`), rotating tokenized download URLs, and initiating automated IP replacements. By contrast, actual scraped web packets never traverse `/api/v2/`—they flow through direct proxy `IP:Port` sockets or the unified `p.webshare.io` backbone router.

This decoupling keeps proxy ingestion fast and fault-tolerant. Your scheduler or Scrapy initialization hook queries REST API v2 once every 15 to 60 minutes, caches the normalized proxy inventory in Redis or local memory, and dispatches millions of target requests directly over `p.webshare.io` or dedicated sockets without touching the control plane per scrape.

  • Header Syntax: Always pass `Authorization: Token <YOUR_API_KEY>`—sending `Bearer` triggers an immediate HTTP 401 authentication rejection.
  • Mode Parameter Requirement: Calls to `/api/v2/proxy/list/` require `?mode=direct` (individual proxy endpoints) or `?mode=backbone` (backbone routing format) to resolve cleanly.
  • Zero-Cost Verification: REST API v2 endpoints work completely on Webshare's 10 Free Proxies account ($0/mo, no credit card), letting CI suites test token parsing before spending money.
  • Plan Isolation: Pass `?plan_id=<id>` when managing multiple active subscriptions (for example, separating Datacenter and Static ISP pools inside one master account).
Never Poll /api/v2/proxy/list/ Per Scraped URL

Fetch your proxy inventory on worker startup and refresh it on a 15-to-60-minute TTL cache. Calling REST API v2 before every outbound target request wastes latency, risks rate limits, and gains zero operational benefit over p.webshare.io backbone rotation.

Paginated /api/v2/proxy/list/ vs. Tokenized Automated Download URLs

Webshare gives infrastructure engineers two distinct mechanisms to pull live proxy rosters into scrapers, anti-detect browsers, and firewall orchestrators: paginated JSON via `/api/v2/proxy/list/` and pre-signed plain-text/CSV automated download links (`https://proxy.webshare.io/api/v2/proxy/list/download/{token}/-/{country}/-/backbone/...`). Choosing the right method simplifies deployment dramatically depending on your stack.

The standard JSON endpoint (`GET /api/v2/proxy/list/?mode=direct&page=1&page_size=25`) exposes rich telemetry on every allocated IP: `proxy_address`, `port`, `username`, `password`, `country_code`, `city_name`, `asn_number`, `asn_name`, `valid` health flag, and `last_verification` timestamp. That structured payload is invaluable when building custom proxy managers that filter endpoints by city, log ASN diversity, or feed multi-account social browser profiles requiring explicit `asn_name` validation.

Conversely, many third-party scrapers, Scrapy rotation plugins, or shell workers expect a flat `ip:port:user:pass` text file without writing custom JSON pagination loops or storing your master API secret inside every ephemeral worker container. Webshare's automated download URL embeds a dedicated scoped download token directly in the path—letting headless containers, CI runners, or remote VPS nodes fetch refreshed lists with a single `curl` command while keeping your primary write-capable REST API key locked safely inside vault storage.

Both mechanisms honor Webshare's instant replacement lifecycle. Whenever Webshare replaces an unhealthy node or you trigger an on-demand proxy refresh, querying either the v2 JSON list or the automated download URL returns the updated roster automatically without editing `.env` files.

Core Webshare REST API v2 Control-Plane Endpoints (2026 Specification)
Endpoint PathMethodAuth / ScopingPrimary Engineering Purpose
/api/v2/proxy/list/?mode=directGETAuthorization: TokenPaginated JSON list with IP, port, ASN, geo & valid flag
/api/v2/proxy/list/?mode=backboneGETAuthorization: TokenFetch backbone-formatted endpoints for p.webshare.io
/api/v2/proxy/list/download/{token}/...GETScoped URL tokenZero-header text/CSV export for Scrapy & bash tools
/api/v2/proxy/config/GET / PATCHAuthorization: TokenInspect or update auth mode (username vs sourceip)
/api/v2/proxy/ipauthorization/GET / POST / DELAuthorization: TokenRegister or revoke whitelisted server egress IPs
/api/v2/proxy/replace/POSTAuthorization: TokenProgrammatically replace blocked or stale proxies
/api/v2/subscription/GETAuthorization: TokenMonitor active bandwidth GB, plan IDs & expiration

Direct IP:Port Sockets vs. p.webshare.io Backbone Gateway Routing

Once credentials are loaded, engineers face a core routing choice: connect directly to individual assigned IP:port sockets returned by `?mode=direct`, or route every request through Webshare's global Anycast-style backbone host `p.webshare.io` (typically port `80` for HTTP/HTTPS and SOCKS5 on backbone endpoints; always verify exact port mappings inside your active Webshare dashboard). Each topology serves distinct production guarantees.

Direct IP:Port routing opens TCP connections straight to a specific proxy server node. For Webshare Static Residential (ISP) proxies or Dedicated Datacenter pools assigned 1:1 to persistent browser profiles, direct IP:port routing gives maximum transparency: you know the exact exit IPv4 address ahead of time, experience zero intermediary backbone routing hop, and eliminate shared gateway bottlenecks on latency-critical market feeds. Direct sockets also make per-IP throughput telemetry deterministic inside Prometheus exporters because every TCP socket maps 1:1 to a single external interface.

Backbone routing via `p.webshare.io`, by contrast, acts as an intelligent reverse proxy multiplexer in front of Webshare's massive IP inventory—especially mandatory for the 80M+ Rotating Residential network where downloading 80 million static IPs into a local array is physically impossible. With `p.webshare.io`, your scraper opens connections to one static DNS endpoint while Webshare's gateway dynamically selects the exit node in real time based on suffixes appended to your proxy username.

Crucially, `p.webshare.io` also works smoothly across paid Datacenter and Free 10-IP plans when backbone mode is enabled—letting one unified client configuration drive Free Staging, Paid Datacenter, and Rotating Residential pools simply by swapping credential environment variables. Automated download URLs mirror this flexibility through path segments (`/{token}/{country_filter}/any/{endpoint_mode}/.../`) so DevOps pipelines can export filtered US-only or high-speed subsets directly into NGINX stream upstreams or Scrapy proxy lists without custom Python glue.

  • Use Direct IP:Port (`mode=direct`) when running 1:1 Static ISP social accounts, latency-sensitive market feeds, or persistent anti-detect browser containers.
  • Use Backbone (`p.webshare.io`) for Rotating Residential (80M+ IPs), auto-rotating datacenter scraping, and serverless workers where maintaining a synced proxy list file adds unnecessary complexity.
  • TLS & SOCKS5 Compatibility: `p.webshare.io` forwards raw encrypted TLS streams for both HTTP CONNECT and SOCKS5 (`socks5h://`) without MITM TLS termination.
  • Automated Download Scoping: Tokenized download URLs support built-in filters for country codes, ASN exclusions, and plaintext formatting (`ip:port:user:pass`) ready for zero-dependency bash ingestion.

Mastering -rotate, Country Suffixes & Sticky -{session_id} Tags on p.webshare.io

Webshare encodes dynamic routing instructions directly inside the proxy `username` field during HTTP `Proxy-Authorization` or SOCKS5 username/password negotiation—meaning zero custom HTTP headers are leaked to the target website and every standard library from `curl` to `Playwright` works out of the box.

The baseline patterns are deterministic and easy to automate. For Rotating Residential traffic across the 80M+ pool, appending `-rotate` to your base username (for instance, `myuser-rotate:[email protected]:80`) instructs the backbone to assign a fresh residential exit IP on each new TCP request. Adding an uppercase ISO 3166-1 alpha-2 country code before the suffix—such as `myuser-US-rotate` or `myuser-DE-rotate`—constrains rotation strictly within that nation across 195+ countries, with finer state, city, and ASN targeting modifiers configurable right inside your Webshare proxy routing panel.

Whenever a workflow requires session continuity—such as signing into a dashboard, stepping through multi-page search pagination, or holding items in an e-commerce cart to verify ZIP-level shipping fees—replace `-rotate` with an arbitrary alphanumeric session key like `myuser-US-sess9042` or `myuser-GB-worker07`. As long as consecutive requests reuse the exact same `-{session_id}` token while that underlying home peer stays online, `p.webshare.io` locks your traffic onto the same exit IP.

The dual Python and Node.js snippets below demonstrate two essential production tasks: first, fetching and caching your live proxy list safely from REST API v2 with error checks; second, constructing dynamic `-rotate`, geo-targeted, and sticky `-{session_id}` gateway strings.

Production Node.js & Python Webshare REST API v2 sync + p.webshare.io suffix builder
// Node.js 20+ (native fetch): Sync REST API v2 proxy list & build p.webshare.io routes
const API_KEY = process.env.WEBSHARE_API_KEY;

export async function fetchWebshareDirectList(page = 1, pageSize = 25) {
  const url = `https://proxy.webshare.io/api/v2/proxy/list/?mode=direct&page=${page}&page_size=${pageSize}`;
  const res = await fetch(url, {
    headers: { Authorization: `Token ${API_KEY}` }
  });
  if (!res.ok) {
    throw new Error(`Webshare API v2 failed: ${res.status} ${await res.text()}`);
  }
  const data = await res.json();
  return data.results.filter((item) => item.valid);
}

export function buildBackboneUrl({ username, password, country, sessionId, protocol = "http" }) {
  const parts = [username];
  if (country) parts.push(country.toUpperCase());
  parts.push(sessionId ? sessionId : "rotate");
  const routedUser = parts.join("-");
  const port = protocol === "socks5h" ? 80 : 80;
  return `${protocol}://${encodeURIComponent(routedUser)}:${encodeURIComponent(password)}@p.webshare.io:${port}`;
}

// Example usage:
console.log(buildBackboneUrl({ username: "ws_demo", password: "secret", country: "US" }));
console.log(buildBackboneUrl({ username: "ws_demo", password: "secret", country: "DE", sessionId: "cart77" }));
Deploy This Architecture Risk-Free

Test Live Webshare Endpoints With 10 Free Proxies

Every Webshare account starts with 10 shared proxies and 1 GB monthly bandwidth—no credit card required. Upgrade cleanly only after latency and success rates match your benchmark.

Claim 10 Free Webshare IPs → View 5x13 Matrix

IP Whitelist (sourceip) vs. Username/Password Auth in Autoscaling Clusters

Webshare supports two distinct proxy authentication architectures configurable via the dashboard or `PATCH /api/v2/proxy/config/`: `username` (standard username/password credentials) and `sourceip` (IP address whitelisting, either standalone or alongside user/pass). Picking the wrong mode inside cloud-native infrastructure creates sudden authentication outages during container restarts.

Username/password authentication (`username`) shines inside Kubernetes pods, AWS Lambda functions, Vercel edge runners, and developer laptops where outbound server IP addresses shift unpredictably across deployments or dynamic home ISP leases. Even better, `username` authentication is mandatory if you intend to use dynamic suffix modifiers (`-rotate`, `-US`, `-{session_id}`) on `p.webshare.io`, because routing flags live inside the authenticated username string itself.

IP whitelisting (`sourceip`), conversely, authorizes your static VPS, bare-metal server, or NAT Gateway egress IP inside `/api/v2/proxy/ipauthorization/` so outbound clients require zero password embedding inside proxy connection URLs (`http://p.webshare.io:80` or `socks5://198.51.100.10:5432`). Certain legacy enterprise applications, browser plugins, and rigid CLI utilities break completely when proxy passwords contain special characters or fail to handle HTTP 407 `Proxy-Authorization` negotiation inside nested WebRTC/WebSocket tunnels; `sourceip` solves those compatibility edge cases cleanly.

When deploying `sourceip` auth inside autoscaling AWS ECS or GCP GKE worker pools, automate whitelist registration in your deployment lifecycle: attach a static Cloud NAT egress IP to your worker VPC and verify it once via `GET /api/v2/proxy/ipauthorization/`, rather than whitelisting ephemeral container IPs that leak stale authorizations when pods recycle.

  1. Use `username` auth exclusively when running Rotating Residential sticky suffixes (`-{session_id}`), geo flags (`-US`), or dynamic serverless worker nodes without fixed NAT IPs.
  2. Use `sourceip` IP whitelisting only behind fixed NAT Gateways or static bare-metal servers—especially for legacy binaries that choke on HTTP 407 proxy auth handshakes.
  3. Programmatically audit `/api/v2/proxy/ipauthorization/` monthly to purge retired developer home IPs or decommissioned staging servers.
  4. Never commit raw REST API v2 keys or automated download tokens into public Git repositories; store them in encrypted secret managers or CI environment variables.

Automated Proxy Health Checks, Replacement APIs & Sub-User Plan Isolation

Static proxy lists decay slowly over weeks as individual subnets encounter upstream BGP maintenance or domain-specific rate-limit bans. Webshare tracks verification health natively via the `valid` boolean and `last_verification` timestamp returned on `/api/v2/proxy/list/`, and provides programmatic replacement slots on eligible datacenter and static plans through `POST /api/v2/proxy/replace/`. Automating replacement hygiene ensures poisoned subnets leave rotation immediately rather than silently degrading crawl yield.

Rather than letting a dead proxy socket stall Scrapy download workers until a 30-second timeout fires, pair REST API v2 syncs with lightweight local active health checks. Every 10 minutes, a background Go or Python coroutine sweeps your local Redis proxy hash against a fast lightweight echo endpoint (`https://ipv4.webshare.io/` or a DNS-verified health check) using a tight 4-second connect timeout. Any IP recording three consecutive socket timeouts, elevated TLS handshake delays, or domain-specific HTTP 403 streaks gets quarantined locally for 30 minutes while healthy siblings absorb traffic seamlessly.

When building replacement automation via `/api/v2/proxy/replace/`, guard against burning through your monthly replacement quota on transient target-side blocks. Only trigger an upstream Webshare IP swap after confirming that a proxy fails across multiple unrelated reference hosts or exhibits a sustained drop in `valid` status—never swap an entire 100-IP datacenter list simply because one downstream retailer rate-limited an aggressive burst without backoff.

For agencies or SaaS products serving multiple downstream client projects under one Webshare billing umbrella, sub-user isolation (`X-Subuser` scoped credentials and sub-user management APIs) prevents noisy-neighbor billing disasters. Each downstream team receives scoped proxy credentials, isolated bandwidth ceilings, and independent `p.webshare.io` access logs so a single runaway crawler script cannot drain your organization's entire rotating residential balance.

Monitoring your remaining monthly gigabytes is equally deterministic via `GET /api/v2/subscription/`: pull current bandwidth consumption into Prometheus or Datadog once per hour, calculate daily burn velocity against billing cycle days remaining, and fire Slack webhooks whenever residential burn crosses 75% of forecast—long before an unblocked media leak forces an emergency overage top-up.

  1. Sync `/api/v2/proxy/list/?mode=direct` every 30 minutes into Redis keyed by proxy ID and expiration TTL.
  2. Run non-blocking async probe sweeps against `https://ipv4.webshare.io/` every 10 minutes and quarantine failing nodes locally.
  3. Trigger `POST /api/v2/proxy/replace/` solely for confirmed transport-dead IPs or persistent ASN blacklists, respecting your plan's monthly swap allowance.
  4. Enforce sub-user isolation and hourly `/api/v2/subscription/` usage polling to catch abnormal residential gigabyte spikes automatically.
Protect Your Automated Download Token Like a Password

Webshare's automated download URL returns live proxy usernames and passwords in plain text without requiring an Authorization header. Treat that download URL as a production secret: never embed it in client-side browser code or public dotfiles, and rotate the download token immediately if exposed.

Debugging HTTP 401, 402, 407 & Backbone Connection Resets in Production

Operational troubleshooting becomes predictable once you map Webshare error codes cleanly to control-plane versus data-plane failures. On REST API v2 (`proxy.webshare.io`), HTTP 401 Unauthorized almost always stems from substituting `Bearer` for `Token` in the `Authorization` header or referencing an expired sub-user key. HTTP 429 Too Many Requests on `/api/v2/` indicates an aggressive worker fleet polling the list endpoint inside every request loop instead of caching locally.

On the data plane (`p.webshare.io` and direct sockets), HTTP 407 Proxy Authentication Required traces back to four concrete root causes: sending `user:pass` credentials when your account config enforces strict `sourceip`-only mode without dual auth, misspelling country or session suffix hyphens (`_US` instead of `-US`), hitting an unwhitelisted server IP after a cloud reboot, or exceeding active account concurrency/bandwidth limits (which returns 402 Payment Required / proxy limit errors on the 1 GB free tier).

SOCKS5 errors demand slightly different inspection. If `curl --socks5` works on `http://ipv4.webshare.io/` locally yet fails when resolving target domains from inside Docker, switch `--socks5` to `--socks5-hostname` (or `socks5h://` in Python/Node). Standard `socks5://` forces local container DNS resolution before tunneling, which breaks when minimal Alpine containers lack working external DNS routes or expose your server's geographic region to target anti-fraud heuristics.

Testing every one of these REST API v2 endpoints, `sourceip` whitelists, and `p.webshare.io` routing patterns costs exactly $0 on Webshare's permanent 10 Free Proxies plan—giving engineering teams full production parity in staging without touching a credit card.

  • API 401 Error: Verify exact header `Authorization: Token <API_KEY>` with zero extra quotes or trailing newlines.
  • Proxy 407 Error: Check `GET /api/v2/proxy/config/` to confirm whether `username` auth, `sourceip` whitelist, or dual mode is active on the selected plan.
  • Proxy 402 / Quota Stop: Query `/api/v2/subscription/` to check if the 1 GB free monthly cap or paid residential GB ceiling was exhausted.
  • SOCKS5 DNS Leak: Always use `socks5h://` so target domain DNS resolution executes remotely at the Webshare exit gateway.

Frequently Asked Questions

What authentication header does Webshare REST API v2 require?
Webshare REST API v2 requires the exact header format Authorization: Token <YOUR_API_KEY>. Using Bearer instead of Token will trigger an HTTP 401 authentication failure.
Does Webshare's 10 Free Proxies plan include REST API v2 and p.webshare.io access?
Yes. Even on the $0/month permanent free tier (10 shared proxies and 1 GB monthly traffic, no credit card), you get full REST API v2 access, automated download URLs, IP whitelisting, and HTTP/SOCKS5 endpoints so your production automation runs identically in staging.
How do I force a fresh IP on every request vs. a sticky IP on p.webshare.io?
Append -rotate to your proxy username (for example myuser-rotate or myuser-US-rotate) to rotate exit IPs per TCP request. Replace -rotate with a custom session identifier (for example myuser-US-sess42) to pin subsequent requests onto the same exit IP for multi-step stateful workflows.
What is the difference between mode=direct and mode=backbone on /api/v2/proxy/list/?
Passing mode=direct returns your individual assigned proxy IP addresses and ports with ASN and city metadata, which is ideal for 1:1 Static ISP or dedicated datacenter sockets. Passing mode=backbone configures endpoints routed through the centralized p.webshare.io gateway.
Can I use IP whitelisting (sourceip) together with rotating geo suffixes?
Geo and sticky session suffixes (-US, -rotate, -{session_id}) are parsed from the proxy username field. For dynamic suffix routing across serverless containers or multi-geo scrapers, keep username/password authentication enabled rather than pure IP-only whitelisting.
How often should my scraper refresh Webshare's proxy list endpoint?
Poll /api/v2/proxy/list/ or your automated download URL once on startup and refresh on a 15-to-60-minute schedule into Redis or local memory. Never call the REST API synchronously inside per-URL scraping loops.
WebshareIPS Proxy Engineering Desk

Benchmarked and maintained against Webshare 2026 public pricing schedules, REST API v2 documentation, and multi-provider TLS/HTTP concurrency checks. Read our testing policy.

Related Benchmarks & Guides

Also Audited by Our Engineering Desk