代理列表
文档代理列表

代理列表

为套餐生成即用的代理字符串,支持可选的地理定向和格式选择。

GET /packages/:id/proxies

返回给定套餐的代理连接字符串列表。默认响应为纯文本(每行一个代理),可轻松导入任何工具。传递 plain text (one proxy per line), making it trivially importable into any tool. Pass Accept: application/json to get a JSON envelope instead.

GET/api/v1/packages/{id}/proxies

查询参数

参数默认描述
quantity10要返回的代理字符串数量(1–1000)
typerotatingrotating or sticky
protocolhttphttp or socks5
formatuser:pass@host:port输出格式 — 见下表
countries逗号分隔的 ISO 3166-1 alpha-2 国家代码
exclude_countries要排除的逗号分隔国家代码
states州名(小写,无空格,如 california)
cities城市名(小写,无空格,如 newyork)
zipcodesZIP/邮政编码,逗号分隔
asns自治系统号(数字,有无 AS 前缀均可)
exclude_states要排除的州名(小写,无空格)。计费 2×。
exclude_cities要排除的城市名(小写,无空格)。计费 2×。
exclude_zipcodes要排除的 ZIP 编码。计费 2×。
exclude_asns要排除的 ASN(数字)。计费 2×。
sessid粘性会话 ID。在接下来 ~30 分钟内重复使用同一字符串可以保持同一出口 IP,无需占用粘性端口。
sessttl30粘性会话 TTL(分钟,1–120)。省略时默认为 30 分钟。
unique_sessidfalse当 true 且设置了 sessid 时,生成的代理共享 sessid 前缀但每行追加唯一后缀(sessid.0、sessid.1、…)— 适合一次请求中签发 N 个独立粘性会话。
anonymousfalsetrue 仅返回高匿名出口。可能减少池规模。

州 / 城市 / ZIP / ASN 计费 2×

州、城市、ZIP 和 ASN 定向对 Residential、Mobile 和 Datacenter 套餐应用 2× 流量乘数。Premium Residential 免于此限制。国家定向(countries / exclude_countries)始终免费。

输出格式

格式值示例输出
user:pass@host:portabc123:pass7x9k2m@proxy.raxyproxy.com:823
host:port:user:passproxy.raxyproxy.com:823:abc123:pass7x9k2m
user:pass:host:portabc123:pass7x9k2m:proxy.raxyproxy.com:823
host:port@user:passproxy.raxyproxy.com:823@abc123:pass7x9k2m
user:passabc123:pass7x9k2m
host:portproxy.raxyproxy.com:823
http://user:pass@host:porthttp://abc123:pass7x9k2m@proxy.raxyproxy.com:823
socks5://user:pass@host:portsocks5://abc123:pass7x9k2m@proxy.raxyproxy.com:824

地理过滤示例

geo-examples.sh
# US proxies only
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=5&countries=us" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# US, UK, and Germany — rotating HTTP
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=10&countries=us,gb,de" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# California only — note: 2× billing applies
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=5&countries=us&states=california" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# New York city, sticky, SOCKS5, JSON response
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=3&countries=us&cities=newyork&type=sticky&protocol=socks5" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
     -H "Accept: application/json"
proxies-plain.txt
# Plain text response (default):
abc123def456:pass7x9k2m@proxy.raxyproxy.com:823
abc123def456:pass7x9k2m@proxy.raxyproxy.com:823
abc123def456:pass7x9k2m@proxy.raxyproxy.com:823
proxies-json.json
{
  "data": {
    "package_id":         12,
    "count":              3,
    "billing_multiplier": 1.0,
    "proxies": [
      "abc123def456:pass7x9k2m@proxy.raxyproxy.com:823",
      "abc123def456:pass7x9k2m@proxy.raxyproxy.com:823",
      "abc123def456:pass7x9k2m@proxy.raxyproxy.com:823"
    ]
  },
  "meta": { "version": "v1" }
}

粘性会话:端口 vs sessid

保持同一出口 IP 的两种方式:连接粘性范围(10000–20000)中的端口(每端口一个 IP),或将 sessid 参数附加到凭据并使用标准轮换端口。需要多个并发独立粘性会话时优先 sessid。

sticky-sessid.sh
# Sticky session via sessid — same IP for 10 minutes, single proxy
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=1&countries=us&sessid=worker-7&sessttl=10" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Sticky session via port range — same IP per port, 100 distinct sticky exits in parallel
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=100&type=sticky" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# 20 unique sessid sticky sessions on the standard rotating port — 20 isolated IPs, 30 min TTL
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=20&sessid=worker&unique_sessid=true&sessttl=30" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Anonymous-only US proxies, excluding California
curl "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=10&countries=us&exclude_states=california&anonymous=true" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

代码示例

proxies.sh
# Download 100 US proxies in URL format to a file
curl -s "https://raxyproxy.com/api/v1/packages/12/proxies?quantity=100&countries=us&format=http://user:pass@host:port" \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
     -o proxies.txt
proxies.py
import requests

API_KEY    = 'raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
PACKAGE_ID = 12

resp = requests.get(
    f'https://raxyproxy.com/api/v1/packages/{PACKAGE_ID}/proxies',
    params={
        'quantity': 10,
        'countries': 'us',
        'format': 'http://user:pass@host:port',
    },
    headers={
        'Authorization': f'Bearer {API_KEY}',
        'Accept': 'text/plain',
    },
    timeout=10,
)

proxies = resp.text.strip().splitlines()
print(f'Got {len(proxies)} proxies')

# Use the first one
session = requests.Session()
session.proxies = {'http': proxies[0], 'https': proxies[0]}
ip = session.get('https://httpbin.org/ip', timeout=10).json()['origin']
print(f'My IP via proxy: {ip}')
proxies.mjs
const API_KEY    = 'raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const PACKAGE_ID = 12;

const url = new URL(`https://raxyproxy.com/api/v1/packages/${PACKAGE_ID}/proxies`);
url.searchParams.set('quantity', '10');
url.searchParams.set('countries', 'us');
url.searchParams.set('format', 'http://user:pass@host:port');

const resp = await fetch(url, {
    headers: { Authorization: `Bearer ${API_KEY}` },
});

const proxies = (await resp.text()).trim().split('\n');
console.log(`Got ${proxies.length} proxies`);
console.log(proxies[0]);