REST API 参考
本节介绍代理管理 API:对地理位置查询、授权来源 IP、默认地理位置设置以及 Residential Proxies、旧版固定 IP ISP 套餐和旧版基于端口的套餐的代理列表进行程序化控制。当前的 ISP Proxies 套餐没有管理 API,其代理线路在面板的套餐页面中提供,参见 ISP Proxies。
基础 URL
Section titled “基础 URL”| 产品 | 基础 URL |
|---|---|
| Residential Proxies | https://shifter.io/api/v1/residential |
| 旧版 ISP 套餐(固定 IP) | https://shifter.io/api/v1/static-residential |
| 旧版套餐 | https://shifter.io/api/v1/backconnect |
Residential Proxies
Section titled “Residential Proxies”将您的 api_key 作为查询参数传递。可在面板的账户 → API Keys 下创建密钥。
curl "https://shifter.io/api/v1/residential/geo/countries?api_key=YOUR_API_KEY"旧版 ISP 套餐和旧版端口套餐
Section titled “旧版 ISP 套餐和旧版端口套餐”使用您账户的 API 令牌作为 api_token 查询参数。可在面板的账户 → API Tokens 下生成该令牌。
curl "https://shifter.io/api/v1/static-residential/YOUR_PLAN_ID/proxies?api_token=YOUR_API_TOKEN"{membership} 路径参数既可以接受面板中套餐页面上显示的 Membership ID(例如 68057),也可以接受套餐 URL 中的短代码(例如 Rxqk)。
每个端点都会返回标准的 HTTP 状态码。失败时的响应体包含一个带有 error 和 message 的 JSON 对象。
{ "error": "invalid_api_key", "message": "The provided api_key is missing or invalid"}| 状态码 | 含义 |
|---|---|
200 | 成功 |
400 | 错误请求(参数格式有误或缺少必填参数) |
401 | 凭据无效或缺失 |
403 | 套餐不支持此功能或端点 |
404 | 未找到会员账户或资源 |
429 | 请求过多,请使用退避策略重试 |
500 | 内部错误,请使用退避策略重试 |
一些旧版管理端点接受带有 _method=PUT 表单字段的 POST 请求,其效果等同于 PUT,这在您的 HTTP 客户端会剥离非标准方法时很有用。
代理管理 API
Section titled “代理管理 API” 用量与配额 Read your bandwidth usage and remaining quota, per account or per plan.
Residential Proxies Enumerate the available countries, regions, cities, and ASNs.
旧版 ISP 套餐 Pinned-IP ISP plans for existing customers: list IPs and manage the source-IP whitelist.
旧版套餐 Authorized IPs, geo defaults, and port list for legacy port-based plans.