> For the complete documentation index, see [llms.txt](https://doc.thordata.com/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.thordata.com/doc/zh-hk/pa-qu/serp-api/cha-xun-can-shu/token-peieyong-liang-cha-xun-jie-mian-wen-jian.md).

# Token 配額用量查詢介面文件

### 介面說明

依據 token\_id 查詢權杖的 SERP 配額消耗彙總，回傳總配額、剩餘額度以及各產品明細。

**請求位址**：<https://openapi.thordata.com/api/serp_api/token/usage_summary>&#x20;

**請求方式**：POST

#### 請求參數

表格

| 參數    | 型別     | 必填 | 說明                                 |
| ----- | ------ | -- | ---------------------------------- |
| token | string | 是  | 身分驗權，於我的帳戶‑API 取得                  |
| token | string | 是  | 欲查詢用量的目標權杖，於 serp api‑api token 取得 |

#### CURL 範例

```
curl --request POST \
  --url http://api-dev-test.thordata.com/api/serp_api/token/usage_summary \
  --header 'token: 你的驗權權杖' \
  --form 'token=需要查詢用量的目標權杖'
```

#### 成功回應範例

```
{
 "code": 0,
 "msg": "success",
 "data": {
 "token_id": 1024,
 "token_name": "Your TokenName",
 "flow_limit": 100000,
 "flow_used": 3200,
 "flow_remain": 96800,
 "products": [
 { "product": "serp", "flow_limit": 100000, "flow_used": 3200, "flow_remain": 96800 }
 ]
 }
}
```

#### 回應欄位說明

表格

| 欄位           | 型別     | 說明                 |
| ------------ | ------ | ------------------ |
| token\_id    | int    | 權杖 ID              |
| token\_name  | string | 權杖名稱               |
| flow\_limit  | int64  | SERP 配額上限，0 代表無限制  |
| flow\_used   | int64  | SERP 已消耗配額         |
| flow\_remain | int64  | SERP 剩餘配額；‑1 代表無限制 |
| products     | array  | 各產品消耗明細陣列          |
| product      | string | 產品識別碼              |
