跳转到内容

获取代理

获取一个针对你的目标优化过的代理端点。

GET /v1/proxy
参数类型是否必填说明
targetstring目标域名(如 amazon.com
session_lockboolean在会话期间保持同一 IP(默认 false
countrystringISO 3166-1 alpha-2 国家代码
ip_typestringresidentialdatacenterdedicated
session_ttlinteger会话超时时间,单位秒(默认 1800)
auto_healboolean启用自动故障转移(默认 true
Terminal window
curl "https://api.hydraskill.ai/v1/proxy?target=amazon.com&session_lock=true&country=US" \
-H "Authorization: Bearer sk-your-key"
{
"proxy_id": "px_abc123",
"host": "us-res-42.proxy.hydraskill.ai",
"port": 8080,
"username": "session_abc123",
"password": "px_token_xyz",
"ip": "203.0.113.42",
"country": "US",
"type": "residential",
"session_lock": true,
"expires_at": "2026-05-30T16:30:00Z",
"protocol": "http"
}
proxy = client.get_proxy(target="amazon.com", session_lock=True)
# 转换为 requests 兼容的字典
proxies = proxy.to_dict()
# {'http': 'http://user:pass@host:port', 'https': 'http://user:pass@host:port'}
response = requests.get(url, proxies=proxies)
错误码含义
400缺少必填参数 target
401API key 无效
402余额不足 / 已达套餐上限
429超出速率限制
503没有符合所请求条件的可用代理