查詢PV數據
更新時間 2023-11-02 14:15:59
最近更新時間: 2023-11-02 14:15:59
分享文章
接口描述:調用本接口查詢PV數據
請求方式:post
請求路徑:/statistics/query-pv-data
使用說明:
- 單個用戶一分鐘限制調用10000次,并發不超過100;
- 單次查詢輸入域名的個數不能超過100個;
- 按時間粒度5分鐘返回數據,數據延遲時間20分鐘,可查詢歷史數據時間范圍為最近183天,支持最大時間跨度31天
- 若查詢結束時間不包含在該批次的最后一秒,默認end_time為該批次最后一秒,例如:時間粒度為1h,end_time設置為17:30對應的時間戳,此時end_time默認成17:59:59;
- 時間片統計數據均為前打點,假如time_stamp= "2021-10-13 00:00"對應的時間戳,表示統計的數據為時間區間[2021-10-13 00:00, 2021-10-13 00:05)
請求參數說明(json):
| 參數 | 類型 | 是否必傳 | 名稱 | 描述 |
|---|---|---|---|---|
| domain | list< string > | 否 | 域名 | 域名列表 |
| start_time | int | 是 | 開始時間戳 | 開始時間戳,單位秒 |
| end_time | int | 是 | 結束時間戳 | 結束時間戳,單位秒 |
| httpProtocol | int | 否 | 協議類型 | 協議類型,不傳默認全部協議類型。 0(http),1(https) |
返回參數說明:
| 參數 | 類型 | 是否必傳 | 名稱及描述 |
|---|---|---|---|
| code | int | 是 | 狀態碼 |
| message | string | 是 | 描述信息 |
| result | list< object > | 否 | 每個時間間隔的結果 |
| result[*].timestamp | int | 否 | 時間片開始時間戳 |
| result[*].pv_count | int | 否 | pv |
示例:
請求路徑://cdnapi-global.ctapi.daliqc.cn/statistics/query-pv-data
請求參數:
{
"start_time": 1662413100,
"end_time": 1662413700,
"domain": [
"aaa.daliqc.cn",
"bbb.daliqc.cn"
],
"httpProtocol": 1
}
返回結果:
{
"code": 100000,
"message": "success",
"result": [
{
"pv_count": 3020171,
"timestamp": 1662706800
},
{
"pv_count": 2993556,
"timestamp": 1662707100
},
{
"pv_count": 2943798,
"timestamp": 1662707400
},
{
"pv_count": 2879866,
"timestamp": 1662707700
},
{
"pv_count": 2865421,
"timestamp": 1662708000
}
]
}
錯誤碼請參考:參數code和message含義