How to view usage data by using the Wowza Streaming Cloud REST API

Learn how to use the REST API to get usage data for an account in the Wowza Streaming Cloud™ service. Usage data includes stream processing time for transcoders, network usage for stream sources and stream targets, egress for transcoders, and peak recording storage.

Contents


Usage parameters
View stream processing time
View network usage for stream sources
View network usage for stream targets
View network usage for transcoders
View peak recording storage

Usage parameters


Parameter Data Type Description
billing_mode string For transcoder network usage (egress) and stream processing time.

Specify the billing mode of the transcoder, either pay_as_you_go or twentyfour_seven.

To retrieve usage for both pay-as-you-go and 24x7 streams, don't specify billing_mode.
from datetime The start of the range of time you want to view. Specify YYYY-MM-DD HH:MM:SS where HH is a 24-hour clock in UTC. The default time range is from the last billing date to the end of the current day.
to datetime The end of the range of time you want to view. Specify YYYY-MM-DD HH:MM:SS where HH is a 24-hour clock in UTC. The default time range is from the last billing date to the end of the current day.
transcoder_type string For transcoder network usage (egress) and stream processing time.

Specify transcoded to fetch stream processing time for all adaptive bitrate transcoders and live streams during the specified timeframe.

Specify passthrough to fetch processing time for all passthrough transcoders during the specified timeframe.

Don't specify transcoder_type to retrieve usage for both transcoded and passthrough streams.

View stream processing time


Stream processing time is the amount of time the Wowza Streaming Cloud transcoder spends processing encoded source video. Stream processing time is calculated separately for streams on which transcoding is performed and streams that are passed through the transcoder and delivered, unmodified, straight to a player or target.

To view stream processing time, call the resource

https://api.cloud.wowza.com/api/v1/usage/time/transcoders

Example request and response

