本页端点
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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
productId | query | residential · 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 -s "https://localserpproxy.com/api/v1/residential/subscriptions" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
响应 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 -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
请求正文
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
label | string | 否 | 最多 60 个字符 |
autoRenew | boolean | 否 | — |
{
"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 -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}'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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
响应 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 -s -X POST "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/reset-password" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
from | query | string (date) | 否 | 首日(UTC),包含当天。默认值 = to 前 29 天。 |
to | query | string (date) | 否 | 末日(UTC),包含当天。默认值 = 今天。最长范围为 366 天。 |
subUserId | query | string | 否 | 限制为单个子用户。 |
响应 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 -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/usage" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
响应 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 -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
请求正文
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
label | string | 是 | 最多 60 个字符 |
password | string | 否 | 留空时自动生成。— 最长 64 个字符 |
trafficLimitBytes | integer (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 -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}'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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
subUserId | path | string | 是 | — |
请求正文
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
label | string | 否 | 最多 60 个字符 |
trafficLimitBytes | integer (int64), nullable | 否 | ≥ 0 |
enabled | boolean | 否 | — |
regeneratePassword | boolean | 否 | — |
{
"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 -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}'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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
subscriptionId | path | string | 是 | — |
subUserId | path | string | 是 | — |
响应 204 No Content
无请求正文:状态码即为答案。
代码示例
curl -s -X DELETE "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2" \
-H "Authorization: Bearer $API_KEY"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
product | query | string | 否 | 仅限该产品可用的地区(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 -s "https://localserpproxy.com/api/v1/catalog/countries"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
countryCode | path | string | 是 | ISO 3166-1 alpha-2,使用大写字母。 |
响应 200 OK
{
"data": [
{
"id": "ny",
"code": "NY",
"name": "New York",
"cities": 0
}
]
}代码示例
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/states"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
countryCode | path | string | 是 | ISO 3166-1 alpha-2,使用大写字母。 |
product | query | string | 否 | 仅限该产品可用的地区(residential、mobile、mobile-gb)。 |
响应 200 OK
{
"data": [
{
"id": "new_york",
"name": "New York",
"state": "ny"
}
]
}代码示例
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/cities"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 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 密钥。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
countryCode | path | string | 是 | ISO 3166-1 alpha-2,使用大写字母。 |
响应 200 OK
{
"data": [
{
"asn": 7922,
"name": "Comcast Cable"
}
]
}代码示例
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/asns"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 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());