Skip to content
Back to Blog

Guides

Geo-Targeting with Residential Proxies: Access Any Location

ZentisLabs Team10 min read

Geo-targeting lets you route your traffic through proxy IPs in specific countries, states, or cities. This is critical for accessing localized content, verifying geo-restricted ads, scraping region-specific search results, and testing how your own website appears in different markets.

How Geo-Targeting Works

When you connect to a residential proxy pool, the provider assigns you an IP from their network. With geo-targeting, you specify where that IP should be located. ZentisLabs supports three levels of precision:

  • Country-level: Route through any IP in a specific country (195+ countries)
  • State/Region-level: Target a specific state or region (US, BR, DE, etc.) on Light & Basic
  • City-level: Pin to a specific city within its state on Light & Basic

Configuration Syntax

ZentisLabs Residential Light and Basic use password-based geo-targeting. Append targeting parameters to your proxy password:

python
import requests
# Country targeting (Germany)
proxy = "http://USER:PASS_country-de@basic.resi.zentislabs.com:12321"
# State targeting (California, US)
proxy = "http://USER:PASS_country-us_state-california@basic.resi.zentislabs.com:12321"
# City targeting (London, UK): the city follows its state
proxy = "http://USER:PASS_country-gb_state-england-city-london@basic.resi.zentislabs.com:12321"
proxies = {"http": proxy, "https": proxy}
r = requests.get("https://httpbin.org/ip", proxies=proxies)
print(r.json())

Use Cases

1. Localized SEO Monitoring

Google shows different search results based on the searcher's location. A bakery in Chicago needs to know how they rank for "best bakery near me" from a Chicago IP, not from your office in a different state.

2. Ad Verification

Advertisers use geo-targeted proxies to verify that their ads appear correctly in different markets. Check that your Facebook ads in Japan show the right creative, landing page, and pricing.

3. Price Comparison

Many e-commerce sites show different prices based on location. Airlines, hotels, and SaaS products frequently use geo-based pricing. Proxies let you see the real price from any location.

4. Content Access

Access geo-restricted content for market research, compliance testing, or content verification. Check that your streaming platform's content library is correct in each licensed region.

Multi-Location Scraping Example

python
import requests
import json
locations = [
{"country": "us", "state": "newyork", "city": "newyork", "label": "New York"},
{"country": "gb", "state": "england", "city": "london", "label": "London"},
{"country": "de", "state": "berlin", "city": "berlin", "label": "Berlin"},
{"country": "jp", "state": "tokyo", "city": "tokyo", "label": "Tokyo"},
{"country": "br", "state": "saopaulo", "city": "saopaulo", "label": "São Paulo"},
]
results = []
for loc in locations:
proxy_pass = f"PASS_country-{loc['country']}"
if loc.get("state"):
proxy_pass += f"_state-{loc['state']}"
if loc.get("city"):
proxy_pass += f"-city-{loc['city']}"
proxy = f"http://USER:{proxy_pass}@basic.resi.zentislabs.com:12321"
proxies = {"http": proxy, "https": proxy}
r = requests.get("https://ipinfo.io/json", proxies=proxies, timeout=10)
info = r.json()
results.append({
"target": loc["label"],
"actual_ip": info.get("ip"),
"actual_city": info.get("city"),
"actual_country": info.get("country"),
})
print(f"{loc['label']}: {info.get('city')}, {info.get('country')}")
print(json.dumps(results, indent=2))

Sticky Sessions with Geo-Targeting

Combine geo-targeting with sticky sessions to maintain the same IP across multiple requests. Generate the sticky line in the dashboard or API and use it exactly as generated - it's pinned to one gateway node:

python
# Same London IP for 10 minutes (a generated sticky line; NODE_IP is its pinned gateway node)
proxy = "http://USER:PASS_country-gb_state-england-city-london_session-order123_lifetime-10m@NODE_IP:12321"
session = requests.Session()
session.proxies = {"http": proxy, "https": proxy}
# All requests use the same London IP
for page in range(1, 6):
r = session.get(f"https://example.co.uk/products?page={page}")
print(f"Page {page}: {r.status_code}")

Tips for Best Results

  • Use the broadest targeting that works: Country-level has more IPs available than city-level. Only narrow down if you need it.
  • Match your User-Agent locale: If you're using a German IP, set your Accept-Language header to de-DE.
  • Verify with IP lookup: Use our IP Lookup tool to confirm your proxy IP is in the expected location.
  • Smaller cities = fewer IPs: If a city doesn't have enough IPs, widen to state or country level.

ZentisLabs supports geo-targeting in 195+ countries, down to state and city on Light & Basic, with non-expiring bandwidth. Target any location straight from your proxy password.

Ready to get started?

Try ZentisLabs free - 100MB residential bandwidth included.