Skip to content

Proxy Geo-Targeting Quickstart: Country, State, City, and Carrier ASN Setup Without Geo-Mismatch Blocks ​

Getting an IP in the right country is easy. Getting a target website, ad network, or e-commerce checkout to believe your request genuinely originates from a local user in Los Angeles, London, or Tokyo is where most first-time proxy integrations stumble.

Developers and operators setting up geo-targeted workflows routinely run into these symptoms:

  • "I selected a US residential proxy, so why did Google or Amazon still serve results in my server's language or redirect me to a regional store?"
  • "My IP check shows New York, yet the target site flagged a location mismatch and popped a CAPTCHA or 403 block."
  • "I pinned a small city and suddenly started seeing intermittent timeouts or fallback to a neighboring metro."
  • "When should I use country-level rotating proxies versus city-pinned sticky sessions or a fixed Static ISP node?"

This quickstart breaks down how country, state/province, city, and carrier ASN geo-targeting works in practice, how to extract and test geo-pinned endpoints in minutes, and how to eliminate the hidden browser, DNS, and GeoIP database contradictions that give away proxied traffic.


1. Understanding the Four Levels of Proxy Geo-Targeting ​

Not every task needs city-level or carrier-level pinning. Tighter geographic filters shrink the available IP pool, so choosing the right granularity balances location accuracy, pool diversity, and throughput.

Targeting LevelHow It WorksBest-Fit WorkloadsRecommended JoyProxy Line
Country (region)Routes through any healthy node registered in a 2-letter ISO country (us, gb, de, jp, sg) across 200+ locationsBroad SERP crawling, AI RAG retrieval, nationwide catalog scraping, regional API accessRotating Residential Proxies (-zone-resi) or Web Scraping API
State / ProvinceNarrows exits to a specific state or province (such as California, Texas, or Bavaria)Regional tax/shipping verification, local classifieds, statewide ad checksRotating Residential Proxies via Endpoint Generator
City (city)Pins exits to a specific metro area (los_angeles, new_york, london, frankfurt, tokyo)Hyper-local SERP rankings, store-pickup inventory checks, localized ad verificationRotating Residential, Mobile, or Static ISP Proxies
Carrier ASNTargets a specific telecom or commercial ASN (e.g., AS7922 Comcast, AS7018 AT&T, or 4G/5G carriers)Carrier-sensitive portals, mobile-only promotions, strict B2B or payment risk checksStatic ISP Proxies, Mobile Proxies (-zone-cellular), or Business Proxies (-zone-biz)

Don't Over-Constrain When You Only Need Country Reach

If your crawler fetches 10,000 public product pages across the United States, pinning a single small city concentrates traffic on fewer residential peers and reduces concurrency. Use country-level targeting for scale, and reserve city + ASN targeting for workflows where metro location or carrier pedigree actually changes the page output.


2. How to Generate Geo-Targeted Endpoints in JoyProxy ​

JoyProxy separates Rotating Networks (billed per GB through a unified gateway) from Static Dedicated Networks (billed per IP with fixed city and ASN).

Option A: Rotating Residential, Mobile, and Business Proxies (gate.joyproxy.com:9001) ​

All rotating traffic enters through a single global gateway (gate.joyproxy.com:9001, supporting HTTP, HTTPS, and SOCKS5), while your location, network zone, and session rules are encoded directly in the generated username:

text
<subuser>-zone-<zone>-region-<country>-city-<city>-session-<id>-sessTime-<minutes>
  1. Sign in to the JoyProxy Console and open Endpoint Generator (or integrate programmatically via OpenAPI Center).
  2. Choose your network zone:
  3. Select Country, optional Province / State, City, and Carrier ASN in the web generator.
  4. Pick your rotation mode:
    • Rotate on every request: Omit session and sessTime for a fresh exit IP on each HTTP request.
    • Sticky session (1–1440 minutes): Keep the same city/ASN IP across multi-step workflows (up to 24 hours via the console slider, or longer by editing sesstime-<minutes>). If a residential peer goes offline mid-window, the gateway automatically fails over to another healthy peer in the same country, city, and ASN.

Always Copy the Full Generated Username

