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

API 参考

住宅代理和凭据

管理流量订阅(住宅代理和按 GB 计费的轮换式 4G/5G):代理凭据、拥有独立凭据和流量上限的子用户、每日用量,以及可在代理用户名中指定的目标位置。

10 分钟阅读

本页端点

  • GET /v1/residential/subscriptions:列出流量订阅(住宅代理和按 GB 计费的轮换移动代理)
  • GET /v1/residential/subscriptions/{subscriptionId}:获取住宅代理订阅
  • PATCH /v1/residential/subscriptions/{subscriptionId}:重命名或切换自动续订
  • POST /v1/residential/subscriptions/{subscriptionId}/reset-password:为主用户生成新的代理密码
  • GET /v1/residential/subscriptions/{subscriptionId}/usage:每日流量用量
  • GET /v1/residential/subscriptions/{subscriptionId}/sub-users:列出子用户(拥有独立代理凭据和流量上限)
  • POST /v1/residential/subscriptions/{subscriptionId}/sub-users:创建子用户
  • PATCH /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}:更新子用户(标签、流量上限、启用/停用、新密码)
  • DELETE /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}:删除子用户
  • GET /v1/catalog/countries:产品可用的国家/地区
  • GET /v1/catalog/countries/{countryCode}/states:国家/地区内可定位的州/省(US、CA、AU…)
  • GET /v1/catalog/countries/{countryCode}/cities:国家/地区内可定位的城市
  • GET /v1/catalog/countries/{countryCode}/asns:国家/地区内可定位的 ISP(ASN)——仅限住宅代理

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

粘性会话

在代理用户名中添加 -session-{id}-ttl-{minutes},即可保持使用同一 IP:{id} 是由你选择的 1–32 个字母或数字,ttl 为 1–30 分钟。IP 可能提前更换,例如其背后的设备离线时。

列出流量订阅(住宅代理和按 GB 计费的轮换移动代理)

GET/v1/residential/subscriptions

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

参数

名称位置类型必填说明
productIdqueryresidential · mobile-gb否仅限此产品(未指定:两者)。

响应 200 OK

