For the complete documentation index, see llms.txt. This page is also available as Markdown.

Geolocation & Proxy Selection

Find out how to use the location parameters to access web data from specific locations.

Use geolocation and proxy routing parameters directly to the WebSocket connection URL to route your automated Headless Browser sessions through targeted geographic regions and control your proxy IP usage.

Geolocation parameters

You can target specific geographic locations by country, state, or city using three primary query parameters.

Country

p_cc

2 letter country code (e.g., US, DE, FR). If no country is specified, it's automatically assigned based on availability.

wss://USER:PASS@ubc.oxylabs.io?p_cc=US

City

p_city

City name written in lowercase (e.g., berlin, los_angeles). Must also specify either p_cc or p_state.

wss://USER:PASS@ubc.oxylabs.io?p_cc=US&p_city=new_york

City-level targeting operates as best-effort preference. If the residential proxy pool doesn't have an available proxy in exact requested location, it automatically falls back to the country scope.

State (US-only)

p_state

US state name in lowercase (e.g., texas, ohio). See the full supported states list.

wss://USER:PASS@ubc.oxylabs.io?p_state=texas&p_city=houston

Note: If p_state and p_cc are both specified, p_state takes priority and p_cc is ignored.

Proxy selection (sticky proxies)

By default, the proxy gateway assigns a fresh exit IP to each unique browser connection session. Alternatively, you can pin a specific residential exit IP across continuous browser connection attempts by including the proxy_resi_ses_id and proxy_resi_ses_time parameters.

Parameter
Description
Type

proxy_resi_ses_id

Alphanumeric session tracker name ranging from 3 to 36 characters.

string

proxy_resi_ses_time

Number of minutes to hold the pinned residential proxy exit IP. Min – 1 minute, max – 1440 minutes (24 hours).

integer

Code examples

The following examples show how to construct connection strings that apply geographic targeting together sticky residential proxy IP constraints.

Last updated

Was this helpful?