จุดเชื่อมต่อในหน้านี้
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 -s "https://localserpproxy.com/api/v1/catalog/products"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 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) จากนั้นหักยอดเงิน สร้างหรือต่ออายุบริการ และส่งคำสั่งซื้อกลับมาในสถานะ completed พร้อม fulfillment ข้อมูลพร็อกซีพร้อมใช้งานทันที
- ทราฟฟิกพร็อกซีเรซิเดนเชียลใหม่:
{ "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ได้ (ดูผู้ให้บริการเครือข่ายของแต่ละประเทศได้ที่ พอร์ตมือถือ) แพ็กเกจโซนครอบคลุมเฉพาะประเทศในโซนนั้น (422บนoptions.countryในกรณีอื่น) - ต่ออายุพอร์ตพร็อกซีมือถือ:
{ "planId": "mob-us-7d", "options": { "portId": "mob_2v8k1q" } }เพิ่มระยะเวลาของแพ็กเกจให้กับexpiresAt
ยอดเงินคงเหลือไม่พอ → 402 insufficient_balance โดยระบุยอดที่ขาดและยอดเติมเงินที่แนะนำใน error.details (missing, suggestedTopUp) จะไม่มีการหักเงินเมื่อเกิดข้อผิดพลาด หากต้องการชำระส่วนต่าง ให้เริ่มเติมเงินโดยแนบคำขอเดิมใน purchase (POST /v1/topups): ระบบจะซื้อแพ็กเกจทันทีเมื่อยอดเติมเงินเข้าบัญชี
การยืนยันตัวตน: ใช้คีย์ API ในส่วนหัว Authorization: Bearer API_KEY
พารามิเตอร์
| ชื่อ | ใน | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|---|
Idempotency-Key | header | string | ไม่ | คีย์ที่ไม่ซ้ำกัน (เช่น UUID) สำหรับลองส่ง POST ซ้ำอย่างปลอดภัย เก็บไว้ 24 h — สูงสุด 128 ตัวอักษร |
เนื้อหาคำขอ
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
planId | string | ใช่ | — |
quantity | integer | ไม่ | 1–100, ค่าเริ่มต้น 1 |
options | object | ไม่ | — |
{
"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 -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"}'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 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
การยืนยันตัวตน: ใช้คีย์ API ในส่วนหัว Authorization: Bearer API_KEY
พารามิเตอร์
| ชื่อ | ใน | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|---|
page | query | integer | ไม่ | ≥ 1 ค่าเริ่มต้น 1 |
perPage | query | integer | ไม่ | 1–100 ค่าเริ่มต้น 20 |
status | query | completed · cancelled | ไม่ | สร้างคำสั่งซื้อเป็นสถานะชำระเงินแล้ว (หักจากยอดเงินคงเหลือ) completed — ชำระแล้วและพร้อมใช้งาน (ข้อมูลพร็อกซีพร้อมใช้งานทันที) |
productId | query | string | ไม่ | รหัสผลิตภัณฑ์จากแค็ตตาล็อก ค่าของ LocalSERP Proxy: residential (GB), mobile (พอร์ต 4G/5G แบบเฉพาะ) และ mobile-gb (ทราฟฟิก 4G/5G แบบหมุนเวียนต่อ GB) ลูกค้าต้องรองรับค่าที่ไม่รู้จัก |
การตอบกลับ 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 -s "https://localserpproxy.com/api/v1/orders" \
-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}/orders", 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}/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}
การยืนยันตัวตน: ใช้คีย์ API ในส่วนหัว Authorization: Bearer API_KEY
พารามิเตอร์
| ชื่อ | ใน | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|---|
orderId | path | string | ใช่ | — |
การตอบกลับ 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 -s "https://localserpproxy.com/api/v1/orders/ord_4f8k2m9q" \
-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}/orders/ord_4f8k2m9q", 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}/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());