Geo-location
Find out how to access content from specific locations using Web Unblocker.
If you want to specify from which location to access a particular website, add the x-oxylabs-geo-location header.
All targets
Using a country name
To get results localized for the geographical center point of a country, pass a country name. E.g., if you want to access a website content as if you are visiting it from Canada, add the "x-oxylabs-geo-location": "Canada" to your header.
Check the complete list of supported x-oxylabs-geo-location parameter values here.
curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://ip.oxylabs.io/location' \
-H 'x-oxylabs-geo-location: Canada'Amazon
Using the x-oxylabs-geo-location parameter value for Amazon pages will yield a result with a corresponding delivery preference setting.
There are a few ways you can use this parameter to get correctly-localized Amazon results. For most Amazon domains, you can either send a zip/postcode or a 2-letter ISO 3166-1 alpha-2 country code.
Using a zip/postcode
To localize the result to a place within the native country of the target marketplace, use a zip/postcode as an x-oxylabs-geo-location parameter value. For example, if you are scraping the Amazon .com domain, add an "x-oxylabs-geo-location": "90210" header, whereas if you are gathering data from Amazon .co.uk domain, your header will look like this: "x-oxylabs-geo-location": "W105LT".
curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://www.amazon.com/s?k=running+shoes' \
-H 'x-oxylabs-geo-location: 90210'import requests
# Use your Web Unblocker credentials here.
USERNAME, PASSWORD = 'YOUR_USERNAME', 'YOUR_PASSWORD'
# Define proxy dict.
proxies = {
'http': f'http://{USERNAME}:{PASSWORD}@unblock.oxylabs.io:60000',
'https': f'https://{USERNAME}:{PASSWORD}@unblock.oxylabs.io:60000',
}
headers = {
'x-oxylabs-geo-location': '90210'
}
response = requests.get(
'https://www.amazon.com/s?k=running+shoes',
verify=False, # It is required to ignore certificate
proxies=proxies,
headers=headers,
)
# Print result page to stdout
print(response.text)
# Save returned HTML to result.html file
with open('result.html', 'w') as f:
f.write(response.text)Using a 2-letter country code
To localize the result to a place outside the native country of the target marketplace, use a 2-letter country code. For example, if you are scraping the Amazon .com domain and want your results to be localized for Germany, add an "x-oxylabs-geo-location": "DE" header.
Exceptions
Not all Amazon marketplaces are created equal - there are a couple of exceptions to the rules mentioned above:
The
.cnand.com.trdomains don't support setting a custom delivery location - please don't send thex-oxylabs-geo-locationparameter with requests to these domains;The
.com.audomain doesn't support setting a delivery location outside Australia - please send an Australian postcode with requests to this domain;Instead of postcodes, the
.aedomain supports UAE city names asx-oxylabs-geo-locationparameter values, e.g.,"x-oxylabs-geo-location":"Abu Dhabi". Of course, you can use 2-letter country codes with this domain, too.
Google
As a geo-location value, you can use a few options: country, state, city or coordinates, and radius.
Using a country name
To get results localized for the geographical center point of a country, pass a country name. E.g., if you want to access a website content as if you are visiting it from Germany, add the "x-oxylabs-geo-location": "Germany" to your header.
Check the complete list of supported x-oxylabs-geo-location parameter values here.
Using a state name
To access a website from a particular state, pass an x-oxylabs-geo-location value in a "State,Country" format. It works with the United States, Australia, India, and other countries with federated states. Example: "x-oxylabs-geo-location": "California,United States".
Using a city name
If you want your results to be localized for a specific city, pass one of the values from the CSV found here in "City,State,Country" format. E.g., if you want to access a website content as if you are visiting it from New York, add the "x-oxylabs-geo-location": "New York,New York,United States".
Using coordinates and radius
To get hyperlocal search results (beneficial for searches such as “restaurants near me”), pass latitude, longitude, and radius values. The following example passes the coordinates of Space Needle in Seattle, WA: "x-oxylabs-geo-location": "lat: 47.6205, lng: -122.3493, rad: 25000".
Last updated
Was this helpful?