City names use lowercase with underscores (for example city-los_angeles, city-new_york), and truncating or mistyping any segment in the username causes the gateway to return 407 Proxy Authentication Required or fall back to a default pool. Generate your string in the console first, then reuse that exact format in code.

Option B: Static Dedicated ISP & Datacenter Nodes (isp.joyproxy.com / dc.joyproxy.com) ​

When an account login, payment portal, or long-lived browser profile requires 100% permanent city and ASN continuity for weeks or months:

  • Use ISP (Dedicated Static Residential) Proxies (isp.joyproxy.com:<dedicated_port>) in major hubs such as New York, Los Angeles, London, Tokyo, Singapore, or Mumbai—backed by Tier-1 telecom ASNs and gigabit uptime.
  • Use Dedicated Datacenter Proxies (dc.joyproxy.com:<dedicated_port>) in core hubs such as Chicago, Los Angeles, Amsterdam, or Bangalore when you need low-latency regional routing with unmetered bandwidth.

Option C: Zero-Setup Country Targeting via Web Scraping API ​

If you only need localized HTML or rendered JSON without managing proxy pools, headers, or anti-bot retries, pass the target country parameter directly to Web Scraping API (api.joyproxy.com) and let the API handle geo-routing and headless rendering automatically.


3. Verify Real Exit Country, City, ASN, and Latency Before Production ​

Never assume a proxy string routes where you expect without verifying it. Always test your generated endpoint against an IP intelligence endpoint first.

1. Instant cURL Verification (HTTP & SOCKS5 with Remote DNS) ​

bash
# HTTP proxy test targeting US / Los Angeles (replace credentials with your generated string)
curl -x "http://user1-zone-resi-region-us-city-los_angeles-session-geo01-sessTime-15:YOUR_PASS@gate.joyproxy.com:9001" \
  https://ipinfo.io/json

# SOCKS5 test using socks5h:// so DNS resolution happens remotely via the proxy
curl -x "socks5h://user1-zone-resi-region-us-city-los_angeles-session-geo01-sessTime-15:YOUR_PASS@gate.joyproxy.com:9001" \
  https://ipinfo.io/json

Confirm these fields in the JSON output before deploying:

  • "country": Matches your target ISO code (e.g., "US")
  • "region" and "city": Matches your pinned state/city
  • "org": Shows an authentic residential broadband or mobile carrier ASN (not a cloud hosting provider when using residential/ISP/mobile lines)

2. Python (httpx) Multi-Region Verification Script ​

python
import httpx

def verify_geo_endpoint(proxy_uri: str) -> dict:
    with httpx.Client(proxy=proxy_uri, http2=True, timeout=15.0) as client:
        resp = client.get("https://ipinfo.io/json")
        resp.raise_for_status()
        data = resp.json()
        return {
            "ip": data.get("ip"),
            "country": data.get("country"),
            "region": data.get("region"),
            "city": data.get("city"),
            "org": data.get("org"),
            "timezone": data.get("timezone"),
            "elapsed_ms": round(resp.elapsed.total_seconds() * 1000, 1),
        }

targets = [
    "http://user1-zone-resi-region-us-city-new_york-session-ny01-sessTime-10:YOUR_PASS@gate.joyproxy.com:9001",
    "http://user1-zone-resi-region-gb-city-london-session-ldn01-sessTime-10:YOUR_PASS@gate.joyproxy.com:9001",
    "http://user1-zone-resi-region-jp-city-tokyo-session-tyo01-sessTime-10:YOUR_PASS@gate.joyproxy.com:9001",
]

for uri in targets:
    print(verify_geo_endpoint(uri))

3. Node.js (undici / fetch) Geo-Aligned Request Template ​

javascript
import { ProxyAgent, fetch } from "undici";

const proxyUri =
  "http://user1-zone-resi-region-de-city-frankfurt-session-fra01-sessTime-10:YOUR_PASS@gate.joyproxy.com:9001";

const dispatcher = new ProxyAgent(proxyUri);

const res = await fetch("https://ipinfo.io/json", {
  dispatcher,
  headers: {
    "Accept-Language": "de-DE,de;q=0.9,en;q=0.8",
  },
});

console.log(await res.json());

4. The 5 Hidden Mistakes That Cause "Geo-Mismatch" Blocks ​

