Country and city targeting
Targeting is a suffix on the login. Country is reliable, city depends on which devices are online at that moment.
Syntax
Country codes are ISO 3166-1 alpha-2 in upper case. City names use hyphens instead of spaces and keep their normal capitalisation.
Suffixes stack in a fixed order: country, then city, then session, then lifetime. A city without a country is not valid.
Country and city
login_c_DE Germany
login_c_DE_city_Berlin Berlin
login_c_US_city_New-York New York
login_c_ES_city_Madrid_s_4_ttl_15mCoverage
Residential covers 220+ countries. City targeting works in the larger markets, and cities our customers run through today include New York, Brooklyn, Los Angeles, San Francisco, Miami, Seattle, Philadelphia, Charlotte, London, Paris, Madrid, Berlin, Dortmund, Zurich, Dubai and Singapore.
Static products are narrower because the stock is physical: 41 countries for datacenter IPv4, 24 for ISP, 17 for IPv6 and 26 for mobile with carrier choice inside each.
When a location returns nothing
A 400 with an unknown country or city message means the pool for that location is empty at that moment rather than that the location is unsupported. Availability moves with the devices online.
The right response is to fall back to country level, record that you did so, and retry the city later. Retrying the same city in a tight loop wastes traffic and changes nothing.
Fallback in practice
try:
r = fetch(url, proxy=proxy(country="US", city="New-York"))
except GeoUnavailable:
r = fetch(url, proxy=proxy(country="US"))
mark_sample_as_country_level()Making geography believable
The address is one signal of location and rarely the only one a site reads. Language headers, timezone and account history all contribute, and a contradiction between them is more visible than any single wrong value.
For scraping, sending a matching Accept-Language is usually enough. For anything running in a browser profile, the timezone and locale of the profile have to agree with the proxy country as well.
Signals that have to agree
Proxy login_c_ES
Header Accept-Language: es-ES,es;q=0.9
Locale es-ES
Timezone Europe/Madrid
# A Spanish address asking for pages in English returns a blend
# that represents neither market.