如何开始?
- 1用用户名注册并登录控制台。
- 2在“连接”标签页生成 API 密钥。完整密钥只显示一次,请立即保存到安全的地方。
- 3在每个需要密钥的请求中,把密钥放在 Authorization 请求头里。
- 4先调用 /account 确认密钥可用,再用 /orders 下单。
如何认证?
与您自己账户相关的请求(account、orders、proxy-user)需要 API 密钥。请在请求头中以 Authorization: Bearer hpk_... 的形式发送。价格、国家和报价接口对所有人开放,无需密钥。
HiProxy 只存储密钥的哈希值,从不存储密钥本身。如果密钥丢失,请在控制台生成新密钥,旧密钥会立即失效。请只在服务器端代码中使用密钥,不要放在浏览器中运行的代码或公开代码库里。
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."
}
}| HTTP | code | 含义 |
|---|---|---|
| bad_requestHTTP 400缺少必填值,或此产品不接受该值。 | 缺少必填值,或此产品不接受该值。 | |
| unauthorizedHTTP 401未发送 API 密钥,或密钥错误。 | 未发送 API 密钥,或密钥错误。 | |
| insufficient_balanceHTTP 402余额低于订单总额。余额未被扣除。 | 余额低于订单总额。余额未被扣除。 | |
| not_foundHTTP 404您的账户中没有此 id 的订单。 | 您的账户中没有此 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可选 | string | 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必填 | string | unlimited、residential、isp、datacenter 之一。 |
quantity必填 | integer | unlimited 为天数(1~365),residential 为 GB(5~5,000),isp 为 IP 数量(1~1,000),datacenter 为 IP 数量(5~5,000)。 |
concurrency可选 | integer | 仅限 unlimited。可选 200、500、1000 或 2000。 |
bandwidth可选 | integer | 仅限 unlimited,单位 Mbps。可选 100、200、500 或 1000。 |
months可选 | integer | 仅限 isp 和 datacenter。可选 1、3、6 或 12。 |
country可选 | string | 仅限 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必填 | string | unlimited、residential、isp、datacenter 之一。 |
quantity必填 | integer | unlimited 为天数(1~365),residential 为 GB(5~5,000),isp 为 IP 数量(1~1,000),datacenter 为 IP 数量(5~5,000)。 |
concurrency可选 | integer | 仅限 unlimited。可选 200、500、1000 或 2000。 |
bandwidth可选 | integer | 仅限 unlimited,单位 Mbps。可选 100、200、500 或 1000。 |
months可选 | integer | 仅限 isp 和 datacenter。可选 1、3、6 或 12。 |
country可选 | string | 仅限 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可选 | string | 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必填 | string | 订单 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可选 | string | unlimited、residential、isp、datacenter 之一。留空表示 unlimited。 |
country可选 | string | 两位字母的国家代码,例如 jp。 |
city可选 | string | /countries 中的城市值,例如 tokyo。必须与 country 一起使用。 |
session可选 | string | 1~32 位字母或数字。使用相同 session 的请求使用同一个 IP。 |
ttl可选 | integer | 会话 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 连接。
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())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 密钥。