{
  "data": [
    {
      "id": "res_9x2m4k",
      "productId": "residential",
      "label": "Residential #1",
      "planId": "res-10",
      "status": "active",
      "trafficTotalBytes": 10000000000,
      "trafficUsedBytes": 2350000000,
      "trafficRemainingBytes": 7650000000,
      "expiresAt": null,
      "autoRenew": false,
      "username": "u7k2m9",
      "password": "PASSWORD",
      "endpoint": {
        "host": "gw.localserpproxy.com",
        "httpPort": 7777,
        "socksPort": 7778
      },
      "subUserCount": 1,
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ]
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions" \
  -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}/residential/subscriptions", 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}/residential/subscriptions`, {
  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/residential/subscriptions/{subscriptionId}

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

参数

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

响应 200 OK

{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k" \
  -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}/residential/subscriptions/res_9x2m4k", 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}/residential/subscriptions/res_9x2m4k`, {
  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());

重命名或切换自动续订

PATCH/v1/residential/subscriptions/{subscriptionId}

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

参数

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

请求正文

字段类型必填说明
labelstring否最多 60 个字符
autoRenewboolean否—
示例
{
  "label": "Price monitoring",
  "autoRenew": true
}

响应 200 OK

{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s -X PATCH "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Price monitoring","autoRenew":true}'
Python
import os
import requests

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

r = requests.patch(f"{API}/residential/subscriptions/res_9x2m4k", headers=HEADERS, json={"label": "Price monitoring", "autoRenew": True}, 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}/residential/subscriptions/res_9x2m4k`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ label: 'Price monitoring', autoRenew: true }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

为主用户生成新的代理密码

POST/v1/residential/subscriptions/{subscriptionId}/reset-password

旧密码会在 60 秒内在网关失效。

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

参数

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

响应 200 OK

{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s -X POST "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/reset-password" \
  -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.post(f"{API}/residential/subscriptions/res_9x2m4k/reset-password", 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}/residential/subscriptions/res_9x2m4k/reset-password`, {
  method: 'POST',
  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/residential/subscriptions/{subscriptionId}/usage

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

参数

名称位置类型必填说明
subscriptionIdpathstring是—
fromquerystring (date)否首日(UTC),包含当天。默认值 = to 前 29 天。
toquerystring (date)否末日(UTC),包含当天。默认值 = 今天。最长范围为 366 天。
subUserIdquerystring否限制为单个子用户。

响应 200 OK

{
  "from": "2026-10-04",
  "to": "2026-10-05",
  "totalBytes": 2350000000,
  "totalRequests": 48210,
  "points": [
    {
      "date": "2026-10-04",
      "bytes": 1200000000,
      "requests": 24800
    },
    {
      "date": "2026-10-05",
      "bytes": 1150000000,
      "requests": 23410
    }
  ],
  "byCountry": [
    {
      "country": "US",
      "bytes": 2350000000
    }
  ]
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/usage" \
  -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}/residential/subscriptions/res_9x2m4k/usage", 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}/residential/subscriptions/res_9x2m4k/usage`, {
  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/residential/subscriptions/{subscriptionId}/sub-users

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

参数

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

响应 200 OK

{
  "data": [
    {
      "id": "sub_3m9qk2",
      "label": "Client A",
      "username": "u7k2m9_scraper",
      "password": "PASSWORD",
      "trafficLimitBytes": 5000000000,
      "trafficUsedBytes": 1200000000,
      "enabled": true,
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ],
  "limit": 50
}

代码示例

curl
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users" \
  -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}/residential/subscriptions/res_9x2m4k/sub-users", 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}/residential/subscriptions/res_9x2m4k/sub-users`, {
  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());

创建子用户

POST/v1/residential/subscriptions/{subscriptionId}/sub-users

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

参数

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

请求正文

字段类型必填说明
labelstring是最多 60 个字符
passwordstring否留空时自动生成。— 最长 64 个字符
trafficLimitBytesinteger (int64), nullable否≥ 0
示例
{
  "label": "Scraper EU",
  "trafficLimitBytes": 5000000000
}

响应 201 Created

{
  "id": "sub_3m9qk2",
  "label": "Client A",
  "username": "u7k2m9_scraper",
  "password": "PASSWORD",
  "trafficLimitBytes": 5000000000,
  "trafficUsedBytes": 1200000000,
  "enabled": true,
  "createdAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s -X POST "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Scraper EU","trafficLimitBytes":5000000000}'
Python
import os
import requests

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

r = requests.post(f"{API}/residential/subscriptions/res_9x2m4k/sub-users", headers=HEADERS, json={"label": "Scraper EU", "trafficLimitBytes": 5000000000}, 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}/residential/subscriptions/res_9x2m4k/sub-users`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ label: 'Scraper EU', trafficLimitBytes: 5000000000 }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

更新子用户(标签、流量上限、启用/停用、新密码)

PATCH/v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}

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

参数

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

请求正文

字段类型必填说明
labelstring否最多 60 个字符
trafficLimitBytesinteger (int64), nullable否≥ 0
enabledboolean否—
regeneratePasswordboolean否—
示例
{
  "enabled": false
}

响应 200 OK

{
  "id": "sub_3m9qk2",
  "label": "Client A",
  "username": "u7k2m9_scraper",
  "password": "PASSWORD",
  "trafficLimitBytes": 5000000000,
  "trafficUsedBytes": 1200000000,
  "enabled": true,
  "createdAt": "2026-10-05T14:03:11Z"
}

代码示例

curl
curl -s -X PATCH "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'
Python
import os
import requests

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

r = requests.patch(f"{API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2", headers=HEADERS, json={"enabled": False}, 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}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ enabled: false }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

删除子用户

DELETE/v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}

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

参数

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

响应 204 No Content

无请求正文:状态码即为答案。

代码示例

curl
curl -s -X DELETE "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2" \
  -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.delete(f"{API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.status_code)  # 204: done
Node.js
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(res.status); // 204: done

产品可用的国家/地区

GET/v1/catalog/countries

公开接口:无需 API 密钥。

参数

名称位置类型必填说明
productquerystring否仅限该产品可用的地区(residential、mobile、mobile-gb)。

响应 200 OK

{
  "data": [
    {
      "code": "US",
      "name": "United States",
      "region": "Americas",
      "products": [
        "residential",
        "mobile",
        "mobile-gb"
      ],
      "cities": 6,
      "asns": 4,
      "carriers": 3
    }
  ]
}

代码示例

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

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

r = requests.get(f"{API}/catalog/countries", 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/countries`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

一个国家/地区中可定位的州/省(US、CA、AU…)

GET/v1/catalog/countries/{countryCode}/states

-state-{state} 用户名字段的取值。没有州/省定位的国家/地区返回空列表。不列出 ZIP code:-zip-{zip} 字段接受任意 5 位 US ZIP code;如果没有匹配的出口 IP,网关会返回错误页面。

公开接口:无需 API 密钥。

参数

名称位置类型必填说明
countryCodepathstring是ISO 3166-1 alpha-2,使用大写字母。

响应 200 OK

{
  "data": [
    {
      "id": "ny",
      "code": "NY",
      "name": "New York",
      "cities": 0
    }
  ]
}

代码示例

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

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

r = requests.get(f"{API}/catalog/countries/US/states", 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/countries/US/states`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

一个国家/地区中可定位的城市

GET/v1/catalog/countries/{countryCode}/cities

使用 product=mobile 或 product=mobile-gb 时,仅限有 4G/5G 调制解调器的城市。

公开接口:无需 API 密钥。

参数

名称位置类型必填说明
countryCodepathstring是ISO 3166-1 alpha-2,使用大写字母。
productquerystring否仅限该产品可用的地区(residential、mobile、mobile-gb)。

响应 200 OK

{
  "data": [
    {
      "id": "new_york",
      "name": "New York",
      "state": "ny"
    }
  ]
}

代码示例

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

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

r = requests.get(f"{API}/catalog/countries/US/cities", 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/countries/US/cities`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());

一个国家/地区中可定位的 ISP(ASN)——仅限住宅代理

GET/v1/catalog/countries/{countryCode}/asns

公开接口:无需 API 密钥。

参数

名称位置类型必填说明
countryCodepathstring是ISO 3166-1 alpha-2,使用大写字母。

响应 200 OK

{
  "data": [
    {
      "asn": 7922,
      "name": "Comcast Cable"
    }
  ]
}

代码示例

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

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

r = requests.get(f"{API}/catalog/countries/US/asns", 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/countries/US/asns`);
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

查看价格