Skip to main content

Retrieve Time Series Stats - API

GET 

/api/v1/stats/timeseries/api

REQUEST PARAMETERS

keyValueDescription
stat_typestringapi, addons, transcodes, storage or cdn
stat_subtypestring(Optional) See below
start_timeintegerearliest time as UTC timestamp, like 1652129843. Minimum can be upto 364 days in the past from current time. Maximum can be current time.
end_timelatest time as UTC timestamp, like 1716150001. Minimum can be upto 364 days in the past from current time. Maximum can be current time.

stat_subtype parameter

This allows filtering response for specific API, addon, etc.

If stat_type=api

  • stat_subtype can be a specific api like /api/v1/assets/{ASSET_ID}/data
  • Note this must be url encoded when sent as query parameter, like, stat_subtype=%2Fapi%2Fv1%2Fassets%2F%7BASSET_ID%7D%2Fdata

If stat_type=addons

  • stat_subtype can be specific addon like REMOVE_BACKGROUND

If stat_type=transcodes

  • stat_subtype is not needed

if stat_type= storage

  • stat_subtype should be ASSET

If stat_type=cdn

  • stat_subtype can be traffic, request

RESPONSE JSON

The API call will return with a JSON response as below.

When user_id is not sent in parameters, the API returns consolidated stats for the user group. user_id will be set to * in this case.

{
"usergroup_id": 42,
"stat_type": "api",
"stat_subtype": "/api/v1/assets/{ASSET_ID}/data",
"start_time": "1742507272",
"end_time": "1738294624",
"data": {
"*": [
{
"timestamp": 1738294624,
"value": 238
},
{
"timestamp": 1740715993,
"value": 18
}
]
}
}

When user_id is sent in parameters, the API returns stats for the user. user_id will be set to appropriate id in this case as below.

{
"usergroup_id": 42,
"stat_type": "api",
"stat_subtype": "/api/v1/assets/{ASSET_ID}/data",
"start_time": "1742507272",
"end_time": "1738294624",
"data": {
"*": [
{
"timestamp": 1738294624,
"value": 238
},
{
"timestamp": 1740715993,
"value": 18
}
]
}
}
keyValueDescription
usergroup_idintegerUser group id
stat_typestringSee above
stat_subtypestringSee above
start_timeintegerearliest time as UTC timestamp, like 1652129843
end_timelatest time as UTC timestamp, like 1716150001
dataJSONJSON with user_id as key. * for consolidated stats for all users (default)
timestamp and valueListKey-Value pairs with UTC timestamp and value for the requested stat

Request

Responses

Successful operation