跳到內容
proxyday

代理 API 文件

使用 ProxyDay REST API,從您自己的程式讀取餘額和連線資料、查詢價格、以餘額下單,以及建立代理使用者名稱。

如何開始?

  1. 1註冊並登入控制台。
  2. 2開啟「連線」並建立 API 金鑰。完整金鑰只會顯示一次,請複製到安全的地方。
  3. 3在每個需要金鑰的請求中,用 Authorization 標頭傳送金鑰。
  4. 4呼叫 /account 確認金鑰可用,再用 /orders 下單。

驗證方式

與您帳號相關的請求(account、orders、proxy-user)需要 API 金鑰,請以 Bearer token 放在 Authorization 標頭中送出。價格、國家和試算是公開的,不需要金鑰。

我們只儲存金鑰的雜湊值。若遺失金鑰,請在控制台建立新的,舊金鑰會立即失效。請勿把金鑰放在瀏覽器端程式碼或公開的程式庫中。

HTTP header
Authorization: Bearer pdk_your_api_key

基本網址與格式

基本 URL
https://proxyday.shop/api/v1
請求與回應內容
application/json
金額
美元數字,例如 807.90
時間
ISO 8601 (UTC)

有呼叫次數限制嗎?

每組 API 金鑰每分鐘最多可送出 60 個請求。公開端點每個 IP 每分鐘可送出 60 個請求。超過上限會收到 HTTP 429,請等一分鐘後再試。

錯誤會以什麼形式回傳?

錯誤會以 HTTP 狀態碼回傳,並附上含簡短代碼和訊息的 JSON 內容。

範例
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low for this order. Top up in the dashboard."
  }
}
HTTPcode說明
400bad_request缺少某個值,或此產品不允許該值。
401unauthorized缺少 API 金鑰或金鑰無效。
402insufficient_balance餘額低於訂單總額,未扣任何費用。
404not_found您的帳號中沒有此 id 的訂單。
429rate_limited一分鐘內的請求太多。
500server_error請求無法完成,未扣任何費用。

端點

取得帳號資料

GET/api/v1/accountAPI 金鑰

回傳您的餘額、代理主機、連接埠、使用者名稱和密碼,以及允許的 IP。

請求
curl https://proxyday.shop/api/v1/account \
  -H "Authorization: Bearer pdk_your_api_key"
回應
{
  "email": "you@example.com",
  "balance_usd": 1300,
  "proxy": {
    "host": "gate.proxyday.shop",
    "http_port": 6100,
    "socks5_port": 6200,
    "username": "pdexample1",
    "password": "your_password"
  },
  "allowed_ips": [
    "203.0.113.10"
  ]
}

列出產品與價格

GET/api/v1/products不需金鑰

回傳所有產品及其限制、價格級距和折扣。價格與價格頁面使用同一張表。

請求
curl https://proxyday.shop/api/v1/products
回應
{
  "currency": "USD",
  "prices_as_of": "2026-10-31",
  "products": [
    {
      "id": "unlimited",
      "unit": "day",
      "quantity": {
        "meaning": "days",
        "min": 1,
        "max": 365
      },
      "...": "..."
    },
    {
      "id": "residential",
      "unit": "gb",
      "...": "..."
    }
  ]
}

列出國家與城市

GET/api/v1/countries不需金鑰

回傳某產品可用的國家,以及可放入代理使用者名稱的城市值。

欄位說明
product選填unlimited、residential、isp 或 datacenter。預設為 residential。
請求
curl "https://proxyday.shop/api/v1/countries?product=datacenter"
回應
{
  "product": "datacenter",
  "countries": [
    {
      "code": "us",
      "name": "United States",
      "region": "americas",
      "datacenter": true,
      "cities": [
        {
          "name": "New York",
          "value": "new_york"
        },
        {
          "name": "Los Angeles",
          "value": "los_angeles"
        }
      ]
    }
  ]
}

取得報價

POST/api/v1/quote不需金鑰

計算訂單總額,不會扣款。請使用與下單相同的內容。

欄位說明
product必填unlimited、residential、isp 或 datacenter。
quantity必填unlimited 為天數(1~365),residential 為 GB(5~5,000),isp(1~1,000)或 datacenter(5~5,000)為 IP 數。
concurrency選填僅限 unlimited:200、500、1000 或 2000。
bandwidth選填僅限 unlimited,單位 Mbps:100、200、500 或 1000。
months選填僅限 isp 和 datacenter:1、3、6 或 12。
country選填僅限 isp 和 datacenter:兩個字母的國家代碼,例如 jp。請參考 /countries。
請求
curl -X POST https://proxyday.shop/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
回應
{
  "product": "unlimited",
  "quantity": 30,
  "unit_price_usd": 8.6,
  "unit": "day",
  "total_usd": 258
}

下單

POST/api/v1/ordersAPI 金鑰

從餘額扣除總額並建立訂單。新訂單一開始為 pending(啟用中),準備好後變為 active。若訂單無法啟用,會變為 refunded,全額退回餘額。餘額不足時回傳 402。

