Locations
DocsLocations

Locations discovery

Look up available countries, states, cities, ZIP codes, and ASNs per pool type, so you can build geo filters from real data instead of guessing codes.

All location endpoints accept a required pool_type query parameter and return arrays of {code, name, count}. Use the code values directly with /packages/{id}/proxies (countries=us,gb) and /packages/{id}/default-geo. Results are cached for 1 hour at the API layer plus longer caches upstream — listings reflect the provider catalog within minutes.

GET /locations/countries

Returns countries available for the requested pool. No filter required.

GET/api/v1/locations/countries?pool_type=residential
response.json
{
  "data": {
    "pool_type": "residential",
    "type":      "countries",
    "filters":   {},
    "count":     2,
    "items": [
      { "code": "us", "name": "United States", "count": 42398721 },
      { "code": "gb", "name": "United Kingdom", "count":  8123094 }
    ]
  },
  "meta": { "version": "v1" }
}

GET /locations/states

Returns states within the given countries.

GET/api/v1/locations/states?pool_type=residential&countries=us

GET /locations/cities

Returns cities within the given countries (optionally narrowed by states).

GET/api/v1/locations/cities?pool_type=residential&countries=us&states=california

GET /locations/zipcodes

Returns ZIP codes within the given countries (optionally narrowed by states).

GET/api/v1/locations/zipcodes?pool_type=residential&countries=us

GET /locations/asns

Returns ASNs within the given countries (optionally narrowed by states or cities).

GET/api/v1/locations/asns?pool_type=residential&countries=us

Code format

Countries are 2-letter lowercase ISO codes (us, gb, de). States and cities are full names, lowercase, no spaces — e.g. california, newyork, sanfrancisco. ZIP codes are numeric strings. ASNs are numeric, without an AS prefix.

Code examples

locations.sh
# Pick top 5 US cities by available pool size, then narrow proxies to them
COUNTRIES_JSON=$(curl -s "https://raxyproxy.com/api/v1/locations/cities?pool_type=residential&countries=us" \
                  -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
TOP=$(echo "$COUNTRIES_JSON" | jq -r '.data.items | sort_by(-.count) | .[0:5] | map(.code) | join(",")')
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=50&countries=us&cities=$TOP" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
locations.py
import requests

API_KEY = 'raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
HEADERS = {'Authorization': f'Bearer {API_KEY}'}

# What countries can I currently target on residential?
r = requests.get(
    'https://raxyproxy.com/api/v1/locations/countries',
    headers=HEADERS,
    params={'pool_type': 'residential'},
).json()

for item in r['data']['items']:
    print(f"{item['code']}  {item['name']:25}  pool={item['count']:,}")