View usage data with 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, usage for stream targets and VOD streams, egress for transcoders, and peak storage.

Note: To learn how to get usage data for an ultra low latency stream target, see View ultra low latency usage with the Wowza Streaming Cloud REST API.

View usage for stream targets


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

View usage details for all stream targets in the account by sending a GET request to the /usage/stream_targets endpoint.

You can use the following sample request, making sure to:

  • Set from and to query parameters. This sets the range of time you want to view. The maximum difference between from and to is 90 days. 

Sample request

Endpoint Reference

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/v1.6/usage/stream_targets?from=2021-07-07&to=2021-08-11"

Sample response

The response includes:

  • Detailed information for all stream targets in the account, including the stream target ID, type, unique_viewers, viewing_time, and bytes of usage for the target during the specified time frame.
{
  "stream_targets": [
      {
          "id": "nlyjxjbc",
          "name": "My Stream Target",
          "archived": true,
          "type": "fastly",
          "unique_viewers": 34,
          "viewing_time": 180990,
          "bytes": 37067405516,
      },
      {
          "id": "zwry3gj7",
          "name": "My Other Stream Target",
          "archived": false,
          "type": "fastly",
          "unique_viewers": 1,
          "viewing_time": 90,
          "bytes": 27258685,
      }
  ],
  "pagination": {
      "payload_version": 2.0,
      "total_records": 6,
      "per_page": 2,
      "next_page_key": "zzvfprpf",
      "total_pages": 3
  },
  "limits": {
      "from": "2019-11-07T15:00:00.000Z",
      "to": "2019-12-05T15:00:00.000Z"
  }
}

Related stream target usage API requests

View usage for transcoders


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

View transcoder egress by sending a GET request to the /usage/transcoders endpoint.

You can use the following sample request, making sure to:

  • Set from and to query parameters. This sets the range of time you want to view. The maximum difference between from and to is 90 days.

Sample request

Endpoint Reference

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/v1.6/usage/transcoders?from=2021-07-07&to=2021-08-11"

Sample response

The response includes:

  • Detailed information for all transcoders in the account, including the seconds and bytes of usage for each transcoder during the specified time frame.
{
   "transcoders": [
     {
       "bytes": 53446778562,
       "archived": false,
       "id": "1237abcd",
       "name": "RTMP-Pull-Street",
       "transcoder_type": "transcoded",
       "billing_mode": "pay_as_you_go",
       "seconds": "13241234"
     },
     {
       "bytes": 119542733,
       "archived": true,
       "id": "1238abcd",
       "name": "RTMP Pull test",
       "transcoder_type": "transcoded",
       "billing_mode": "twentyfour_seven",
       "seconds": "23423453 "
     },
     {
       "bytes": 14109171,
       "archived": true,
       "id": "1239abcd",
       "name": "IP camera stream",
       "transcoder_type": "passthrough",
       "billing_mode": "pay_as_you_go",
       "seconds": "75686798"
     }
   ],
   "pagination": {
       "payload_version": 1.0,
       "page": 3,
       "page_first_index": 6,
       "page_last_index": 8,
       "per_page": 3,
       "total_pages": 710,
       "total_records": 2130
   },
   "limits": {
       "from": "2019-10-01T07:00:00.000Z",
       "to": "2019-10-16T11:00:00.000Z"
   }
 }

Related transcoder usage API requests

View peak storage


Peak 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 you create five recordings and two VOD streams in a month, and during the same month you delete two of the recordings, your peak storage will equal the total amount of data stored for the five recordings and two VOD streams.

View peak storage by sending a GET request to the /usage/storage/peak endpoint.

You can use the following sample request, making sure to:

  • Set from and to query parameters. This sets the range of time you want to view. 

Sample request

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/storage/peak?from=2021-07-07&to=2021-08-11"

Sample response

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

{
   "bytes": 15130718193,
   "limits": {
       "from": "2019-12-07T00:00:00.000Z",
       "to": "2019-12-21T00:00:00.000Z"
   }
}

View usage for VOD streams


Usage for VOD streams includes CDN usage and egress. CDN usage is the amount of data that went through every Fastly stream target. Egress is typically traffic that leaves Wowza Streaming Cloud for Wowza CDN and custom stream targets. However, for VOD streams, egress is the traffic generated by pulling the VOD asset from storage.

CDN usage

View CDN usage details for all VOD streams in the account by sending a GET request to the /usage/vod_streams endpoint.

You can use the following sample request, making sure to:

  • Set from and to query parameters. This sets the range of time you want to view. The maximum difference between from and to is 90 days.

     
Note: The /usage/vod_streams endpoint is available from v1.5 of the Wowza Streaming Cloud REST API.

Sample request

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/vod_streams?from=2021-07-07 15:00:00&to=2021-08-11 15:00:00"

Sample response

The response includes:

  • Detailed information for all stream targets in the account, including the VOD stream ID, type, unique_viewers, viewing_time, and bytes of usage for the target during the specified time frame.
{
  "vod_streams": [
      {
          "id": "nlyjxjbc",
          "name": "My VOD Stream",
          "archived": true,
          "type": "fastly",
          "unique_viewers": 34,
          "viewing_time": 180990,
          "bytes": 37067405516,
      },
      {
          "id": "zwry3gj7",
          "name": "My Other VOD Stream",
          "archived": false,
          "type": "fastly",
          "unique_viewers": 1,
          "viewing_time": 90,
          "bytes": 27258685,
      }
  ],
  "pagination": {
      "payload_version": 2.0,
      "total_records": 4,
      "per_page": 2,
      "next_page_key": "zlvfpmpn",
      "total_pages": 2
  },
  "limits": {
      "from": "2019-11-07T15:00:00.000Z",
      "to": "2019-12-05T15:00:00.000Z"
  }
}

Egress

View egress details for all VOD streams in the account by sending a GET request to the /usage/vod_streams/egress endpoint.

You can use the following sample request, making sure to:

  • Set from and to query parameters. This sets the range of time you want to view. The maximum difference between from and to is 90 days.

     
Note: The /usage/vod_streams/egress endpoint is available from v1.7 of the Wowza Streaming Cloud REST API.

Sample request

Endpoint Reference

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/vod_streams/egress?from=2021-07-07 15:00:00&to=2021-08-11 15:00:00"

Sample response

The response includes:

  • Detailed information for all VOD streams in the account, including the VOD stream ID, type, and bytes of egress for the stream during the specified time frame.
{
  "vod_streams": [
      {
          "id": "nlyjxjbc",
          "name": "My VOD Stream",
          "archived": true,
          "type": "fastly",
          "bytes": 37067405516,
      },
      {
          "id": "zwry3gj7",
          "name": "My Other VOD Stream",
          "archived": false,
          "type": "fastly",
          "bytes": 27258685,
      }
  ],
  "pagination": {
      "payload_version": 2.0,
      "total_records": 4,
      "per_page": 2,
      "next_page_key": "zlvfpmpn",
      "total_pages": 2
  },
  "limits": {
      "from": "2019-11-07T15:00:00.000Z",
      "to": "2019-12-05T15:00:00.000Z"
  }
}

Related VOD usage API requests