Even when ipinfo.io reports the right city, target sites cross-check multiple secondary signals against your exit IP. If any signal disagrees, anti-bot systems classify the session as spoofed.

text
  Exit IP Geo: Los Angeles, US (UTC-8 / UTC-7)
       │
       ├──► DNS Lookup via Local ISP in Singapore?   ──► Geo-Mismatch Flag!
       ├──► Accept-Language: zh-CN / en-SG?          ──► Geo-Mismatch Flag!
       ├──► Browser Timezone: Asia/Shanghai?         ──► Geo-Mismatch Flag!
       ├──► WebRTC / IPv6 Leaking Local Interface?   ──► Real Location Exposed!
       └──► Stale Cookie Carrying Prior Currency?    ──► Regional Redirect Loop!
  1. Local DNS Leaks (socks5:// vs socks5h://): Standard socks5:// resolves domain names on your local machine's ISP DNS before sending the IP through the tunnel. That exposes your real country to GeoDNS CDNs (Akamai, Cloudflare, Fastly), which may route you to the wrong regional edge POP. Always use socks5h:// or HTTP CONNECT proxies so DNS resolves remotely at the exit node.
  2. Mismatched Accept-Language and Locale Headers: Sending Accept-Language: en-US through a Tokyo (region-jp) or Munich (region-de) IP triggers localization overrides and raises suspicion scores. Maintain a strict header table per country code (ja-JP,ja;q=0.9,en;q=0.8 for Japan; en-GB,en;q=0.9 for the UK).
  3. Browser Timezone & Geolocation API Drift: In Playwright, Puppeteer, or antidetect browsers, your Intl.DateTimeFormat().resolvedOptions().timeZone and navigator.geolocation must match the proxy city (e.g., America/Los_Angeles for Los Angeles, Europe/London for London). Never mix a US East Coast browser profile with a US West Coast IP.
  4. IPv6 & WebRTC Bypass: If your host server has dual-stack IPv6 enabled while the proxy only tunnels IPv4, browsers or dual-stack HTTP clients may leak your native IPv6 address. Disable IPv6 fallback on workers or enforce WebRTC proxy-only policy in browser contexts.
  5. GeoIP Database Drift Between Vendors: MaxMind GeoLite2, IP2Location, and IPinfo occasionally disagree on boundary suburbs or newly reassigned ISP blocks. If a strict target uses a specific GeoIP database and rejects a boundary IP, generate a new sticky session-<id> or switch to a major metro hub (new_york, los_angeles, london, frankfurt, tokyo) where GeoIP databases have near-100% consensus.

5. Quick Geo-Alignment Reference Table ​

Target Country (region)Sample City (city)Recommended Accept-LanguageMatching IANA Timezone
United States (us)new_york / los_angelesen-US,en;q=0.9America/New_York / America/Los_Angeles
United Kingdom (gb)london / manchesteren-GB,en;q=0.9Europe/London
Germany (de)frankfurt / berlinde-DE,de;q=0.9,en;q=0.8Europe/Berlin
Japan (jp)tokyo / osakaja-JP,ja;q=0.9,en;q=0.8Asia/Tokyo
Singapore (sg)singaporeen-SG,en;q=0.9,zh-SG;q=0.8Asia/Singapore

6. Frequently Asked Questions (FAQ) ​

What happens if a pinned city has fewer online peers than expected? ​

City-level pools reflect real residential or mobile devices currently online in that metro area. If a smaller city hits low availability or higher latency, broaden the filter to state/province or country-level targeting—or switch to a Dedicated Static ISP Proxy in a tier-1 metro hub for guaranteed 24/7 availability.

Can I switch countries dynamically in code without re-extracting endpoints in the dashboard? ​

Yes. Once your sub-user credentials are created under Users & Whitelist, you can dynamically update -region-<country>, -city-<city>, -zone-<zone>, and -session-<id> directly in your proxy username string, or fetch formatted endpoint lists programmatically via the OpenAPI Center.

When should I use Mobile Proxies instead of Residential Proxies for geo-targeting? ​

Choose 4G/5G Mobile Proxies (-zone-cellular) when auditing mobile-only ad creatives, testing app-store or carrier-gated landing pages, or interacting with strict mobile-first social platforms where consumer home broadband ASNs still face elevated scrutiny.


Next Steps ​