套餐
文档套餐

套餐

通过 RaxyProxy REST API 列出并检查您的活跃代理套餐。

GET /packages

返回所有活跃和已暂停的代理套餐。

GET/api/v1/packages
packages-list.json
{
  "data": [
    {
      "id":           12,
      "name":         "Residential 10 GB",
      "type":         "residential",
      "status":       "active",
      "pool_type":    "residential",
      "quota_gb":     10.0,
      "used_gb":      3.2140,
      "available_gb": 6.7860,
      "usage_pct":    32.14,
      "blocked":      false,
      "synced_at":    "2026-05-29T11:00:00+00:00",
      "created_at":   "2026-04-01T11:59:00+00:00",
      "activated_at": "2026-04-01T12:00:00+00:00",
      "proxy": {
        "host":              "proxy.raxyproxy.com",
        "http_port":         823,
        "socks5_port":       824,
        "login":             "abc123def456",
        "threads":           100,
        "sticky_port_start": 10000,
        "sticky_port_end":   20000,
        "sticky_range":      { "start": 10000, "end": 20000 }
      }
    }
  ],
  "meta": { "version": "v1" }
}

GET /packages/:id

返回单个套餐。配置完成后,响应将包含额外的 settings block with IP allowlists, supported protocols, and default geo params.

GET/api/v1/packages/{id}
package-show.json
{
  "data": {
    "id":           12,
    "name":         "Residential 10 GB",
    "type":         "residential",
    "status":       "active",
    "pool_type":    "residential",
    "quota_gb":     10.0,
    "used_gb":      3.2140,
    "available_gb": 6.7860,
    "usage_pct":    32.14,
    "blocked":      false,
    "synced_at":    "2026-05-29T11:00:00+00:00",
    "created_at":   "2026-04-01T11:59:00+00:00",
    "activated_at": "2026-04-01T12:00:00+00:00",
    "proxy": {
      "host":              "proxy.raxyproxy.com",
      "http_port":         823,
      "socks5_port":       824,
      "login":             "abc123def456",
      "password":          "6f487b213b4cb4ae",
      "threads":           100,
      "sticky_port_start": 10000,
      "sticky_port_end":   20000,
      "sticky_range":      { "start": 10000, "end": 20000 }
    },
    "settings": {
      "allowed_ips":         [],
      "supported_protocols": ["http", "socks5"],
      "blocked_hosts":       [],
      "default_geo": {
        "countries":         [],
        "states":            [],
        "cities":            [],
        "zipcodes":          [],
        "asns":              [],
        "exclude_countries": [],
        "exclude_asn":       [],
        "anonymous_filter":  false,
        "rotation_interval": null
      }
    }
  },
  "meta": { "version": "v1" }
}

响应字段

字段类型描述
idinteger套餐 ID — 用于其他 API 调用
namestring人类可读的产品名称
typestringresidential | residential_premium | mobile | datacenter
statusstringactive | suspended
pool_typestring内部池标识符(residential、residential_premium、mobile、datacenter)
quota_gbfloat购买的总流量(GB)
used_gbfloat已消耗的流量
available_gbfloat剩余流量
usage_pctfloat使用百分比(0–100)
blockedboolean套餐被管理员封禁时为 true
synced_atISO 8601 | null上次从提供商同步使用量的时间(≤30 分钟延迟)
created_atISO 8601套餐记录的创建时间
activated_atISO 8601 string套餐首次激活的时间
proxy.hoststring代理主机名
proxy.http_portintegerHTTP/HTTPS 代理端口(823)
proxy.socks5_portintegerSOCKS5 端口(824)
proxy.loginstring代理用户名(基础,无地理修饰符)
proxy.passwordstring (show only)明文代理密码 — 仅由 GET /packages/{id}(详细端点)返回。请保密。
proxy.threadsinteger最大并发连接数
proxy.sticky_port_startinteger第一个粘性会话端口
proxy.sticky_port_endinteger最后一个粘性会话端口
proxy.sticky_rangeobject粘性会话端口范围,为偏好对象形式的 SDK 镜像
settings.allowed_ipsarrayIP 白名单(空 = 允许任何 IP)
settings.supported_protocolsarray此套餐启用的协议
settings.blocked_hostsarray套餐被禁止访问的域名(完整列表)
settings.default_geoobject默认地理过滤器(包含 countries/states/cities/zipcodes/asns + exclude_* + anonymous_filter + rotation_interval 的对象)。

代码示例

packages.sh
# List all packages
curl https://raxyproxy.com/api/v1/packages \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Get a single package
curl https://raxyproxy.com/api/v1/packages/12 \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
packages.py
import requests

API_KEY = 'raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
HEADERS = {'Authorization': f'Bearer {API_KEY}'}

# List packages
pkgs = requests.get('https://raxyproxy.com/api/v1/packages', headers=HEADERS).json()

for p in pkgs['data']:
    pct = p['usage_pct']
    print(f"[{p['id']}] {p['name']}  {p['used_gb']}/{p['quota_gb']} GB ({pct}%)")
packages.mjs
const API_KEY = 'raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const headers = { Authorization: `Bearer ${API_KEY}` };

const res  = await fetch('https://raxyproxy.com/api/v1/packages', { headers });
const json = await res.json();

for (const p of json.data) {
    const { id, name, used_gb, quota_gb, usage_pct } = p;
    console.log(`[${id}] ${name}  ${used_gb}/${quota_gb} GB (${usage_pct}%)`);
}