Geo-location

If you want to specify from which location to access a particular website, add the x-oxylabs-geo-location header.

Available geo-location values and their logic differ depending on your chosen target website. Check out Amazon and Google geo-location options.

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'

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.

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: DE'

Exceptions

Not all Amazon marketplaces are created equal - there are a couple of exceptions to the rules mentioned above:

  • The .cn and .com.tr domains don't support setting a custom delivery location - please don't send the x-oxylabs-geo-location parameter with requests to these domains;

  • The .com.au domain doesn't support setting a delivery location outside Australia - please send an Australian postcode with requests to this domain;

  • Instead of postcodes, the .ae domain supports UAE city names as x-oxylabs-geo-location parameter 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.

curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://www.google.com/search?q=adidas' \
-H 'x-oxylabs-geo-location: Germany'

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".

curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://www.google.com/search?q=adidas' \
-H '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".

curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://www.google.com/search?q=adidas' \
-H '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".

curl -k -v -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://www.google.com/search?q=adidas' \
-H 'x-oxylabs-geo-location: lat: 47.6205, lng: -122.3493, rad: 25000'

Last updated