Location Settings
Learn more about location settings for Residential Proxies. Here you'll find guides for location targeting from continents, specific cities to coordinates or geohash.
Oxylabs Residential Proxies cover over 195 locations worldwide, allowing granular traffic routing down to country, city, state, continent, ZIP code, geohash, ASN, or coordinate levels. Location parameters are added directly into your proxy username string or passed via custom headers.
cc
ISO 3166-1 alpha-2 code. Supports country-specific entry ports.
E.g. customer-USERNAME-cc-US
city
English city name. Requires cc parameter for maximum accuracy.
E.g. customer-USERNAME-cc-US-city-new_york
postalcode
5-digit US ZIP codes only. Requires cc-US.
E.g. customer-USERNAME-cc-US-postalcode-90210
geohash
Grid cell levels 1 to 4 (9 to drq4). Mutually exclusive with other geo parameters.
E.g. customer-USERNAME-geohash-u09
ASN
Target specific Autonomous System Numbers. Overridden if cc is present.
E.g. customer-USERNAME-ASN-21928
X-Oxylabs-Geolocation
Passed as an HTTP proxy header. Minimum 10-mile radius.
E.g. Latitude:Longitude;Radius
Country
Adding the cc parameter to the authorization header specifies the target country using a 2-letter ISO 3166-1 alpha-2 format country code (e.g., DE for Germany, GB for the United Kingdom, JP for Japan):
customer-USERNAME-cc-DE:PASSWORDCode examples
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-DE:PASSWORD" https://ip.oxylabs.io/locationimport urllib.request
username = 'USERNAME'
password = 'PASSWORD'
country = 'DE'
entry = f'http://customer-{username}-cc-{country}:{password}@pr.oxylabs.io:7777'
query = urllib.request.ProxyHandler({'http': entry, 'https': entry})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read().decode('utf-8'))<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'DE';
$proxy = 'pr.oxylabs.io:7777';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>Country-specific entry nodes
Alternatively, connect directly to country-specific domain entry points without modifying your username parameters. The following example query to ip.oxylabs.io/location is performed from a random Turkish IP:
Please see the dashboard for entry point information. Download a complete list of random entry points or find them in the table below.
City
Target proxies in specific cities by combining the city parameter with a matching country code (cc). Multi-word city names use underscores instead of spaces (e.g., new_york, rio_de_janeiro).
Code examples
Download the list of supported cities by clicking the file below:
State
Select proxies from specific US states using the st parameter. State names must include the us_ prefix (e.g., us_california, us_illinois).
Code Examples
In this example, a query to ip.oxylabs.io/location is performed from a random IP address from California, USA:
See the full supported state list below:
Continent
Route requests through any of the seven continents using the cn parameter followed by a two-letter continent code:
cn-AF – Africa
cn-AN – Antarctica
cn-AS – Asia
cn-EU – Europe
cn-NA – North America
cn-OC – Oceania
cn-SA – South America
Code example
ZIP / Postal code
Target specific US 5-digit ZIP codes using the postalcode parameter. The parameter must be used with the country code parameter cc and a case-insensitive country code in 2-letter 3166-1 alpha-2 format.
Code examples
Geohash
Target proxies within specific geographic grid cells using geohash codes ranging from Level 1 (largest) to Level 4 (smallest). Geohash allows precise grid-based targeting without relying on traditional administrative boundaries like country or city borders.
By default, geohash uses strict targeting: if no IP is available in the requested cell, the request returns a 502 Bad Gateway error.
1
≤ 5,000 km × 5,000 km
geohash-9 (Large part of US & Mexico), geohash-c (Northern US & Canada)
2
≤ 1,250 km × 625 km
geohash-gc (Ireland, Northern Ireland, England and Scotland)
3
≤ 156 km × 156 km
geohash-u09 (Paris)
4
≤ 39.1 km × 19.5 km
geohash-drq4 (Most of Nantucket Island)
Code examples
Geohash fallback
If your use case does not require a strict cell match, geohash_fallback uses the rotator that automatically removes one geohash character at a time to expand the area until an available proxy is found.
If no IP is found at single-character level, a 502 Bad Gateway error is returned.
Initial target:
2svd(≤ 39.1 km × 19.5 km)Fallback 1 (1 character removed):
2sv(≤ 156 km × 156 km)Fallback 2 (2 characters removed):
2s(≤ 1,250 km × 625 km)Fallback 3 (3 characters removed):
2(≤ 5,000 km × 5,000 km)
Code example
ASN targeting
Route traffic through specific Internet Service Provider (ISP) networks using Autonomous System Numbers (ASN). You can find ASN numbers here.
If no active proxies are available for the specified ASN, the request returns a 502 Bad Gateway error.
Coordinates
Target proxies near specific geographic coordinates using the X-Oxylabs-Geolocation HTTP proxy header. Value format is Latitude:Longitude;Radius (radius in miles, minimum 10 miles).
Code example
China entry nodes
For requests initiated from mainland China, dedicated HTTPS regional entry nodes provide optimized connectivity.
Hong Kong:
a81298871.com:8000Beijing:
cnt9t1is.com:8000
Last updated
Was this helpful?