Skip to main content
You can tune the request by providing geo parameters like an ISO ZIP code, subdivision, and country code, and by city.

Country, subdivision, city, zipcode

Geotargeting rules

  • country key must always persist if any of the geo parameters is specified. Otherwise, HTTP 400 is returned.
  • If more than one geo key is specified, the server finds an appropriate node strictly matching all the parameters. The only exception is zipcode: if specified, city key is ignored.
    • Details:
      • If both subdivision and zipcode are provided, the city is ignored.
      • If both zipcode and city are provided, the city is ignored.
      • If subdivision and city are provided, both are strictly matched.
Please, take into account, that due to technical reasons, the more strict geotargeting narrows the range of appropriate nodes.

Targeting multiple locations

Each of country, subdivision, city, and zipcode accepts a comma-separated list of up to 5 values. The request is then served by any node that matches one of the listed values, and traffic is spread across them.

Rules for multiple values

  • One list per request. Only one parameter may hold a list. Passing a list in two parameters at once (for example several countries and several cities) returns HTTP 400.
  • A list of countries can’t be narrowed. When country holds more than one value, subdivision, city, and zipcode may not be used, because the same region or city name can exist in more than one country. A single asn can still be combined with multiple countries.
  • country is still required whenever any geo parameter is set.
  • Up to 5 values per parameter. More than 5 returns HTTP 400.
  • Duplicate and empty values are ignored — US,US counts as a single value.

Examples

Multiple countries:
A single country, multiple cities:

Zipcode Notes

For the following countries, we accept partial postal codes with the number of characters indicated below:
  • United States: 5
  • Canada: 3
  • United Kingdom: 2-4
  • Brazil: 5
  • Ireland: 3
  • Japan: 7 (specified for the first 6. The last digit defaults to 1)
  • Netherlands: 4
  • Portugal: 7 (accurate for the first 4. The last 3 often default to -001)
  • Singapore: 2
Geotargeting by country and city is always more robust than by ZIP code.

Examples

Country

Country and city

Country and subdivision

Country and zipcode