How to Target a Country with Rotating Proxies

You target a country by adding a country code option to your proxy username. This guide explains the exact syntax for all four proxy networks and how to verify the location.

Key points
  • Add `cc.us` or `cc.de` to your username to lock exits to that country.
  • Residential and mobile proxies also support US state and city targeting.
  • Use our Proxy Setup tool to build the correct username string automatically.
  • Verify the exit IP location with an IP check tool or our dashboard.

How to Target a Country with Rotating Proxies

You target a country by adding a country code option to your proxy username when authenticating with the gateway. The option uses the format cc.XX, where XX is the lowercase two-letter ISO country code, such as cc.us for the United States or cc.de for Germany. This method works for all four rotating proxy networks: residential, mobile, datacenter, and ISP. When you include this option, the gateway will only assign you exit IP addresses geolocated to the specified country, which is essential for tasks like proxies for price monitoring or proxies for checking geo-restricted content.

Country Targeting Syntax and Username Examples

The country code is appended to your proxy user's login, separated by underscores. The full grammar for the username is: LOGIN_net.NETWORK_cc.COUNTRYCODE_other.options. The net.NETWORK part specifies which proxy pool to use (net.res, net.mob, net.dc, or net.isp). If you omit the network, it defaults to residential (net.res). Here are concrete examples of how to target a country:

  • United States (Residential): USERNAME_net.res_cc.us
  • Germany (Mobile): USERNAME_net.mob_cc.de
  • United Kingdom (Datacenter): USERNAME_net.dc_cc.gb
  • Japan (ISP): USERNAME_net.isp_cc.jp

You can combine the country code with other options like a session id for a sticky IP. For example, USERNAME_net.res_cc.fr_sid.abc123 will give you a French residential IP that sticks for the default session time. Remember to use the correct gateway host (gw.rotatingproxy.cc) and port (7070 for HTTP/HTTPS, 7071 for SOCKS5) with your proxy user's password.

Using the Dashboard Proxy Setup Tool

The easiest way to build a correct country-targeted proxy string is using the Proxy Setup section in your dashboard. This tool provides a visual interface to select your target network, choose a country from a dropdown list, and add other options like sessions. It then generates the exact username string and provides ready-to-use cURL, Python, and other code snippets. This eliminates syntax errors and is the recommended method for beginners or when setting up complex targeting for proxies for social media management. The tool also lets you export a list of proxy endpoints for use in your software.

Which Networks Support Country Targeting?

All four proxy networks support country-level targeting, but their granularity and coverage differ. Rotating residential proxies cover 177 countries and also allow you to target specific US states and cities. Rotating mobile proxies cover 87 countries and also support US state and city targeting. Both datacenter and ISP proxies support country targeting for 16 and 12 countries respectively, but do not offer state or city-level precision. Your choice of network depends on your needs; for example, Google Maps proxies often benefit from residential IPs, while proxies for website performance testing by region might use faster ISP proxies.

How to Verify Your Proxy's Country Location

After configuring your proxy, you must verify that your traffic is exiting from the intended country. The simplest method is to use an IP geolocation check service through the proxy. You can run a cURL command like curl --proxy http://USERNAME_net.res_cc.ca:PASSWORD@gw.rotatingproxy.cc:7070 https://ipinfo.io/country which should return "CA". Many public sites like ipinfo.io, ipleak.net, or whatismyipaddress.com can confirm the country. Additionally, your dashboard's Usage section shows the country code for each connection made. Regular verification is a best practice, especially when conducting proxies for market research across multiple regions.

Common Issues with Country Targeting

If your proxy connections are not originating from the targeted country, first double-check the username syntax for typos in the country code. Ensure you are using the correct proxy user that is permitted to use the chosen network (e.g., a user restricted to mobile cannot use net.dc). Another possibility is that the target website uses its own geolocation methods beyond IP address, such as browser language or GPS data in mobile apps. Also, remember that IP geolocation databases are not 100% accurate; an IP assigned to a country might occasionally be mapped to a neighboring region by some services. For persistent issues, consult our guide on target site returns 403.

Combining Country with State, City, and Session Targeting

For residential and mobile proxies targeting the US, you can add further precision. After cc.us, you can specify a state using st.STATECODE (e.g., st.ca for California) and a city using city.CITY-TOKEN (e.g., city.los-angeles). You can also combine this with a sticky session using sid.idk3m9 and ttl.MINUTES to maintain the same IP from that location. A full example for a sticky mobile IP in Chicago would be: USERNAME_net.mob_cc.us_city.chicago_sid.myidk3_ttl.30. This level of control is powerful for applications like proxies for localization testing or Craigslist proxies. Learn more about these options in our guides on how to target a US state and how to target a city.

Questions

Is it possible to target several countries simultaneously?

No, the username grammar allows only one country code per connection. To rotate across multiple countries, you would need to use different proxy endpoint strings in your application, cycling through them programmatically.

What occurs if I leave out the country code?

If you omit the <code>cc.XX</code> option, the gateway will assign you an exit IP from any available country within the chosen network. This is useful for global crawling where location is not important.

Is country targeting available for SOCKS5 connections?

Yes, country targeting works identically on both the HTTP/HTTPS port (7070) and the SOCKS5 port (7071). You use the same username grammar with the <code>cc.XX</code> option.

How do I find the correct country code to use?

Use the ISO 3166-1 alpha-2 country codes in lowercase. Our dashboard's Proxy Setup tool and the Locations page provide a selectable list of all supported countries and their codes.

Can I change the target country without creating a new proxy user?

Absolutely. You change the target country by modifying the username string, not the proxy user itself. Use the same proxy user login and password, but alter the <code>cc.XX</code> option in the username you send to the gateway.

Why does my IP occasionally display a city other than the one I targeted, but still within the country?

This is normal. The geolocation of residential and mobile IPs is tied to the ISP's infrastructure, which may register an IP block to a major city in a region. The guarantee is at the country level (and US state if specified). City targeting provides a best-effort match within that state.

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.