跳到内容

HiProxy API 指南

在控制台能做的事,也可以用您自己的代码完成。查询余额和连接信息、查看价格、用余额下单、生成带参数的代理用户名,全部通过 REST API 实现。

如何开始?

  1. 1用用户名注册并登录控制台。
  2. 2在“连接”标签页生成 API 密钥。完整密钥只显示一次,请立即保存到安全的地方。
  3. 3在每个需要密钥的请求中,把密钥放在 Authorization 请求头里。
  4. 4先调用 /account 确认密钥可用,再用 /orders 下单。

如何认证?

与您自己账户相关的请求(account、orders、proxy-user)需要 API 密钥。请在请求头中以 Authorization: Bearer hpk_... 的形式发送。价格、国家和报价接口对所有人开放,无需密钥。

HiProxy 只存储密钥的哈希值,从不存储密钥本身。如果密钥丢失,请在控制台生成新密钥,旧密钥会立即失效。请只在服务器端代码中使用密钥,不要放在浏览器中运行的代码或公开代码库里。

HTTP header
Authorization: Bearer hpk_your_api_key

基础 URL 和数据格式

基础 URL
https://hiproxy.shop/api/v1
请求和响应正文
application/json
金额
USD 金额,数字格式,例如 1036.60
时间戳
ISO 8601 (UTC)

有调用频率限制吗?

每个 API 密钥每分钟最多可调用 60 次。不带密钥调用公开接口时,每个 IP 每分钟最多 60 次。超过限制会返回 HTTP 429。请等待一分钟后再发送。

错误响应是什么样的?

您会收到 HTTP 状态码,以及包含简短错误代码和说明的 JSON 内容。

示例
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low for this order. Top up in the dashboard."
  }
}
code
bad_requestHTTP 400缺少必填值,或此产品不接受该值。
unauthorizedHTTP 401未发送 API 密钥,或密钥错误。
insufficient_balanceHTTP 402余额低于订单总额。余额未被扣除。
not_foundHTTP 404您的账户中没有此 id 的订单。
rate_limitedHTTP 429超过了每分钟的请求限制。
server_errorHTTP 500服务器无法完成请求。余额未被扣除。

接口

查询账户

GET/api/v1/account需要 API 密钥

显示您的余额、代理主机和端口、代理用户名和密码,以及 IP 白名单。

请求
curl https://hiproxy.shop/api/v1/account \
  -H "Authorization: Bearer hpk_your_api_key"
响应
{
  "username": "hi_user01",
  "balance_usd": 1300,
  "proxy": {
    "host": "gate.hiproxy.shop",
    "http_port": 6100,
    "socks5_port": 6200,
    "username": "hpexample1",
    "password": "your_password"
  },
  "allowed_ips": [
    "203.0.113.10"
  ]
}

查询产品和价格

GET/api/v1/products无需密钥

显示每种产品的订购限制、各档单价和周期优惠。与价格页面使用同一份价格表。

请求
curl https://hiproxy.shop/api/v1/products
响应
{
  "currency": "USD",
  "prices_as_of": "2026-10-31",
  "products": [
    {
      "id": "unlimited",
      "unit": "day",
      "quantity": {
        "meaning": "days",
        "min": 1,
        "max": 365
      },
      "...": "..."
    },
    {
      "id": "residential",
      "unit": "gb",
      "...": "..."
    }
  ]
}

国家和城市列表

GET/api/v1/countries无需密钥

显示每种产品支持的国家,以及用户名 -city- 参数可用的城市值。

字段含义
product可选unlimited、residential、isp、datacenter 之一。留空表示 residential。
请求
curl "https://hiproxy.shop/api/v1/countries?product=datacenter"
响应
{
  "product": "datacenter",
  "countries": [
    {
      "code": "us",
      "name": "United States",
      "region": "americas",
      "datacenter": true,
      "cities": [
        {
          "name": "New York",
          "value": "new_york"
        },
        {
          "name": "Los Angeles",
          "value": "los_angeles"
        }
      ]
    }
  ]
}

获取报价

POST/api/v1/quote无需密钥

计算订单总额,不扣除余额。请发送与下单时相同的请求正文。

字段含义
product必填unlimited、residential、isp、datacenter 之一。
quantity必填unlimited 为天数(1~365),residential 为 GB(5~5,000),isp 为 IP 数量(1~1,000),datacenter 为 IP 数量(5~5,000)。
concurrency可选仅限 unlimited。可选 200、500、1000 或 2000。
bandwidth可选仅限 unlimited,单位 Mbps。可选 100、200、500 或 1000。
months可选仅限 isp 和 datacenter。可选 1、3、6 或 12。
country可选仅限 isp 和 datacenter。两个字母的国家代码,例如 jp。有效值见 /countries。
请求
curl -X POST https://hiproxy.shop/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
响应
{
  "product": "unlimited",
  "quantity": 30,
  "unit_price_usd": 8.78,
  "unit": "day",
  "total_usd": 263.4
}

下单

POST/api/v1/orders需要 API 密钥

从余额中扣除总额并创建订单。订单初始状态为 pending(开通中),准备完成后变为 active。无法开通的订单会变为 refunded,您支付的全部金额退回余额。余额不足时返回 402。

