Skip to content
Blog

Geo-Targeted Scraping: Localized Prices and Results by Country

Scrape localized prices and search results by country with residential proxies: country targeting, exit checks, Accept-Language, currency pitfalls, workers.

Exitway team··6 min read

To see a site the way a German or Japanese visitor sees it, add -country-de or -country-jp to your proxy username. Every connection then exits from a residential IP in that country. That covers the network side. The rest of this guide covers what the IP alone doesn’t: confirming you really are where you asked, sending locale headers that match, keeping each market’s cookies separate, and parsing prices that are formatted differently in every country.

Country targeting in one parameter

The country is an ISO 3166-1 alpha-2 code appended to the username:

Username Exit
USERNAME-country-us United States
USERNAME-country-gb United Kingdom (gb, not uk)
USERNAME-country-de-session-shop1-lifetime-30 Germany, same IP for 30 minutes

Exitway residential (gw.exitway.net:7777) covers 195+ countries, and every location is tested daily through the network. The datacenter product (:8888) covers a handful of major countries. Both lists are on the locations page.

An unknown code is rejected instead of being ignored. -country-uk returns 400 invalid_parameters with unsupported value for "country", so an invalid code fails loudly instead of quietly handing you an IP from somewhere else and corrupting a dataset.

Verify the exit country once per worker

Trust, but check once. https://ipinfo.io/json returns the IP’s country as an uppercase ISO code, along with a timezone you can reuse for browser contexts. Do it at worker start-up, not on every request: it costs bandwidth, and ipinfo.io limits unauthenticated requests.

Two caveats:

  • Geolocation databases occasionally disagree about an IP. If ipinfo.io says DE but a target shows Austrian prices, the target is using its own database or other signals (account settings, cookies, URL).
  • With rotating sessions, the verification request and the page requests use different IPs from the same country. If you need the checked IP to be the one that fetches, add a -session- parameter.

Make the rest of the request local too

Sites decide what to show from several signals, and a mismatch can get you the wrong variant or a redirect:

Market Accept-Language Currency Time zone (browsers)
us en-US,en;q=0.9 USD America/New_York
gb en-GB,en;q=0.9 GBP Europe/London
de de-DE,de;q=0.9,en;q=0.5 EUR Europe/Berlin
fr fr-FR,fr;q=0.9,en;q=0.5 EUR Europe/Paris
jp ja-JP,ja;q=0.9,en;q=0.5 JPY Asia/Tokyo
br pt-BR,pt;q=0.9,en;q=0.5 BRL America/Sao_Paulo

Search pages are the most sensitive to all of this. Rankings on search engines and marketplace search pages depend on the IP’s country, the language and, often, explicit region or language parameters in the URL. When you collect localized results, store the query, the exit country, the Accept-Language you sent and the final URL with every result set. Otherwise two snapshots that differ for dull reasons look like a ranking change.

For HTTP clients, Accept-Language is the header that matters. In Playwright, set locale and timezone_id on the browser context as well; the Playwright and Puppeteer guide shows a context with a sticky proxy, locale and time zone together. To go further, Camoufox can derive locale, time zone and geolocation from the proxy’s exit IP automatically.

Parallel workers, one per market

One async client per country gives each market its own proxy username, connection pool and cookie jar. Markets run in parallel, and requests within a market are capped by a semaphore:

import asyncio
import os

import httpx

USER, PASS = os.environ["EXITWAY_USER"], os.environ["EXITWAY_PASS"]

MARKETS = {  # Exitway country code -> Accept-Language
    "us": "en-US,en;q=0.9",
    "gb": "en-GB,en;q=0.9",
    "de": "de-DE,de;q=0.9,en;q=0.5",
    "fr": "fr-FR,fr;q=0.9,en;q=0.5",
    "jp": "ja-JP,ja;q=0.9,en;q=0.5",
    "br": "pt-BR,pt;q=0.9,en;q=0.5",
}
URLS = ["https://www.example.com/"]


class OutOfBandwidth(Exception):
    pass


