Skip to main content
POST
/
account
/
queryTrafficUsage
cURL
curl --request POST \
  --url https://apiv1.cakeip.com/openapi/account/queryTrafficUsage \
  --header 'Content-Type: application/json' \
  --data '
{
  "appKey": "<string>",
  "type": "day",
  "startDay": "2024-01-01",
  "endDay": "2024-01-02",
  "provider": 2
}
'
{
  "code": 0,
  "msg": "查询成功",
  "data": [
    {
      "time": "2024-01-01",
      "traffic": 100.5
    },
    {
      "time": "2024-01-02",
      "traffic": 200.3
    }
  ],
  "total": 2,
  "sum": 300.8
}

Body

application/json

查询流量消耗请求

查询流量消耗请求参数

appKey
string
required

AppKey密钥

type
enum<string>
required

查询粒度:day=按天统计,5min=按5分钟统计

Available options:
day,
5min
Example:

"day"

startDay
string<date>
required

开始日期(格式:YYYY-MM-DD)

Example:

"2024-01-01"

endDay
string<date>
required

结束日期(格式:YYYY-MM-DD)

Example:

"2024-01-02"

provider
enum<integer>
default:2

池子类型:1=精选美区,2=全球混合

Available options:
1,
2
Example:

2

Response

流量消耗查询响应

流量消耗查询响应。data为数组格式,每条记录包含时间和流量值。时间格式根据查询粒度不同:type=day时为'YYYY-MM-DD',type=5min时为'YYYY-MM-DD HH:mm:ss'

code
enum<integer>
default:0
required

状态码,0为操作成功

Available options:
0,
-1
Example:

0

msg
string
required

响应消息

Example:

"查询成功"

data
object[]
required

流量使用记录列表

Example:
[
{ "time": "2024-01-01", "traffic": 100.5 },
{ "time": "2024-01-02", "traffic": 200.3 }
]
total
integer<int32>
required

记录数

Example:

2

sum
number<float>
required

总流量消耗(单位:MB)

Example:

300.8