How to Target a City with Rotating Proxies
You can target a city by adding a city token to your proxy username, like `city.chicago`. City targeting is available for rotating residential and mobile proxy networks in supported locations.
- Add `city.token` to your proxy username after the login.
- City targeting works with residential and mobile networks.
- Find the exact token for your city in the dashboard.
- Combine with country and US state targeting for precision.
How to Target a City with Rotating Proxies
You target a city by adding a city option to your proxy username, formatted as city.token where "token" is a lowercase identifier for that city. This method works for both rotating residential and mobile proxy networks, giving you IP addresses that appear to originate from that specific urban area. For example, to get IPs from Los Angeles, you would use a username like USERNAME_net.res_cc.us_city.los-angeles. This is essential for tasks like checking localized search results, monitoring regional prices, or localization testing.
Where to Find the City Token
The exact city token is listed in the "Proxy setup" section of your dashboard. After logging in, navigate to the "Proxy setup" page where you'll find a string builder tool and a full list of available locations. The city list is organized by country and, for the US, by state. Tokens are lowercase, with spaces replaced by hyphens (e.g., new-york, mexico-city). You cannot invent your own token; you must use one from the published list. If your desired city is not listed, you can target the country or, for the US, the state instead, as explained in our guide on what if my city is not listed.
Step-by-Step Setup in the Dashboard
The easiest way to build a city-targeted proxy string is using the dashboard's "Proxy setup" page. First, select your desired network (Residential or Mobile). Then, choose the target country from the dropdown. If you selected the United States, a second dropdown for states will appear. After selecting a state, a third dropdown for cities in that state will populate. Select your city, and the dashboard will generate the complete proxy username with the correct city.token included. You can then copy the full proxy endpoint (host, port, username, password) for use in your software. This tool eliminates guesswork and ensures your syntax is correct.
Username Syntax for City Targeting
The proxy username follows a specific grammar where options are joined by underscores. The city option is placed after the network and country options. A full example for a mobile proxy in Berlin, Germany is: USERNAME_net.mob_cc.de_city.berlin. For a residential proxy in Houston, Texas, USA, you would write: USERNAME_net.res_cc.us_st.tx_city.houston. The order of options does not matter, but they must all be connected by underscores. The password remains your proxy user's standard password. For a complete reference on all options, see the username options documentation.
Combining City with Sticky Sessions
To maintain the same IP address from your targeted city across multiple connections, combine the city option with a session ID (sid) and a time-to-live (ttl). For instance, USERNAME_net.res_cc.us_city.seattle_sid.abc123_ttl.30 will give you an IP from Seattle and attempt to keep that same IP for 30 minutes. This is invaluable for workflows that require a consistent location, such as maintaining a logged-in state on a local news site or conducting multi-step UX research from a specific area. Learn more about managing these sessions in our guide on how to keep the same IP.
Which Networks Support City Targeting?
City-level targeting is exclusively available for our rotating residential and rotating mobile proxy networks. Our rotating datacenter and rotating ISP proxy networks only support country-level targeting. If your use case requires IPs from home or cellular connections in a specific city, choose residential or mobile. For example, Craigslist proxies often benefit from residential IPs in the correct city. If your task only needs a fast server IP from a country, datacenter or ISP proxies may be more cost-effective, as detailed in choosing proxy locations.
Common Use Cases for City-Level Proxies
Targeting a city is crucial for many data collection and testing scenarios. It allows you to view location-specific content, prices, and search rankings as a local user would see them. Common applications include price monitoring for retail chains that vary prices by region, rank tracking for local SEO keywords, and real estate data collection from platforms like Zillow. It's also used for checking geo-restricted content like local streaming catalogs, verifying targeted ads, and gathering hyper-local news or event data.
Testing and Integration Examples
Once you have your city-targeted proxy string, integrating it is straightforward. For HTTP tools like curl, you would use: curl -x http://USERNAME_net.mob_cc.gb_city.london:PASSWORD@gw.rotatingproxy.cc:7070 https://example.com. When using Python's requests library, set up the proxies dictionary. Detailed code samples for this and other libraries like playwright or selenium are available in our Python requests proxy and Playwright Python proxy integration guides. Always test your connection first using an IP check service to confirm the exit location matches your targeted city.
Questions
Can I target a city with datacenter proxies?
No, city targeting is only available for rotating residential and mobile proxy networks. Datacenter and ISP proxies can only be targeted by country.
What occurs if I use a city token that is not on the list?
The proxy gateway will reject the connection with an authentication error. You must use a valid city token from the dashboard's location list.
How precise is the city location for the IP addresses?
IP geolocation databases provide city-level accuracy, but it is not perfect. The IP will be registered in or near the targeted city, but precise neighborhood or ZIP code accuracy is not guaranteed.
Can I target multiple cities at once?
Not within a single proxy username. Each connection uses one city token. To rotate through multiple cities, you would need to programmatically switch between different proxy strings, each with a different city target.
Does city targeting cost more than country targeting?
No, the billing rate is the same per GB for the network you are using. You pay $1.79 per GB for residential and $3.00 per GB for mobile, regardless of the city you choose.
Start with one top-up, use any network
Create an account in a minute, add $40 or more, and the same balance pays for residential, mobile, datacenter and ISP traffic.