UNLOCK API
getSpendingStats

getSpendingStats

回傳你在某個 UTC 日的每小時花費:任務數和金額。失敗和已退款的任務不計入。
POSThttps://unlock-api.com/getSpendingStats
date 是你要查詢那一天內的任意 Unix 時間。未提供時使用今天(UTC)。

請求參數

clientKey
String必填
你的 API 密鑰,32 個字元,在賬戶頁面上。
date
Integer選填
要查詢那一天內的 Unix 時間。預設:今天(UTC)。

請求

POST /getSpendingStats
{
  "clientKey": "YOUR_API_KEY",
  "date": 1791590400
}

回應

成功
{
  "errorId": 0,
  "data": [
    {
      "dateFrom": 1791590400,
      "dateTill": 1791593999,
      "volume": 120,
      "money": 0.066
    },
    {
      "dateFrom": 1791594000,
      "dateTill": 1791597599,
      "volume": 0,
      "money": 0
    }
  ]
}

回應欄位

errorId
Integer
請求成功時為 0,失敗時為 1。
data
Array
24 列,每小時一列:dateFrom、dateTill、volume(任務數)和 money(美元)。

代碼範例

curl -s https://unlock-api.com/getSpendingStats \
  -H "Content-Type: application/json" \
  -d '{"clientKey":"YOUR_API_KEY","date":1791590400}'

此方法可能回傳的錯誤