跳到主要內容
panelhi
登入註冊
選單

API v2

串接您自己的面板、機器人或腳本。API採用大多數SMM面板使用的格式,現有的串接通常只要換掉網址和金鑰就能用。

網址和金鑰

所有請求都用POST送到下方網址,表單或JSON格式都可以。所有回應都是JSON。

在會員中心的API建立金鑰。每個請求都要在key欄位帶上它。

取得API金鑰
端點
https://panelhi.com/api/v2
方法
POST (application/x-www-form-urlencoded, application/json)

動作

服務清單

action=services

回傳所有服務,包含ID、名稱、分類、每1,000個的價格、數量範圍,以及能否補量和取消。

欄位說明
key您的API金鑰
action動作名稱
POST https://panelhi.com/api/v2
key=phi_••••••••&action=services

回應範例

[
  {
    "service": 153,
    "name": "YouTube Views · Quick",
    "type": "Default",
    "platform": "youtube",
    "category": "YouTube Views",
    "rate": "0.4550",
    "min": 500,
    "max": 1000000,
    "refill": false,
    "cancel": true
  }
]

新增訂單

action=add

送出訂單並從餘額扣除總金額。回傳訂單編號。

欄位說明
key您的API金鑰
action動作名稱
service服務ID
link公開連結
quantity服務數量範圍內的整數
POST https://panelhi.com/api/v2
key=phi_••••••••&action=add&service=153&link=https://www.youtube.com/watch?v=Xb7mQ2kLp4s&quantity=5000

回應範例

{ "order": "48302917" }

訂單狀態

action=status

查詢一筆訂單(order),或用逗號分隔最多100筆訂單(orders)的狀態。

欄位說明
key您的API金鑰
action動作名稱
order訂單編號
orders訂單編號,用逗號分隔
POST https://panelhi.com/api/v2
key=phi_••••••••&action=status&order=48302917

回應範例

{
  "charge": "2.2750",
  "start_count": 0,
  "status": "Pending",
  "remains": 5000,
  "currency": "USD"
}

餘額

action=balance

目前的餘額,單位為美元。

欄位說明
key您的API金鑰
action動作名稱
POST https://panelhi.com/api/v2
key=phi_••••••••&action=balance

回應範例

{ "balance": "84.2150", "currency": "USD" }

取消訂單

action=cancel

取消等待中的訂單,最多100筆,用逗號分隔。金額退回餘額。

欄位說明
key您的API金鑰
action動作名稱
orders訂單編號,用逗號分隔
POST https://panelhi.com/api/v2
key=phi_••••••••&action=cancel&orders=48302917,48302955

回應範例

[
  {
    "order": "48302917",
    "cancel": 1
  },
  {
    "order": "48302955",
    "cancel": {
      "error": "Order cannot be canceled"
    }
  }
]

申請補量

action=refill

為有補量選項、已完成或部分完成的訂單,在期間內申請補量。

欄位說明
key您的API金鑰
action動作名稱
order訂單編號
POST https://panelhi.com/api/v2
key=phi_••••••••&action=refill&order=48302917

回應範例

{ "refill": "R4410592" }

補量狀態

action=refill_status

依補量申請編號查詢狀態。

欄位說明
key您的API金鑰
action動作名稱
refill補量申請編號
POST https://panelhi.com/api/v2
key=phi_••••••••&action=refill_status&refill=R4410592

回應範例

{ "status": "Pending" }

狀態值

訂單狀態有Pending、In progress、Completed、Partial、Canceled。補量申請的狀態為Pending、Completed或Rejected。

錯誤

請求失敗時會回傳error欄位,例如Invalid API key、Invalid service、Invalid link、Quantity out of range或Not enough funds on balance。

限制

每組金鑰每分鐘最多300個請求。錯誤的金鑰每個網路10分鐘內最多嘗試30次。