Skip to main content
Get a list of available cities in a country

Use the Proxyrack API to retrieve a list of available cities for geo-targeting

K
Written by Katy
Updated over a month ago

Video guide here.

You can use the Proxyrack API to retrieve a list of the available cities in a specific country to geo-target for any service. In order to do this, you will need to make a request through your proxies to "api.proxyrack.net/v1-beta/countries/{2-letter country code}/cities".

You can also see the number of IPs available in each city. In order to see the proxy count for each city in the API response, you will need to make a request through your proxies to "api.proxyrack.net/v1-beta/countries/{2-letter country code}/cities?includeCount=true".

Additionally, you can specify the geolocation database you would like to use by making a request to the following API endpoint: "api.proxyrack.net/v1-beta/countries/{2-letter country code}/cities?includeCount=true&geoDb={database name}". For example, to use ipinfo.io as your geolocation database, the API endpoint would be "http://api.proxyrack.net/v1-beta/countries/{2-letter country code}/cities?includeCount=true&geoDb=ipinfo".

Make sure to substitute "{2-letter country code}" in each of these URLs for the country that you are wanting the list for. Here is a list of every country's 2-letter country code.

Please note that cURL is used below as an example. You do not need to use cURL in order to make a request to this API endpoint. You can do this wherever you have configured your proxies, such as in a browser, code, etc.

Examples

Unmetered Residential:

Please note: Unmetered Residential proxies are no longer available for purchase. Existing subscriptions will continue to work, however.
curl -x unmetered.residential.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

curl -x unmetered.residential.proxyrack.net:10000 -U username:password "api.proxyrack.net/v1-beta/countries/US/cities?includeCount=true"

Premium Residential:
curl -x premium.residential.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

curl -x premium.residential.proxyrack.net:10000 -U username:password "api.proxyrack.net/v1-beta/countries?/US/cities?includeCount=true"

Private Unmetered Residential:
curl -x private.residential.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

curl -x private.residential.proxyrack.net:10000 -U username:password "api.proxyrack.net/v1-beta/countries/US/cities?includeCount=true"

USA Rotating Datacenter:
curl -x usa.rotating.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

curl -x usa.rotating.proxyrack.net:10000 -U username:password "api.proxyrack.net/v1-beta/countries/US/cities?includeCount=true"

Global Rotating Datacenter:
curl -x global.rotating.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

curl -x global.rotating.proxyrack.net:10000 -U username:password "api.proxyrack.net/v1-beta/countries/US/cities?includeCount=true"

Static USA Datacenter:
curl -x usa.static.proxyrack.net:10000 -U username:password api.proxyrack.net/v1-beta/countries/US/cities

Result:

{
"Boston": {},
"Cheyenne": {},
"Hockessin": {},
"Huntington": {},
"Los Angeles": {},
"New York": {},
"Piscataway": {},
"Seattle": {}
}

Result (with "?includeCount=true"):

{
"Boston": {
"proxyCount": 502
},
"Cheyenne": {
"proxyCount": 254
},
"Hockessin": {
"proxyCount": 2032
},
"Huntington": {
"proxyCount": 252
},
"Los Angeles": {
"proxyCount": 254
},
"New York": {
"proxyCount": 2024
},
"Piscataway": {
"proxyCount": 507
},
"Seattle": {
"proxyCount": 251
}
}
Did this answer your question?