# 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. Endpoint: GET /usage/account Version: v2.0 ## Query parameters: - `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: The only valid filter is resource. The only valid filter operators are eq with values of transcoders or vod_streams or in with a value of transcoders,vod_streams. Filters use a zero-based index. For example: filter0=resource&filter0=vod_streams - `from` (string) 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) 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 - `include` (string) 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 200 fields (application/json): - `account` (object) Data for the account. Example: {"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}]} - `account.id` (string) The unique alphanumeric string that identifies an account. Example: "rfP7rDv2" - `account.viewing_seconds` (integer) The total length of time, in seconds, that the stream was played at the target. May be longer than the duration of the stream. Example: 44925498 - `account.viewing_bytes` (integer) The amount of content, in bytes, that went through the stream target during the selected time frame. Example: 22886 - `account.egress_seconds` (integer) The length of time, in seconds, that Wowza CDN on Fastly pulled from storage during the selected time frame. Example: 49549 - `account.egress_seconds_additional_targets` (integer) The length of time, in seconds, that additional stream targets pulled from storage during the selected time frame. Subscriptions prices include egress for one target; additional targets incur additional charges. Example: 345 - `account.egress_bytes` (integer) The amount of content, in bytes, that Wowza CDN on Fastly pulled from storage during the selected time frame. Example: 7066810 - `account.trend` (object) An array of viewer trend data. The granularity of sampled data changes based on the from and to query values you use: Requests made for data within the past 30 days, return the following sample intervals: 0 minutes to 3 hours - Samples returned per minute 3 hours, 1 second to 24 hours - Samples returned per hour 24 hours, 1 second to 90 days - Samples returned per day Defaults: from = last billing date, to = end of current day Example: [{"sampled_at":"2019-10-01T08:00:00.000Z","viewing_seconds":45,"viewing_bytes":20}] - `account.trend.sampled_at` (string) The date and time the trend data was sampled. - `account.trend.viewing_bytes` (integer) The amount of content, in bytes, that went through the transcoder during the selected time frame. - `limits` (object) The query parameters applied to the request. Example: {"resources":["transcoders","vod_streams"],"from":"2021-01-07T00:00:00.000Z","to":"2021-10-05T00:00:00.000Z"} - `limits.resources` (object) The resources represented in the response. Example: ["transcoders","vod_streams"] - `limits.resources.transcoders` (string) The response includes transcoders. - `limits.resources.vod_streams` (string) The response includes VOD streams. - `limits.from` (string) The start of the range of time represented in the response. Example: "2021-01-07T00:00:00.000Z" - `limits.to` (string) The end of the range of time represented in the response. Example: "2021-10-05T00:00:00.000Z" ## Response 401 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 403 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 404 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 410 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 422 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array)