async def market_worker(country, urls, concurrency=3):
    proxy = f"http://{USER}-country-{country}:{PASS}@gw.exitway.net:7777"
    async with httpx.AsyncClient(
        proxy=proxy,
        headers={"Accept-Language": MARKETS[country]},
        timeout=httpx.Timeout(30.0, connect=10.0),
        follow_redirects=True,
    ) as client:  # one client = one cookie jar per market
        try:
            exit_country = (await client.get("https://ipinfo.io/json")).json()["country"].lower()
        except httpx.ProxyError as exc:
            if str(exc).startswith("402"):
                raise OutOfBandwidth() from None
            return country, f"proxy error: {exc}"
        if exit_country != country:
            return country, f"exit is {exit_country}, wanted {country}: skipped"

        sem = asyncio.Semaphore(concurrency)

        async def get(url):
            async with sem:
                r = await client.get(url)
                return url, r.status_code, r.headers.get("content-language")

        return country, await asyncio.gather(*(get(u) for u in urls))


async def main():
    try:
        results = await asyncio.gather(*(market_worker(c, URLS) for c in MARKETS))
    except OutOfBandwidth:
        raise SystemExit("Residential bandwidth used up: top up and rerun.")
    for country, result in results:
        print(country, result)


asyncio.run(main())

Design notes:

  • Out of bandwidth stops everything. A 402 raises an exception that ends the whole gather, rather than producing six identical error rows. With wrong credentials, each market reports 407 Proxy Authentication Required instead.
  • Redirects are followed and should be recorded. Many sites send visitors to a country domain or path (/de-de/). Store r.url alongside the price so you know which storefront you actually parsed.
  • Content-Language is a cheap sanity check. It tells you which language variant the server thinks it sent you.
  • Size concurrency as a total. Six markets with 3 in-flight requests each is 18 concurrent connections. Concurrency multiplies across markets, and so does the load on a target that serves all of them.

Currency and locale pitfalls

Getting the right page is half the job. Reading the numbers on it is where localized datasets usually go wrong.

The same string is two different numbers

1.299 is one thousand two hundred ninety-nine in Germany and one point two nine nine in the US. Never parse prices with float() and a regex. Parse with the market’s locale, for example with Babel:

from babel.numbers import get_currency_precision, parse_decimal

print(parse_decimal("1.299", locale="de_DE"))     # 1299
print(parse_decimal("1.299", locale="en_US"))     # 1.299
print(parse_decimal("1.299,00", locale="de_DE"))  # 1299.00
print(parse_decimal("1 299,00", locale="fr_FR"))  # 1299.00 (narrow no-break space)
print(get_currency_precision("JPY"), get_currency_precision("EUR"))  # 0 2

parse_decimal returns a Decimal, which is what money should be stored as.

Formats differ in ways regexes miss

  • French formatting uses a narrow no-break space (U+202F) as the thousands separator and puts the currency after the number: 1 299,00 €.
  • The yen has no minor unit, so Japanese prices are written without decimals, and the ja_JP locale writes the symbol as the full-width ¥, not ¥.
  • Symbols are ambiguous: $ is used for USD, CAD, AUD and MXN; kr covers SEK, NOK and DKK; ¥ covers JPY and CNY. Store ISO 4217 codes (USD, SEK), never symbols.
  • Prefer structured data when it exists. Product pages often embed schema.org JSON-LD with price and priceCurrency, which avoids locale parsing entirely.

Compare like with like

  • European consumer prices usually include VAT. US prices usually exclude sales tax. Normalize before you compare markets.
  • Sites remember a chosen region in a cookie. If you reuse one cookie jar across markets, the second market may get the first market’s prices. That is why the worker above creates one client per country.
  • Shipping-destination selectors, logged-in account settings and URL parameters can all override IP geolocation. Fix them explicitly per market, or record them with each data point.

Scraping responsibly across markets

Stick to publicly available pages, respect each site’s terms, robots.txt and rate limits, and keep per-market concurrency modest. Localized crawls multiply your request volume by the number of markets, and that is easy to forget. Our Acceptable Use Policy covers what the network may be used for. On our side, Exitway keeps no traffic logs: no destinations, URLs or content, only hourly byte totals per account for billing.

For the client-level details (timeouts, retries, keep-alive and rotation), see rotating residential proxies in Python.

Exitway residential proxies cover 195+ countries from $0.70/GB, pay as you go, with bandwidth that never expires. Browse the locations, check pricing, or create an account.

More guides