Geolocation & Proxy Selection
Find out how to use the Oxylabs Agent Browser 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 Agent 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@hb.oxylabs.io?p_cc=USCity
p_city
City name written in lowercase (e.g., berlin, los_angeles). Must also specify either p_cc or p_state.
wss://USER:PASS@hb.oxylabs.io?p_cc=US&p_city=new_yorkState (US-only)
p_state
US state name in lowercase (e.g., texas, ohio). See the full supported states list.
wss://USER:PASS@hb.oxylabs.io?p_state=texas&p_city=houstonProxy 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.
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?