Notes:
  • In all code examples, for [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
     
  • The --data-urlencode option in the example curl commands replaces unprintable and special characters, such as spaces, curly brackets, forward slashes, and semicolons, with ASCII-safe, unambiguous characters that are understood across the Internet.
curl -G -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' --data-urlencode 'transcoder_type=transcoded' --data-urlencode 'billing_mode=pay_as_you_go' --data-urlencode 'from=2015-07-01 12:00:00' --data-urlencode 'to=2015-07-16 12:00:00' https://api.cloud.wowza.com/api/v1/usage/time/transcoders/

The query returns details on each transcoding session during the specified timeframe.

Note: Stream processing time updates in or near real-time. Billing information updates every 12 hours. As a result, seconds_used and seconds_billed may differ.
{
   "transcoders": [
     {
       "deleted": false,
       "id": "1234abcd",
       "name": "July 1 IP Camera",
       "seconds_billed": 20134,
       "seconds_used": 20134
     },
     {
       "deleted": false,
       "id": "1235abcd",
       "name": "July 1 GoCoder",
       "seconds_billed": 1234,
       "seconds_used": 1234
     },
     {
       "deleted": true,
       "id": "1236abcd",
       "name": "July 7 Transcoder East",
       "seconds_billed": 718,
       "seconds_used": 718
     }
  ]
 }

View network usage for stream sources


Network usage for stream sources is the amount of data that went through every Wowza Streaming Cloud stream source.

To view network usage for stream sources, call the resource

https://api.cloud.wowza.com/api/v1/usage/network/stream_sources

Example request and response

curl -G -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' --data-urlencode 'from=2015-07-01 12:00:00' --data-urlencode 'to=2015-07-16 12:00:00' https://api.cloud.wowza.com/api/v1/usage/network/stream_sources/

The query returns details on each stream source that received data during the specified timeframe.

Note: Network usage updates approximately every hour and is subject to a three-hour delay. Billing information updates every 12 hours. As a result, bytes_used and bytes_billed may differ.
{
   "stream_sources": [
     {
       "bytes_billed": 56054502,
       "bytes_used": 56054502,
       "deleted": true,
       "id": "5678efgh",
       "name": "Test stream 1 / Stream Source"
     },
     {
       "bytes_billed": 36267914,
       "bytes_used": 36267914,
       "deleted": true,
       "id": "5679efgh",
       "name": "Test stream 2 / Stream Source"
     },
     {
       "bytes_billed": 643536711,
       "bytes_used": 643536711,
       "deleted": true,
       "id": "5670efgh",
       "name": "Test stream 3 / Stream Source"
     }
   ]
 }

View network usage for stream targets


Network usage for stream targets is the amount of data that went through every Wowza Streaming Cloud stream target.

To view network usage for stream targets, call the resource

https://api.cloud.wowza.com/api/v1/usage/network/stream_targets

Example request and response

curl -G -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' --data-urlencode 'from=2015-07-01 12:00:00' --data-urlencode 'to=2015-07-16 12:00:00' https://api.cloud.wowza.com/api/v1/usage/network/stream_targets/

The query returns the total amount of usage, total usage by protocol and zone, and usage for each individual stream target by protocol and zone for the specified timeframe.

Notes:
  • Network usage updates approximately every hour and is subject to a three-hour delay. Billing information updates every 12 hours. As a result, bytes_used and bytes_billed may differ.
  • The zone is always global.
{
    "total": {
        "bytes_used": 30002500,
        "bytes_billed": 30002500,
        "protocols": {
            "hls": {
                "zones": {
                    "global": {
                        "bytes_used": 10001000,
                        "bytes_billed": 10001000
                    }
                }
            },
            "hls_hds": {
                "zones": {
                    "global": {
                        "bytes_used": 20002500,
                        "bytes_billed": 200002500
                    }
                }
            }
        }
    },
    "stream_targets": [
        {
            "id": "c63awyxt",
            "name": "My Wowza CDN HLS stream target / Stream Target",
            "deleted": false,
            "bytes_used": 10001000,
            "bytes_billed": 10001000,
            "protocols": {
                "hls": {
                    "zones": {
                        "global": {
                            "bytes_used": 10001000,
                            "bytes_billed": 10001000
                        }
                    }
                }
            }
        },
        {
            "id": "b52cyxzp",
            "name": "my Wowza CDN HLS-HDS stream target / Stream Target",
            "deleted": false,
            "bytes_used": 20002500,
            "bytes_billed": 20002500,
            "protocols": {
                "hls_hds": {
                    "zones": {
                        "global": {
                            "bytes_used": 20002500,
                            "bytes_billed": 20002500
                        }
                    }
                }
            }
        }
    ]
}

View network usage for transcoders


Transcoder network usage (egress) includes traffic leaving Wowza Streaming Cloud for Wowza CDN and custom stream targets.

To view transcoder egress, call the resource

https://api.cloud.wowza.com/api/v1/usage/network/transcoders

Example request and response

curl -G -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' --data-urlencode 'transcoder_type=transcoded' --data-urlencode 'billing_mode=pay_as_you_go' --data-urlencode 'from=2015-07-01 12:00:00' --data-urlencode 'to=2015-07-16 12:00:00' https://api.cloud.wowza.com/api/v1/usage/network/transcoders/

The query returns details on all transcoder usage during the specified timeframe.

Note: Transcoder usage updates approximately in or near real-time. Billing information updates every 12 hours. As a result, bytes_used and bytes_billed may differ.
{
   "transcoders": [
     {
       "bytes_billed": 53446778562,
       "bytes_used": 53446778562,
       "deleted": false,
       "id": "1237abcd",
       "name": "RTMP-Pull-Street"
     },
     {
       "bytes_billed": 119542733,
       "bytes_used": 119542733,
       "deleted": true,
       "id": "1238abcd",
       "name": "March 31 RTMP Pull test"
     },
     {
       "bytes_billed": 14109171,
       "bytes_used": 14109171,
       "deleted": true,
       "id": "1239abcd",
       "name": "an ip camera stream to record"
     }
   ]
 }

View peak recording storage


Peak recording storage is the greatest amount of recorded content stored in your Wowza Streaming Cloud account at any point in a given month. For example, if during the course of a month you record five live streams, delete two recordings and keep three recordings, your peak recording storage will be the amount of data stored for the five recordings.

To view peak recording storage, call the resource

https://api.cloud.wowza.com/api/v1/usage/storage/peak_recording

Example request and response

curl -G -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' --data-urlencode 'from=2015-07-01 12:00:00' --data-urlencode 'to=2015-07-16 12:00:00' https://api.cloud.wowza.com/api/v1/usage/storage/peak_recording/

The query returns the greatest amount of bytes stored in your account at any one point in the specified timeframe.

{
   "peak_recording": {
     "bytes_total": 15130718193
   }
}

If you're having problems or want to discuss this article, post in our forum.