欄位說明
product必填unlimited、residential、isp 或 datacenter。
quantity必填unlimited 為天數(1~365),residential 為 GB(5~5,000),isp(1~1,000)或 datacenter(5~5,000)為 IP 數。
concurrency選填僅限 unlimited:200、500、1000 或 2000。
bandwidth選填僅限 unlimited,單位 Mbps:100、200、500 或 1000。
months選填僅限 isp 和 datacenter:1、3、6 或 12。
country選填僅限 isp 和 datacenter:兩個字母的國家代碼,例如 jp。請參考 /countries。
請求
curl -X POST https://proxyday.shop/api/v1/orders \
  -H "Authorization: Bearer pdk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
回應
{
  "order": {
    "id": "PD-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.6,
    "total_usd": 258,
    "status": "pending",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:12:44.120Z"
  },
  "balance_usd": 1042
}

列出您的訂單

GET/api/v1/ordersAPI 金鑰

回傳最近 100 筆訂單,最新的排在最前面。

欄位說明
status選填pending、active 或 refunded。不填則回傳全部。
請求
curl "https://proxyday.shop/api/v1/orders?status=pending" \
  -H "Authorization: Bearer pdk_your_api_key"
回應
{
  "orders": [
    {
      "id": "PD-7KQ2M-X4HTD",
      "product": "unlimited",
      "quantity": 30,
      "months": null,
      "concurrency": 1000,
      "bandwidth_mbps": 200,
      "country": null,
      "unit_price_usd": 8.6,
      "total_usd": 258,
      "status": "pending",
      "created_at": "2026-10-31T09:12:44.120Z",
      "updated_at": "2026-10-31T09:12:44.120Z"
    }
  ]
}

取得單筆訂單

GET/api/v1/orders/{id}API 金鑰

依 id 回傳一筆訂單,例如用來確認是否已啟用。

欄位說明
id必填訂單 id,例如 PD-7KQ2M-X4HTD。
請求
curl https://proxyday.shop/api/v1/orders/PD-7KQ2M-X4HTD \
  -H "Authorization: Bearer pdk_your_api_key"
回應
{
  "order": {
    "id": "PD-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.6,
    "total_usd": 258,
    "status": "active",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:40:02.511Z"
  }
}

建立代理使用者名稱

GET/api/v1/proxy-userAPI 金鑰

回傳帶有您選項的代理使用者名稱,以及可直接使用的 HTTP 和 SOCKS5 代理網址。不填 session 時,每個請求都會輪換 IP。

欄位說明
product選填unlimited、residential、isp 或 datacenter。預設為 unlimited。
country選填兩個字母的國家代碼,例如 jp。
city選填來自 /countries 的城市值,例如 tokyo。需同時指定 country。
session選填任意 1~32 個英文字母或數字。使用相同 session 的請求會保持同一個 IP。
ttl選填工作階段 IP 保持的分鐘數,1~60。預設為 30。
請求
curl "https://proxyday.shop/api/v1/proxy-user?product=residential&country=jp&city=tokyo&session=job42&ttl=30" \
  -H "Authorization: Bearer pdk_your_api_key"
回應
{
  "username": "pdexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30",
  "password": "your_password",
  "http": "http://pdexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.proxyday.shop:6100",
  "socks5": "socks5h://pdexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.proxyday.shop:6200"
}

完整範例

這些範例會查詢價格、以餘額下單,並透過日本 IP 連線。

Python (requests)
import requests

API = "https://proxyday.shop/api/v1"
HEAD = {"Authorization": "Bearer pdk_your_api_key"}

# 1) Check the price first
plan = {"product": "residential", "quantity": 100}
print(requests.post(f"{API}/quote", json=plan).json())

# 2) Order from your balance
r = requests.post(f"{API}/orders", json=plan, headers=HEAD)
order = r.json()["order"]
print(order["id"], order["status"])

# 3) Get a username for Japanese IPs
u = requests.get(f"{API}/proxy-user", headers=HEAD,
                 params={"product": "residential", "country": "jp"}).json()
proxies = {"http": u["http"], "https": u["http"]}
print(requests.get("https://ipinfo.io/json", proxies=proxies, timeout=30).json())
Node.js 18+
const API = "https://proxyday.shop/api/v1";
const HEAD = { Authorization: "Bearer pdk_your_api_key", "Content-Type": "application/json" };

// Check the balance
const acc = await fetch(`${API}/account`, { headers: HEAD }).then((r) => r.json());
console.log(acc.balance_usd);

// Order 7 days of unlimited
const res = await fetch(`${API}/orders`, {
  method: "POST",
  headers: HEAD,
  body: JSON.stringify({ product: "unlimited", quantity: 7, concurrency: 500, bandwidth: 100 }),
});
if (res.status === 402) console.log("Top up first");
else console.log((await res.json()).order.id);

透過 API 下的訂單與控制台下的訂單相同,都會出現在「紀錄」中。請把 pdk_your_api_key 換成您自己的金鑰。

將 ProxyDay 串接到您自己的系統

建立帳號後,在控制台產生 API 金鑰。