View usage data with the Wowza Video REST API

Learn how to use the REST API to get usage data for an account in the Wowza Video™ service. Usage data includes stream processing time for an account, transcoders, usage for stream targets and VOD streams, egress for transcoders, and peak storage.

View usage for an account

View usage details for an account by sending a GET request to the /usage/account 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

Copy
Copied
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${WV_JWT}" \ 
  -X "GET" \
  "${WV_HOST}/api/${WV_VERSION}/usage/accounts?from=2022-04-07&to=2022-04-11"

Sample response

The response includes:

  • Detailed information for the account, including, viewing_seconds , viewing_bytes , egress_seconds , egress_bytes , egress_seconds_additional_targets , and trend during the specified time frame.
Copy
Copied
{
  "accounts": {
          "id": "rfP7rDv2",
          "viewing_seconds": 180990,
          "avg_viewing_seconds": 2634,
          "viewing_bytes": 37067405516,
          "egress_seconds": 49549,
          "egress_seconds_additional_targets": 345,
          "egress_bytes": 7044862,
          "trend": [
            {
                "sampled_at": "2022-04-07T15:05:00.000Z",
                "viewing_seconds": 45,
                "vieweing_bytes": 20
            }
          ]
  },
  "limits": {
      "from": "2022-04-07T15:00:00.000Z",
      "to": "2022-04-11T15:00:00.000Z"
  }
}

View usage for stream targets

Usage for stream targets is the amount of data that went through every Wowza Video 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

Copy
Copied
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${WV_JWT}" \
  -X "GET" \
  "${WV_HOST}/api/${WV_VERSION}/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 , viewing_seconds , and viewing_bytes of usage for the target during the specified time frame.
Copy
Copied
{
  "stream_targets": [
      {
          "id": "nlyjxjbc",
          "name": "My Stream Target",
          "archived": true,
          "type": "fastly",
          "viewing_seconds": 180990,
          "avg_viewing_seconds": 2634,
          "viewing_bytes": 37067405516,
      },
      {
          "id": "zwry3gj7",
          "name": "My Other Stream Target",
          "archived": false,
          "type": "fastly",
          "viewing_seconds": 90,
          "avg_viewing_seconds": 90,
          "viewing_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 real-time streams

Usage for real-time streams is the amount of data that is exchanged between a video source, Wowza video, and a viewer.

View usage details for all real-time streams in the account by sending a <GET request to the /usage/real_time_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.

Sample request

Endpoint Reference

Copy
Copied
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${WV_JWT}" \
  -X "GET" \
  "${WV_HOST}/api/${WV_VERSION}/usage/real_time_streams?from=2021-07-07&to=2021-08-11"

Sample response

The response includes:

  • Detailed information for all real-time streams in the account, including the real-time stream ID , name , bytes_in , and bytes_out of usage for the stream during the specified time frame.
Copy
Copied
{
  "real_time_streams": [
      {
          "id": "nlyjxjbc",
          "name": "My Real Time Stream",
          "bytes_in": 0,
          "bytes_out": 222
      },
      {
          "id": "zwry3gj7",
          "name": "My Other Real Time Stream",
          "bytes_in": 888,
          "bytes_out": 1111
      }
  ],
  "pagination": {
      "payload_version": 2.0,
      "total_records": 6,
      "per_page": 2,
      "next_page_key": "zzvfprpf",
      "total_pages": 3
  },
  "limits": {
      "from": "2021-07-07T15:00:00.000Z",
      "to": "2021-08-11T15:00:00.000Z"
  }
}

View usage for transcoders

Transcoder usage (egress) includes traffic leaving Wowza Video 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

Copy
Copied
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${WV_JWT}" \
  -X "GET" \
  "${WV_HOST}/api/${WV_VERSION}/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 egress_seconds , egress_bytes , and egress_seconds_additional_targets of usage for each transcoder during the specified time frame.
Copy
Copied
{
   "transcoders": [
     {
       "id": "1237abcd",
       "name": "RTMP-Pull-Street",
       "archived": false,
       "transcoder_type": "transcoded",
       "billing_mode": "pay_as_you_go",
       "egress_bytes": 53446778562,
       "egress_seconds": "13241234",
       "egress_seconds_additional_targets": "23"
     },
     {
       "id": "1238abcd",
       "name": "RTMP Pull test",
       "archived": true,
       "transcoder_type": "transcoded",
       "billing_mode": "twentyfour_seven",
       "egress_bytes": 119542733,
       "egress_seconds": "23423453 ",
       "egress_seconds_additional_targets": "0 "
     }
   ],
   "pagination": {
       "payload_version": 1.0,
       "page": 3,
       "page_first_index": 6,
       "page_last_index": 8,
       "per_page": 2,
       "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 Video 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

Copy
Copied
-H "Authorization: Bearer ${WV_JWT}" \
-X GET \
"${WV_HOST}/api/${WV_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.

Copy
Copied
{
   "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 Video 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.
Info

The /usage/vod_streams endpoint is available from v1.5 of the Wowza Video REST API.

Sample request

Endpoint Reference

Copy
Copied
-H "Authorization: Bearer ${WV_JWT}" \
-X GET \
"${WV_HOST}/api/${WV_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 VOD streams in the account, including the VOD stream ID , type , viewing_seconds , viewing_bytes , and avg_viewing_seconds of usage for the target during the specified time frame.
Copy
Copied
{
  "vod_streams": [
      {
          "id": "nlyjxjbc",
          "name": "My VOD Stream",
          "archived": true,
          "type": "fastly",
          "viewing_seconds": 180990,
          "avg_viewing_seconds": 2643,
          "viewing_bytes": 37067405516
      },
      {
          "id": "zwry3gj7",
          "name": "My Other VOD Stream",
          "archived": false,
          "type": "fastly",
          "viewing_seconds": 90,
          "avg_viewing_seconds": 45,
          "viewing_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