The data is cached and refreshed daily, so these calls are fast and you can make them as often as you like. They use the same authentication as every other reseller endpoint.
Everything at Once
GET /reseller/targeting
- Node.js
- Python
- cURL
Node.js
Response
Response
The response is large because it has every city in every country. Fetch it once and cache it instead of calling it for every request.
Countries Only
GET /reseller/targeting/countries
Only the country codes and names. A quick call for a country picker.
- Node.js
- Python
- cURL
Node.js
Response
Response
One Country
GET /reseller/targeting/countries/:code
The states, cities and ASNs for one country. Use it to load the next level of a picker when it is needed.
- Node.js
- Python
- cURL
Node.js
Path Parameters
Returns one country in the same format as the items in
countries[] above.
Errors
Unknown country (404)
Unknown country (404)
No country matches that code. Get the list of valid codes from
GET /reseller/targeting/countries.Export to CSV
If you prefer a flat file, thisjq command turns the full list into one row per city:
cURL
Limits
- Availability: a city on the list doesn’t always have IPs available. A very narrow target can have none at a given moment, which your customers see as
PX1002(see Error Handling). They can addfallback-true, or remove the city and then the state. - Freshness: the list is refreshed once a day.
Related
Proxy Access
Where these values go in a sub-user’s username.
Geo-Targeting
How country, state and city targeting works.