Get viewer data for a Wowza CDN stream target with the Wowza Streaming Cloud REST API

Use the REST API to get viewer data for Wowza CDN stream targets in the Wowza Streaming Cloud™ service. Viewer data includes the number of unique viewers and viewing time for the stream target or the number of current viewers for an active stream. Wowza CDN on Fastly stream targets return near real-time viewer data, while Wowza CDN on Akamai stream targets begin to update approximately 2 hours after the transcoder starts and then update approximately hourly.

Get viewer data for a stream target


See viewer data for a stream target by sending a GET request to the /usage/stream_targets/[stream_target_id] 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 -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/[stream_target_id]?from=2019-08-04 15:00:00&to=2019-9-04 15:00:00"

Sample response

The response includes:

  • Detailed information for all stream targets in the account, including the stream target ID, type, viewing_time, and bytes of usage for the target during the specified time frame.
{
    "stream_target": {
        "id": "nlyjx123",
        "type": "fastly",
        "unique_viewers": 35,
        "viewing_time": 181040,
        "bytes": 37073299545,
        "zones": [
            {
                "name": "global",
                "type": "fastly",
                "bytes": 37073299545
            }
        ],
        "limits": {
            "from":"2019-08-04T15:00:00.000Z",
            "to": "2019-09-04T15:00:00.000Z"
        }
    }
}

Related API requests

GET /usage/stream_targets/[id]/live — Fetch live viewer data for a single stream target.

Note: This operation currently supports stream targets with a type of fastly only.