Fetch usage for an account
(Available from version 1.8) This operation returns CDN usage details for the account related to the JSON web token used for API authentication. Defaults: from = last billing date, to = end of current day.
Query parameters
Restricts the data that gets returned by filtering on one or more values associated with a field. Construct a filter using a two-part expression that specifies the field on which to filter and the logic to use to filter. Keep in mind the following for account trend filters:
<ul><li>The only valid filter is **resource**.</li> <li>The only valid filter operators are **eq** with values of **transcoders** or **vod_streams** or **in** with a value of **transcoders,vod_streams**. </li> <li>Filters use a zero-based index.</li></ul>For example: filter[0][field]=resource&filter[0][eq]=vod_streams
The start of the range of time you want to view. Specify YYYY-MM-DD HH:00:00 where HH is a 24-hour clock in UTC. The range doesn't include minutes and seconds and rounds minutes up to the hour. The maximum difference between from and to is 90 days. If you set the from query parameter without setting the to query parameter, the data returned will reflect 90 days starting at the from date, or data up to to the current day, whichever is shorter.
You can also specify last_bill_date.
Default: last billing date
The end of the range of time you want to view. Specify YYYY-MM-DD HH:00:00 where HH is a 24-hour clock in UTC. The range doesn't include minutes and seconds and rounds minutes up to the hour. The maximum difference between from and to is 90 days. If you set the to query parameter without setting the from query parameter, the data returned will be from the past 90 days or from your last invoice date, whichever is shorter.
You can also specify last_bill_date.
Default: end of the current day
Specify the data you want returned in the response. You can send a comma-separated list of values.
Valid value is: trend.
Example: trend
Response
Success
Example response
{
"account": {
"id": "rfP7rDv2",
"viewing_seconds": 44925498,
"avg_viewing_seconds": 2634,
"viewing_bytes": 22886,
"egress_seconds": 49549,
"egress_seconds_additional_targets": 345,
"egress_bytes": 7066810,
"trend": [
{
"sampled_at": "2019-10-01T08:00:00.000Z",
"viewing_seconds": 45,
"viewing_bytes": 20
}
]
},
"limits": {
"resources": [
"transcoders",
"vod_streams"
],
"from": "2021-01-07T00:00:00.000Z",
"to": "2021-10-05T00:00:00.000Z"
}
}