位置
文档位置

位置发现

按池类型查询可用的国家、州、城市、ZIP 与 ASN,从真实数据构建地理过滤而非猜测代码。

所有位置端点都接受必填的 pool_type 查询参数,并返回 {code, name, count} 数组。可直接将 code 值用于 /packages/{id}/proxies 与 /default-geo。API 层缓存 1 小时 + 更长的上游缓存 — 提供商目录的变化数分钟内可见。

GET /locations/countries

返回所选池可用的国家。无需筛选。

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

返回指定国家内的州。

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

GET /locations/cities

返回指定国家内的城市(可按州进一步限制)。

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

GET /locations/zipcodes

返回指定国家内的 ZIP(可按州进一步限制)。

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

GET /locations/asns

返回指定国家内的 ASN(可按州/城市进一步限制)。

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

代码格式

国家:2 位 ISO 小写代码(us、gb、de)。州/城市:全名、小写、无空格 — california、newyork、sanfrancisco。ZIP:数字字符串。ASN:数字,不带 AS 前缀。

代码示例

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']:,}")