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

Use the REST API to get viewer data for Wowza CDN stream targets in the Wowza Video™ 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.

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 "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_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_seconds, viewing_bytes, and avg_viewing_seconds of usage for the target during the specified time frame.
{
    "stream_target": {
        "id": "nlyjx123",
        "type": "fastly",
        "unique_viewers": 35,
        "viewing_seconds": 181040,
        "avg_viewing_seconds": 2634,
        "viewing_bytes": 37073299545,
        "zones": [
            {
                "name": "global",
                "type": "fastly",
                "viewing_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.