All posts
Guides3 min readOct 11, 2026

Geo-targeting with proxies: country, state and city

How to pick the exact location your requests come from with crawlproxies, from a country down to a US state or a single city, plus which products support what and how to check you landed in the right place.

By crawlproxies

Prices, search results, ads and even whole websites change with the visitor's location. Geo-targeting lets you see the web the way someone in Munich, Texas or São Paulo sees it. On crawlproxies it's part of your username, so you can switch location per request without changing anything else.

The Residential network covers 233 countries and territories and more than 10,900 cities. Browse them on the Locations page.

The three levels

Append location options to your username, from broad to narrow:

LevelOptionExample
Country-country-<code>USERNAME-country-de
US state-state-<name>USERNAME-country-us-state-texas
City-city-<name>USERNAME-country-us-city-chicago

The rules:

  • Countries use two-letter ISO codes in lowercase: us, gb, de, br, jp.
  • States and cities are lowercase with spaces and punctuation removed: newyork, northcarolina, losangeles, london.
  • Order matters: country first, then state, then city. A state or city always goes after a country.
  • No location at all (USERNAME) means worldwide rotation.

Combine location with a sticky session when you need both:

text
USERNAME-country-us-state-california-session-job7-time-1800

Try it

bash
curl -x http://USERNAME-country-jp:PASSWORD@geo.crawlproxies.com:8080 https://ipinfo.io/json

ipinfo.io answers with the IP's country, region and city, so you can confirm you landed where you asked. Geolocation databases occasionally disagree with each other by a city or two, especially near borders and for mobile IPs, so treat city-level results as "in or near".

What each product supports

Not every proxy type can be targeted the same way. Here's what each one accepts:

ProductCountryUS stateCity
ResidentialYesYesYes
Residential BudgetNoNoNo
Mobile (4G/5G)YesYesYes
Premium Unlimited ResidentialYesNoYes
Datacenter, Shared ISP, ISP EuropeYesNoNo
IPv6 Residential, IPv6 DatacenterYesNoNo
Unlimited ResidentialYesNoNo
Mobile USAUS onlyNoNo
Dedicated ISPFixed per IPNoNo

The generator lists exactly the locations your plan supports, so it's the quickest way to see your options and get the spelling right.

Choosing how narrow to go

Narrower targeting means a smaller pool of IPs to rotate through. That's usually fine, but it has trade-offs:

  • Country is right for most jobs: localized prices, search results, content and ads.
  • State matters for anything regulated or priced by state in the US: insurance, sports, local retail, tax-inclusive prices.
  • City is for genuinely local results: maps, delivery, local search, store availability.

If a very specific city is slow or keeps failing, step out one level (to the state or country) and see whether the content still matches what you need. Often it does.

Code examples

Python, building the username from parts:

python
def geo_proxy(country=None, state=None, city=None):
    user = "USERNAME"
    if country:
        user += f"-country-{country}"
        if state:
            user += f"-state-{state}"
        if city:
            user += f"-city-{city}"
    return f"http://{user}:PASSWORD@geo.crawlproxies.com:8080"

import requests
for cc in ("us", "de", "jp"):
    p = geo_proxy(cc)
    data = requests.get("https://ipinfo.io/json", proxies={"http": p, "https": p}, timeout=30).json()
    print(cc, "->", data["country"], data.get("city"))

The same helper in JavaScript:

js
const geoUser = ({ country, state, city } = {}) =>
  ["USERNAME",
   country && `country-${country}`,
   country && state && `state-${state}`,
   country && city && `city-${city}`,
  ].filter(Boolean).join("-");

geoUser({ country: "us", state: "texas", city: "austin" });
// "USERNAME-country-us-state-texas-city-austin"

Common mistakes

  • Spaces in names. -city-new york breaks the username. Write -city-newyork.
  • State without a country. Always put -country-us in front of a state.
  • Expecting one fixed IP. Location targeting picks where the IP is; it still rotates unless you add a session. See sticky vs rotating sessions.
  • Testing with one request. Sample a few IPs before deciding a location doesn't work.

New to crawlproxies? Start with your first proxy request.

Written by
crawlproxies
Create account