Solari

Proxies

Route your browser through an IP in the country you choose. Pick from three kinds of IP (rotating residential, static ISP, and mobile), and optionally reuse the same IP across sessions.

Paid plans only
Proxies (which also require stealth: true) need a paid plan. On the Free plan the request fails with HTTP 402 (FeatureRequiresPlan).

How to turn it on

Pass a proxy object to sessions.create(). country is the only field you need.

type ProxyOptions = {
  // Two-letter country code, lowercase. See the list below.
  country: string

  // Which kind of IP. Default "residential".
  //   "residential": everyday home-internet IPs.
  //   "static":      one fixed IP that stays the same all session.
  //   "mobile":      cellular carrier IPs.
  tier?: "residential" | "static" | "mobile"

  // Reuse one IP across sessions. Pick any short label; sessions that
  // share the label share the IP. Not the same as the Session object.
  session?: string

  // US only: narrow the IP to one state, e.g. "california" or "CA".
  // See "Picking a US state" below for what each tier can serve.
  state?: string

  // US only, needs state: narrow further to one city, e.g. "los_angeles".
  city?: string
}
proxy.session vs the SDK Session object
proxy.session is just a label you pick to reuse the same IP. It is not the same thing as the Session object returned by sessions.create().

Examples

// Residential, US.
sessions.create({ stealth: true, proxy: { country: "us" } })

// Residential, GB.
sessions.create({ stealth: true, proxy: { country: "gb" } })

// Static ISP, US: one fixed IP for the whole session.
sessions.create({ stealth: true, proxy: { country: "us", tier: "static" } })

// Mobile, US.
sessions.create({ stealth: true, proxy: { country: "us", tier: "mobile" } })

// Reuse one IP across several sessions: give them the same label.
sessions.create({
  stealth: true,
  proxy: { country: "us", session: "warmup-1" },
})

Proxies require stealth: true.

Choosing a tier

ResidentialStatic ISPMobile
tier"residential" (default)"static""mobile"
The IPOne exit IP per session; reuse it across sessions with sessionStays the same all sessionOne exit IP per session; reuse it across sessions with session
SpeedVaries (home internet)Fast and steadyVaries (cellular)
Best forGetting past bot defenses; geo-diverse scrapingIP allowlisting; account-bound sessionsThe toughest targets that block residential IPs

Proxy traffic is billed per GB. See Pricing.

Older static: true still works
An earlier version used a static: boolean field. static: true still works and means the same as tier: "static" (as does tier: "isp"). For new code, prefer the tier form.

Supported countries

Pass any of these as the lowercase two-letter code:

CodeCountryCodeCountryCodeCountry
auAustraliadeGermanyjpJapan
brBrazilesSpainkrSouth Korea
caCanadafrFrancemxMexico
gbUnited KingdominIndianlNetherlands
sgSingaporeitItalyusUnited States

Any other code is rejected with a 400 that lists the supported ones.

Static ISP covers 12 of these
tier: "static" is served from a fixed ISP pool that exists in au, br, ca, de, es, fr, gb, it, jp, nl, sg and us. Asking for static in in, kr or mx returns a 400 before any session is created; use residential (the default) or mobile there; both cover every country in the table. GET /proxy/countries returns the per-tier lists.

Reusing the same IP

Use proxy.session when several sessions need to come from the same IP: multi-step logins, account-bound scraping, or any flow where a changing IP triggers a security challenge. Pick any label of 1 to 128 characters (any characters: the gateway turns it into a stable id for the proxy vendor). Sessions created with the same label get the same exit IP; a different label, or no label at all, gets a different one. A label that is not a string, is empty or is over 128 characters returns a 400.

Picking a US state

With country: "us", proxy.state narrows the exit IP to one state. Give the state’s name or its two-letter code: "california", "New York", "new_york" and "NY" all work. Washington DC is "district_of_columbia" or "DC". The browser’s timezone follows the state.

A state the proxy can’t serve is refused with a 400 before any session is created, so you are never billed for a session whose pages can’t load:

RequestError
state with any country other than usproxy.state is US-only
A name or code that is not a US stateUnknown proxy.state
tier: "static" with a state other than Massachusetts, New York or Virginiaproxy.state not available on the static tier
tier: "mobile" in Alaska, Delaware, Iowa, Kansas, Maine, Maryland, Mississippi, Montana, New Hampshire, North Dakota, South Carolina, South Dakota, Vermont, West Virginia or Wyomingproxy.state not available on the mobile tier
Not a string, or anything but letters, digits, spaces and underscores (at most 64 characters)Invalid proxy.state

residential (the default) covers every state. A static US session with no state exits in Boston and reports the New York timezone.

Picking a city

proxy.city narrows a US state to one city, e.g. { state: "california", city: "los_angeles" }. A city is matched only inside its own state, so city always needs state. It is lowercased, spaces and hyphens become underscores and other punctuation is dropped before it is sent (Winston-Salem becomes winston_salem).

RequestError
city with any country other than usproxy.city is US-only
city without stateproxy.city needs proxy.state
tier: "static" with any city except boston (state Massachusetts) or new_york_city (state New York)proxy.city not available on the static tier
Not a string, or anything but letters, digits, spaces, underscores, periods, hyphens and apostrophes (at most 64 characters)Invalid proxy.city
An unknown city is not caught
There is no list of every city the proxy can serve, so a correctly spelled city in the right state can still have no IP. That session is created, but its pages don’t load. Use the proxy’s own spelling (new_york_city, not new_york; stlouis for St. Louis), or pin only the state.

Skip heavy files

Proxy traffic is billed per GB, and pages heavy in video and large images can cost tens of megabytes per session. Set blockHeavy when you create the session and the browser refuses those requests, so they never cross the proxy. It is off by default.

const session = await client.sessions.create({
  stealth: true,
  proxy: "us",
  blockHeavy: true, // video/audio + images over 100 KB
})

// or choose what to skip:
// blockHeavy: { fonts: true, imageMaxBytes: 50_000 }
session = await client.sessions.create(
    stealth=True,
    proxy="us",
    block_heavy=True,  # or {"fonts": True, "image_max_bytes": 50_000}
)
  • Media (video and audio) is blocked before any byte is requested.
  • Images are judged by the size the server declares: an image larger than imageMaxBytes (100 KB by default) is dropped before its body is downloaded. An image that declares no size is allowed.
  • Fonts are only blocked if you ask (fonts: true); blocking them changes how pages render.

A blocked request fails inside the browser, so the page sees an ordinary failed load and the image or video simply does not appear. Nothing is sent around the proxy. Requests made by service workers or by cross-origin iframes are not covered. Recordings still play, because they load media from the original site.

In our measurements an image-heavy page went from about 38 MB to between 6.5 and 8.5 MB; pages whose images are all small are unchanged.

What you get back

The session response includes a proxy object confirming the country and tier you were given, plus a timezone that matches the IP's location. The proxy is already applied to the browser, so there is nothing else to set up.

const session = await client.sessions.create({
  stealth: true,
  proxy: { country: "gb" },
})

console.log(session.proxy.country)     // "gb"
console.log(session.proxy.tier)        // "residential"
console.log(session.proxy.timezoneId)  // "Europe/London"

To confirm you actually got a proxied session, check that session.proxy is present rather than checking for a 201.