API 与集成文档
集成 SocksNode 有两种方式:通过 HTTP(S) 或 SOCKS5 直接连接到代理网关,或通过 REST API 以编程方式管理带宽、用量和代理。
本页内容
静态 IP 与 IP Vault
概览
购买、查看和续费静态数据中心 IP 与住宅 ISP IP;购买、查看和管理 IP Vault 地址与流量——与控制台相同的操作,由你的代码调用。
花钱的调用(购买和续费)需要具有 purchase 权限的 API 密钥,且只用钱包余额支付——请先充值。余额不足时返回 402,不会下单。静态订单在后台交付:轮询订单直到交付完成。
https://socksnode.com/api/v1鉴权
基础 URL https://socksnode.com/api/v1。在 Dashboard → API access 下创建密钥,并以 Bearer 令牌形式发送。密钥具有作用域——只请求你需要的权限。
| 作用域 | 授予权限 |
|---|---|
| read:usage | 余额与用量分析 |
| read:proxies | 列出已保存的代理凭据 |
| write:proxies | 生成新的代理凭据 |
| purchase | 为轮换住宅、数据中心和移动代理购买 GB,购买和续费静态 IP 与 ISP IP,租用和续费 4G/5G 端口,开启自动续费,购买 24 小时 IP 以及 IP Vault 地址和流量——从余额扣款。 |
速率限制:每个密钥每分钟 120 次请求(代理生成会被进一步限流)。请对密钥保密并保存在服务器端。
GET /api/v1/account HTTP/1.1
Host: socksnode.com
Authorization: Bearer sk_YOUR_API_KEY错误
错误会返回 JSON 主体 { "error": { "code", "message" } },并附带相应的 HTTP 状态码:
| 状态 | 含义 |
|---|---|
| 400 | 请求主体或参数无效 |
| 401 | API 密钥缺失、无效或已撤销 |
| 402 | 带宽余额不足,无法生成代理 |
| 403 | API 密钥缺少所需的作用域 |
| 404 | 未找到,或不属于你。 |
| 409 | 端口当前状态不允许此操作,例如已过期。 |
| 429 | 超出速率限制——参见 Retry-After 响应头 |
| 503 | 产品维护中。请稍后重试。 |
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"error": {
"code": "no_bandwidth",
"message": "…"
}
}静态数据中心 IP 与 ISP IP
静态 IP 目录
GET/static/catalog
作用域: read:proxies
查询参数
typestring必填dedicated_ipv4、shared_ipv4 和 ipv6 为数据中心 IP;isp 为住宅 ISP IP。
dedicated_ipv4shared_ipv4ipv6isp
curl "https://socksnode.com/api/v1/static/catalog?type=dedicated_ipv4" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"type": "dedicated_ipv4",
"periodsDays": [5, 10, 20, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360],
"maxQuantity": 100,
"countries": [
{ "code": "us", "name": "United States", "available": 1000, "cities": [{ "id": 3, "name": "New York", "available": 120 }] }
]
}静态订单报价
GET/static/quote
作用域: read:proxies
查询参数
typestring必填dedicated_ipv4、shared_ipv4 和 ipv6 为数据中心 IP;isp 为住宅 ISP IP。
dedicated_ipv4shared_ipv4ipv6ispcountrystring必填目录中的两位国家代码。
quantityinteger必填IP 数量(1–100)。
periodDaysinteger必填租期天数——该类型在目录中列出的期限之一。
curl "https://socksnode.com/api/v1/static/quote?type=isp&country=us&quantity=5&periodDays=30" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"type": "isp",
"country": "us",
"quantity": 5,
"periodDays": 30,
"unitPriceUsd": 3.4,
"totalUsd": 17
}购买静态 IP
POST/static/orders
作用域: purchase
请求体参数
typestring必填dedicated_ipv4、shared_ipv4 和 ipv6 为数据中心 IP;isp 为住宅 ISP IP。
dedicated_ipv4shared_ipv4ipv6ispcountrystring必填目录中的两位国家代码。
cityIdinteger可选目录中的城市 id(仅数据中心类型)。不填为任意城市。
quantityinteger必填IP 数量(1–100)。
periodDaysinteger必填租期天数——该类型在目录中列出的期限之一。
couponCodestring可选优惠码(如有)。
curl -X POST "https://socksnode.com/api/v1/static/orders" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "dedicated_ipv4",
"country": "us",
"quantity": 2,
"periodDays": 30
}'{
"id": "clx…",
"orderNumber": "SN-…",
"status": "paid",
"type": "dedicated_ipv4",
"country": "us",
"quantity": 2,
"periodDays": 30,
"amountUsd": 4.6,
"delivery": "pending"
}静态订单状态
GET/static/orders/{id}
作用域: read:proxies
路径参数
idstring必填下单时返回的 id。
curl "https://socksnode.com/api/v1/static/orders/ORDER_ID" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"id": "clx…",
"status": "paid",
"delivery": "done",
"delivered": 2,
"quantity": 2,
"refundedUsd": 0,
"ips": [ … ]
}你的静态 IP
GET/static
作用域: read:proxies
查询参数
typestring可选要列出的静态 IP 类型。
alldatacenterisp默认值:all
curl "https://socksnode.com/api/v1/static" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"data": [
{
"id": "clx…",
"ip": "203.0.113.25",
"host": "203.0.113.25",
"portHttp": 50100,
"portSocks5": 50101,
"username": "u3k2…",
"password": "…",
"type": "dedicated_ipv4",
"countryCode": "us",
"status": "active",
"expiresAt": "2026-11-03T10:00:00.000Z",
"daysLeft": 30,
"autoRenew": false
}
]
}续费静态 IP
POST/static/renew
作用域: purchase
请求体参数
idsstring[]必填要续费的静态 IP id——数据中心与 ISP 分开调用。
periodDaysinteger必填租期天数——该类型在目录中列出的期限之一。
curl -X POST "https://socksnode.com/api/v1/static/renew" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"STATIC_ID"
],
"periodDays": 30
}'{
"jobId": "clx…",
"renewed": 1,
"chargedUsd": 2.3,
"delivery": "pending"
}更新静态 IP
PATCH/static/{id}
作用域: write:proxies
路径参数
idstring必填静态 IP 的 id。
请求体参数
autoRenewboolean可选到期前自动用钱包余额续费。
namestring可选IP 的名称。
notestring可选私人备注。
curl -X PATCH "https://socksnode.com/api/v1/static/STATIC_ID" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"autoRenew": true
}'{
"id": "clx…",
"autoRenew": true,
…
}24小时独享住宅IP
24小时住宅IP(/day-ip):按国家、州、城市或运营商查看在售地址,按 ref 购买指定地址或按数量购买任意匹配地址,然后对已有地址进行查看、备注、收藏、欺诈检测和测速。每个地址最多可用24小时,不限流量;购买后10分钟内无法使用的地址可退款。
24小时IP:国家与价格
GET/day-ip/countries
作用域: read:proxies
查询参数
poolstring可选使用哪个网络的目录:a(默认)或 b。两个网络覆盖的国家不同,各自返回自己的列表。
ab默认值:a
curl "https://socksnode.com/api/v1/day-ip/countries" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"priceUsd": 0.09,
"count": 219,
"data": [{ "code": "US", "name": "United States" }]
}24小时IP:州、城市与运营商
GET/day-ip/places
作用域: read:proxies
查询参数
levelstring必填要列出的内容:state(州)、city(城市)或 asn(运营商网络);网络 b 用 isp 代替 asn。
statecityasnispcountrystring必填两位国家代码,如 US。
statestring可选州或地区,取自 /day-ip/places。
poolstring可选使用哪个网络的目录:a(默认)或 b。两个网络覆盖的国家不同,各自返回自己的列表。
ab默认值:a
curl "https://socksnode.com/api/v1/day-ip/places?level=city&country=US&state=Texas" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"level": "city",
"country": "US",
"data": [{ "value": "Dallas", "label": "Dallas" }]
}24小时IP:在售地址
GET/day-ip/shop
作用域: read:proxies
查询参数
countrystring必填两位国家代码,如 US。
statestring可选州或地区,取自 /day-ip/places。
citystring可选城市,取自 /day-ip/places;无需先选州。
asninteger可选运营商网络编号,如 7922。
freshboolean可选true 重新获取列表,而不是使用最近 90 秒的缓存。
moreboolean可选true 向列表追加新的一批(最多 500 个)。每次最多列出 100 个地址,且无法按 IP 段搜索,可通过追加来查找。
ispstring可选运营商名称,须与 /day-ip/places 列出的完全一致(网络 b)。
zipstring可选邮政编码,精确匹配(网络 b)。
poolstring可选使用哪个网络:a(默认)或 b。网络 b 必须带 country,用 isp 和 zip 代替 asn 筛选,每个地址附带一个 ping;fresh 与 more 对它无效。
ab默认值:a
curl "https://socksnode.com/api/v1/day-ip/shop?country=US&state=Texas" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"priceUsd": 0.09,
"walletUsd": 12.4,
"count": 98,
"data": [
{ "ref": "DO7fs76WkECuwM", "ip": "73.12.148.*", "cc": "US", "state": "Texas", "city": "Dallas", "isp": "Comcast Cable Communications, LLC", "asn": 7922 }
]
}24小时IP:购买
POST/day-ip/ips
作用域: purchase
请求体参数
refsstring[]可选要购买的具体地址:每个地址的 ref,取自 /day-ip/shop。ref 约 5 分钟内可购买。最多 50 个。
countrystring可选替代 refs:购买该国家内任意匹配的地址(可用 state、city 或 asn 缩小范围)。
statestring可选州或地区,取自 /day-ip/places。
citystring可选城市,取自 /day-ip/places;无需先选州。
asninteger可选运营商网络编号,如 7922。
countinteger可选与 country 一起使用:购买数量,1–50。
ispstring可选运营商名称,须与 /day-ip/places 列出的完全一致(网络 b)。
poolstring可选使用哪个网络:a(默认)或 b。网络 b 只出售指定地址——请连同 country 发送 refs,不要用 count。
ab默认值:a
curl -X POST "https://socksnode.com/api/v1/day-ip/ips" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"refs": [
"SHOP_REF_1",
"SHOP_REF_2"
]
}'{
"bought": [
{ "id": "cmv…", "proxy": "vault.socksnode.com:27311:user-ip:pass", "ip": "73.12.148.20", "country": "US", "city": "Dallas", "isp": "Comcast Cable Communications, LLC", "asn": 7922, "expiresAt": "2026-10-12T15:36:40Z" }
],
"chargedUsd": 0.18,
"refundedUsd": 0
}24小时IP:我的IP列表
GET/day-ip/ips
作用域: read:proxies
查询参数
viewstring可选active:24 小时内的地址;all:包括最近 7 天的地址。
activeall默认值:active
curl "https://socksnode.com/api/v1/day-ip/ips" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"view": "active",
"count": 1,
"data": [
{ "id": "cmv…", "proxy": "vault.socksnode.com:27311:user-ip:pass", "ip": "73.12.148.20", "country": "US", "status": "active", "expiresAt": "2026-10-12T15:36:40Z", "fraud": { "score": 12, "risk": "low", "listed": false }, "speedMs": 1840, "note": "shop #3", "favorite": true }
]
}24小时IP:备注与收藏
PATCH/day-ip/ips/{id}
作用域: write:proxies
路径参数
idstring必填您的某个24小时IP的 id。
请求体参数
notestring可选您对该地址的备注,最多 200 个字符。
favoriteboolean可选收藏或取消收藏。
curl -X PATCH "https://socksnode.com/api/v1/day-ip/ips/DAY_IP_ID" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"note": "shop #3",
"favorite": true
}'{
"id": "cmv…",
"ok": true
}24小时IP:失效IP退款
POST/day-ip/ips/{id}/refund
作用域: write:proxies
路径参数
idstring必填您的某个24小时IP的 id。
curl -X POST "https://socksnode.com/api/v1/day-ip/ips/DAY_IP_ID/refund" \
-H "Authorization: Bearer sk_YOUR_API_KEY"{
"id": "cmv…",
"result": "refunded",
"windowMinutes": 10
}24小时IP:批量失效IP退款
POST/day-ip/ips/refund
作用域: write:proxies
请求体参数
idsstring[]必填要退款的 24 小时IP 的 id,最多 50 个。每个先重新拨测一次,返回结果会说明每个 id 的去向:refunded、still_online 或 expired。
curl -X POST "https://socksnode.com/api/v1/day-ip/ips/refund" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"DAY_IP_ID_1",
"DAY_IP_ID_2"
]
}'{
"refunded": 1,
"stillOnline": 1,
"expired": 0,
"windowMinutes": 10,
"data": [
{ "id": "cmv…", "result": "refunded", "why": "dead", "usd": 0.09 },
{ "id": "cmw…", "result": "still_online", "usd": 0 }
]
}24小时IP:欺诈检测
POST/day-ip/ips/fraud
作用域: purchase
请求体参数
idsstring[]必填您的24小时IP的 id,最多 50 个。每个 $0.003,从余额扣除。
curl -X POST "https://socksnode.com/api/v1/day-ip/ips/fraud" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"DAY_IP_ID"
]
}'{
"checked": 1,
"failed": 0,
"chargedUsd": 0.003,
"data": [{ "id": "cmv…", "ip": "73.12.148.20", "fraud": { "score": 12, "risk": "low", "listed": false } }]
}24小时IP:在线检测(在线/离线)
POST/day-ip/ips/speed
作用域: read:proxies
请求体参数
idsstring[]必填您的24小时IP的 id,最多 20 个。
curl -X POST "https://socksnode.com/api/v1/day-ip/ips/speed" \
-H "Authorization: Bearer sk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"DAY_IP_ID"
]
}'{
"data": [{ "id": "cmv…", "ip": "73.12.148.20", "online": true, "speedMs": 1840 }]
}