(Available from version 1.8) This operation returns CDN usage details for the account related to the API access key. Defaults: from = last billing date, to = end of current day.
filter | string 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:
For example: filter[0][field]=resource&filter[0][eq]=vod_streams |
from | string <date-time> 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 |
to | string <date-time> 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 |
object (account) Data for the account. | |
object The query parameters applied to the request. |
// Using cURL curl -H "wsc-api-key: ${WSC_API_KEY}" \ -H "wsc-access-key: ${WSC_ACCESS_KEY}" \ -H "Content-Type: application/json" \ -X "GET" \ "${WSC_HOST}/api/beta/usage/accounts"
{- "account": {
- "unique_viewers": 17058,
- "viewing_seconds": 44925498,
- "avg_viewing_seconds": 2634,
- "viewing_bytes": 22886,
- "egress_seconds": 49549,
- "egress_seconds_additional_targets": 345,
- "egress_bytes": 7066810
}, - "limits": {
- "resources": [
- "transcoders",
- "vod_streams"
], - "from": "2021-01-07T00:00:00.000Z",
- "to": "2021-10-05T00:00:00.000Z"
}
}
(Available from version 1.8) This operation returns CDN usage details by country for the account related to the API access key. CDN usage is the amount of data that went through every Fastly stream target, including unique viewers, viewing time, and bytes of content.
filter | string 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:
For example: filter[0][field]=resource&filter[0][eq]=vod_streams |
from | string <date-time> 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 |
to | string <date-time> 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 |
object (countries) | |
object The query parameters applied to the request. |
// Using cURL curl -H "wsc-api-key: ${WSC_API_KEY}" \ -H "wsc-access-key: ${WSC_ACCESS_KEY}" \ -H "Content-Type: application/json" \ -X "GET" \ "${WSC_HOST}/api/beta/usage/accounts/countries"
{- "countries": [
- {
- "code": "US",
- "name": "United States",
- "unique_viewers": 1,
- "viewing_seconds": 222,
- "avg_viewing_seconds": 222,
- "viewing_bytes": 12886
}, - {
- "code": "CA",
- "name": "Canada",
- "unique_viewers": 14,
- "viewing_seconds": 222,
- "avg_viewing_seconds": 16,
- "viewing_bytes": 22886
}
], - "limits": {
- "resources": [
- "transcoders",
- "vod_streams"
], - "from": "2021-01-07T00:00:00.000Z",
- "to": "2021-10-05T00:00:00.000Z"
}
}
(Available from version 1.8) This operation returns trend data for the CDN usage of the account related to the API access keys.
The granularity of sampled data changes based on the from and to query values you use:
1) Requests made for data within the past 30 days, return the following sample intervals:
2) Requests made for data beyond the past 30 days, always return sample intervals per hour.
Defaults: from = last billing date, to = end of current day, filter = transcoder and vod streams
filter | string 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:
For example: filter[0][field]=resource&filter[0][eq]=vod_streams |
from | string <date-time> 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 |
to | string <date-time> 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 |
object (Array of trends) An array of trend data | |
object The query parameters applied to the request. |
// Using cURL curl -H "wsc-api-key: ${WSC_API_KEY}" \ -H "wsc-access-key: ${WSC_ACCESS_KEY}" \ -H "Content-Type: application/json" \ -X "GET" \ "${WSC_HOST}/api/beta/usage/accounts/trend"
{- "trend": [
- {
- "sampled_at": "2022-03-01T00:00:00.000Z",
- "unique_viewers": 358,
- "viewing_seconds": 1288800,
- "viewing_bytes": 8483993
}, - {
- "sampled_at": "2022-03-02T00:00:00.000Z",
- "unique_viewers": 75,
- "viewing_seconds": 270000,
- "viewing_bytes": 6937994
}, - {
- "sampled_at": "2022-03-03T00:00:00.000Z",
- "unique_viewers": 400,
- "viewing_seconds": 1440000,
- "viewing_bytes": 3958503
}
], - "limits": {
- "resources": [
- "transcoders",
- "vod_streams"
], - "from": "2022-03-01T00:00:00.000Z",
- "to": "2022-03-05T00:00:00.000Z"
}
}
(Available from version 1.8) This operation returns the number of current viewers between all streams, live and VOD, for the account related to the API access key.
object (account) | |||||||||
|
// Using cURL curl -H "wsc-api-key: ${WSC_API_KEY}" \ -H "wsc-access-key: ${WSC_ACCESS_KEY}" \ -H "Content-Type: application/json" \ -X "GET" \ "${WSC_HOST}/api/beta/usage/accounts/live"
{- "account": {
- "id": "tvctq36g",
- "unique_viewers": 7,
- "countries": [
- {
- "code": "US",
- "unique_viewers": 4
}, - {
- "code": "DE",
- "unique_viewers": 3
}
], - "viewer_trend": [
- {
- "sampled_at": "2022-01-26T12:01:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:02:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:03:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:04:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:05:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:06:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:07:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:08:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:09:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:10:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:11:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:12:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:13:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:14:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:15:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:16:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:17:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:18:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:19:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:20:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:21:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:22:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:23:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:24:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:25:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:26:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:27:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:28:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:29:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:30:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:31:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:32:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:33:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:34:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:35:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:36:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:37:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:38:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:39:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:40:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:41:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:42:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:43:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:44:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:45:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:46:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:47:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:48:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:49:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:50:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:51:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:52:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:53:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:54:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:55:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:56:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:57:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:58:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T12:59:00.000Z",
- "unique_viewers": 7
}, - {
- "sampled_at": "2022-01-26T13:00:00.000Z",
- "unique_viewers": 7
}
]
}
}