字段含义
product必填unlimited、residential、isp、datacenter 之一。
quantity必填unlimited 为天数(1~365),residential 为 GB(5~5,000),isp 为 IP 数量(1~1,000),datacenter 为 IP 数量(5~5,000)。
concurrency可选仅限 unlimited。可选 200、500、1000 或 2000。
bandwidth可选仅限 unlimited,单位 Mbps。可选 100、200、500 或 1000。
months可选仅限 isp 和 datacenter。可选 1、3、6 或 12。
country可选仅限 isp 和 datacenter。两个字母的国家代码,例如 jp。有效值见 /countries。
请求
curl -X POST https://hiproxy.shop/api/v1/orders \
  -H "Authorization: Bearer hpk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
响应
{
  "order": {
    "id": "HP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.78,
    "total_usd": 263.4,
    "status": "pending",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:12:44.120Z"
  },
  "balance_usd": 1036.6
}

订单列表

GET/api/v1/orders需要 API 密钥

显示您最多 100 个订单,按时间从新到旧排列。

字段含义
status可选pending、active、refunded 之一。留空则返回所有状态的订单。
请求
curl "https://hiproxy.shop/api/v1/orders?status=pending" \
  -H "Authorization: Bearer hpk_your_api_key"
响应
{
  "orders": [
    {
      "id": "HP-7KQ2M-X4HTD",
      "product": "unlimited",
      "quantity": 30,
      "months": null,
      "concurrency": 1000,
      "bandwidth_mbps": 200,
      "country": null,
      "unit_price_usd": 8.78,
      "total_usd": 263.4,
      "status": "pending",
      "created_at": "2026-10-31T09:12:44.120Z",
      "updated_at": "2026-10-31T09:12:44.120Z"
    }
  ]
}

查询单个订单

GET/api/v1/orders/{id}需要 API 密钥

按 id 显示单个订单。可以用来确认开通是否已完成。

字段含义
id必填订单 id,例如 HP-7KQ2M-X4HTD。
请求
curl https://hiproxy.shop/api/v1/orders/HP-7KQ2M-X4HTD \
  -H "Authorization: Bearer hpk_your_api_key"
响应
{
  "order": {
    "id": "HP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.78,
    "total_usd": 263.4,
    "status": "active",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:40:02.511Z"
  }
}

生成代理用户名

GET/api/v1/proxy-user需要 API 密钥

生成包含您所选参数的代理用户名,以及可直接粘贴使用的 HTTP 和 SOCKS5 URL。不填 session 时,每个请求都会更换 IP。

字段含义
product可选unlimited、residential、isp、datacenter 之一。留空表示 unlimited。
country可选两位字母的国家代码,例如 jp。
city可选/countries 中的城市值,例如 tokyo。必须与 country 一起使用。
session可选1~32 位字母或数字。使用相同 session 的请求使用同一个 IP。
ttl可选会话 IP 保持的分钟数,1~60。留空表示 30。
请求
curl "https://hiproxy.shop/api/v1/proxy-user?product=residential&country=jp&city=tokyo&session=job42&ttl=30" \
  -H "Authorization: Bearer hpk_your_api_key"
响应
{
  "username": "hpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30",
  "password": "your_password",
  "http": "http://hpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.hiproxy.shop:6100",
  "socks5": "socks5h://hpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.hiproxy.shop:6200"
}

分步示例

一个脚本完成查询价格、用余额下单并通过日本 IP 连接。

Python (requests)
import requests

API = "https://hiproxy.shop/api/v1"
HEAD = {"Authorization": "Bearer hpk_your_api_key"}

# 1) Check the price first
plan = {"product": "residential", "quantity": 100}
print(requests.post(f"{API}/quote", json=plan).json())

# 2) Order from your balance
r = requests.post(f"{API}/orders", json=plan, headers=HEAD)
order = r.json()["order"]
print(order["id"], order["status"])

# 3) Get a username for Japanese IPs
u = requests.get(f"{API}/proxy-user", headers=HEAD,
                 params={"product": "residential", "country": "jp"}).json()
proxies = {"http": u["http"], "https": u["http"]}
print(requests.get("https://ipinfo.io/json", proxies=proxies, timeout=30).json())
Node.js 18+
const API = "https://hiproxy.shop/api/v1";
const HEAD = { Authorization: "Bearer hpk_your_api_key", "Content-Type": "application/json" };

// Check the balance
const acc = await fetch(`${API}/account`, { headers: HEAD }).then((r) => r.json());
console.log(acc.balance_usd);

// Order 7 days of unlimited
const res = await fetch(`${API}/orders`, {
  method: "POST",
  headers: HEAD,
  body: JSON.stringify({ product: "unlimited", quantity: 7, concurrency: 500, bandwidth: 100 }),
});
if (res.status === 402) console.log("Top up first");
else console.log((await res.json()).order.id);

通过 API 下的订单与控制台订单处理方式相同,也会显示在“记录”标签页中。请将示例中的 hpk_your_api_key 替换为您自己的 API 密钥。

用您自己的代码调用 HiProxy

用用户名注册,在控制台生成 API 密钥,就可以开始了。