无需 KYC — 无需身份证件、自拍照或文件。使用加密货币支付。
语言: 简体中文
选择 1 GB

API 参考

订单

查看套餐及其价格,使用余额购买套餐(新服务、增加流量或延长端口期限),并查看历史订单。

4 分钟阅读

本页端点

  • GET /v1/catalog/products:产品、套餐与价格
  • POST /v1/orders:使用余额购买套餐(新服务、增加流量或延长端口期限)
  • GET /v1/orders:列出订单
  • GET /v1/orders/{orderId}:获取订单

基础 URL https://localserpproxy.com/api/v1。身份验证、错误和限制:请参阅 API 概览。

产品、套餐与价格

GET/v1/catalog/products

列出所有产品及其套餐和价格,与下单时的实际收费完全一致。

公开接口:无需 API 密钥。

响应 200 OK

{
  "data": [
    {
      "id": "residential",
      "name": "Residential proxies",
      "description": "Residential traffic for manual local search, advertising, price and application checks in US cities. State, city and ZIP selection, subject to available exits; no promise of GPS position or rankings.",
      "unit": "GB",
      "plans": [
        {
          "id": "res-10",
          "productId": "residential",
          "name": "Local team",
          "quantity": 10,
          "unit": "GB",
          "durationDays": null,
          "price": "7.50",
          "pricePerUnit": "0.75",
          "popular": false,
          "features": [
            "US city selection, subject to availability",
            "Traffic stays until used",
            "Rotating or sticky sessions"
          ],
          "available": true,
          "countries": null
        }
      ]
    }
  ]
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/catalog/products"
Python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/products", timeout=30)
r.raise_for_status()
print(r.json())
Node.js
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/products`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

使用余额购买套餐(新服务、更多流量或延长端口时长)

POST/v1/orders

始终从预付余额中扣款:价格由 API 计算(目录价格 × quantity),余额扣除相应金额后,服务即创建或延长,订单会以 fulfillment 状态返回 completed。代理凭据立即可用。

  • 新增住宅代理流量:{ "planId": "res-10" }。
  • 新增轮换 4G/5G 流量(按 GB 计):{ "planId": "mgb-10" }(流量订阅包含 productId: "mobile-gb",通过 fulfillment.residentialSubscriptionId 交付)。
  • 为现有订阅添加流量:{ "planId": "res-10", "options": { "subscriptionId": "res_9x2m4k" } }:套餐必须属于该订阅对应的产品。
  • 新增移动端口:{ "planId": "mob-us-30d", "quantity": 1, "options": { "country": "US" } },可选搭配 carrier(查看移动端口]中的国家运营商)。区域套餐仅覆盖所属区域内的国家(否则在 options.country 上使用 422)。
  • 延长移动端口时长:{ "planId": "mob-us-7d", "options": { "portId": "mob_2v8k1q" } } 会将套餐时长添加到 expiresAt。

余额不足 → 402 insufficient_balance,并在 error.details 中显示所缺金额和建议充值金额(missing、suggestedTopUp)。发生任何错误时均不会扣款。如需支付差额,请在 purchase 中发起一笔携带相同请求的充值(POST /v1/topups):充值到账后即会购买套餐。

身份验证:在 Authorization: Bearer API_KEY 请求头中提供 API 密钥。

参数

名称位置类型必填说明
Idempotency-Keyheaderstring否用于安全重试 POST 的唯一键(例如 UUID)。保留 24 小时。— 最长 128 个字符

请求正文

字段类型必填说明
planIdstring是—
quantityinteger否1–100,默认值 1
optionsobject否—
示例: 住宅代理
{
  "planId": "res-10"
}
示例: 移动端口
{
  "planId": "mob-us-30d",
  "quantity": 1,
  "options": {
    "country": "US",
    "carrier": "verizon",
    "autoRenew": true
  }
}
示例: 延长端口时长
{
  "planId": "mob-us-7d",
  "options": {
    "portId": "mob_2v8k1q"
  }
}
示例: 移动流量
{
  "planId": "mgb-10"
}
示例: 区域端口
{
  "planId": "mob-us-30d",
  "options": {
    "country": "US",
    "carrier": "verizon"
  }
}

响应 201 Created

{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Local team",
  "quantity": 1,
  "unitPrice": "7.50",
  "subtotal": "7.50",
  "discount": "0.00",
  "total": "7.50",
  "promoCode": null,
  "currency": "USD",
  "topUpId": null,
  "options": {},
  "fulfillment": {
    "residentialSubscriptionId": "res_9x2m4k",
    "mobilePortIds": []
  },
  "createdAt": "2026-10-05T14:03:11Z",
  "paidAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s -X POST "https://localserpproxy.com/api/v1/orders" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"planId":"res-10"}'
Python
import os, uuid
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}

r = requests.post(f"{API}/orders", headers=HEADERS, json={"planId": "res-10"}, timeout=30)
r.raise_for_status()
print(r.json())
Node.js
// Node.js 18+ (built-in fetch), ES module
import { randomUUID } from 'node:crypto';

const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Idempotency-Key': randomUUID(), 'Content-Type': 'application/json' },
  body: JSON.stringify({ planId: 'res-10' }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

订单列表

GET/v1/orders

身份验证:在 Authorization: Bearer API_KEY 请求头中提供 API 密钥。

参数

名称位置类型必填说明
pagequeryinteger否≥ 1,默认值 1
perPagequeryinteger否1–100,默认值 20
statusquerycompleted · cancelled否订单创建后即视为已付款(从余额中扣款)。completed — 已付款并交付(凭据立即可用)。
productIdquerystring否目录中的产品 ID。LocalSERP Proxy 的取值:residential(GB)、mobile(专用 4G/5G 端口)和 mobile-gb(按 GB 计的轮换 4G/5G 流量)。客户端必须能够处理未知取值。

响应 200 OK

{
  "data": [
    {
      "id": "ord_4f8k2m9q",
      "status": "completed",
      "productId": "residential",
      "planId": "res-10",
      "planName": "Local team",
      "quantity": 1,
      "unitPrice": "7.50",
      "subtotal": "7.50",
      "discount": "0.00",
      "total": "7.50",
      "promoCode": null,
      "currency": "USD",
      "topUpId": null,
      "options": {},
      "fulfillment": {
        "residentialSubscriptionId": "res_9x2m4k",
        "mobilePortIds": []
      },
      "createdAt": "2026-10-05T14:03:11Z",
      "paidAt": "2026-10-05T14:03:11Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1,
    "totalPages": 1
  }
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/orders" \
  -H "Authorization: Bearer $API_KEY"
Python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/orders", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
Node.js
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

获取订单

GET/v1/orders/{orderId}

身份验证:在 Authorization: Bearer API_KEY 请求头中提供 API 密钥。

参数

名称位置类型必填说明
orderIdpathstring是—

响应 200 OK

{
  "id": "ord_4f8k2m9q",
  "status": "completed",
  "productId": "residential",
  "planId": "res-10",
  "planName": "Local team",
  "quantity": 1,
  "unitPrice": "7.50",
  "subtotal": "7.50",
  "discount": "0.00",
  "total": "7.50",
  "promoCode": null,
  "currency": "USD",
  "topUpId": null,
  "options": {},
  "fulfillment": {
    "residentialSubscriptionId": "res_9x2m4k",
    "mobilePortIds": []
  },
  "createdAt": "2026-10-05T14:03:11Z",
  "paidAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/orders/ord_4f8k2m9q" \
  -H "Authorization: Bearer $API_KEY"
Python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/orders/ord_4f8k2m9q", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
Node.js
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/orders/ord_4f8k2m9q`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

1 GB US$1.50 · 无需 KYC

查看价格