跳到內容

取得 Proxy

取得一個針對你的目標最佳化的 proxy 端點。

GET /v1/proxy
參數型別必填說明
targetstring目標網域(例如 amazon.com
session_lockboolean在整個 session 中維持相同 IP(預設:false
countrystringISO 3166-1 alpha-2 國家代碼
ip_typestringresidentialdatacenterdedicated
session_ttlintegerSession 逾時秒數(預設: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 相容的 dict
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沒有符合所需條件的可用 proxy