# Fetch usage for a single stream target (Available from version 1.4) This operation returns CDN usage details for a specific stream target. Defaults: from = last billing date, to = end of current day. Endpoint: GET /usage/stream_targets/{id} Version: v2.0 ## Path parameters: - `id` (string, required) The unique alphanumeric string that identifies the stream target. ## Query parameters: - `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): - `stream_target` (object) Example: {"id":"tvctq36g","name":"My Stream Target","archived":true,"type":"fastly","viewing_seconds":44925498,"viewing_bytes":22886,"trend":[{"sampled_at":"2019-10-01T08:00:00.000Z","viewing_seconds":45,"viewing_bytes":20}],"zones":[{"name":"global","type":"fastly","viewing_bytes":22886}]} - `stream_target.id` (string) The unique alphanumeric string that identifies the stream target. Example: "tvctq36g" - `stream_target.name` (string) A descriptive name for the stream target. Maximum 255 characters. Example: "My Stream Target" - `stream_target.archived` (boolean) A value of true indicates that the stream target has been removed from Wowza Video. Example: true - `stream_target.type` (string) The type of stream target. fastly is a Wowza CDN on Fastly target. Enum: "fastly" - `stream_target.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 - `stream_target.viewing_bytes` (integer) The amount of content, in bytes, that went through the stream target during the selected time frame. Example: 22886 - `stream_target.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}] - `stream_target.trend.sampled_at` (string) The date and time the trend data was sampled. - `stream_target.trend.viewing_bytes` (integer) The amount of content, in bytes, that went through the transcoder during the selected time frame. - `stream_target.zones` (object) A hash of zones with CDN usage, keyed by the name of the billing zone where the usage was generated. Example: [{"name":"global","type":"fastly","viewing_bytes":22886}] - `stream_target.zones.name` (string) The name of the billing zone where the usage was generated. - `limits` (object) The time frame represented in the response. Example: {"from":"2019-11-07T00:00:00.000Z","to":"2019-12-05T00:00:00.000Z"} - `limits.from` (string) The start of the range of time represented in the response. Example: "2019-11-07T00:00:00.000Z" - `limits.to` (string) The end of the range of time represented in the response. Example: "2019-12-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)