Get paginated query results with the Wowza Streaming Cloud REST API

Learn how to get paginated results from REST API queries made in the Wowza Streaming Cloud™ service.

Pagination parameters


To execute a request that returns paginated results, use these parameters.
 
Parameter Data Type Description
page integer Specify a positive integer to indicate which page of the results should be displayed. The default value is 1.
per_page integer Indicates how many records should be included on each page of results. A valid value is any positive integer. The default is 1000.

Oldest records are displayed first, newest records come last. Results display the following additional parameters:
 
Parameter Data Type Description
page integer The page being displayed.
page_first_index integer The 0-based index of the first record on the page returned.
page_last_index integer The 0-based index of the last record on the page returned.
per_page integer The number of records included on each page of results.
total_pages integer The total number of pages generated by the query.
total_records integer The total number of records in the database that match the query.

Example requests


You can append pagination parameters to any GET request made to the
 
  • /live_streams,
     
  • /players,
     
  • /recordings,
     
  • /schedules,
     
  • /stream_sources,
     
  • /stream_targets, and
     
  • /transcoders
resources.

Live streams example

Notes:

The following request generates a paginated list of live streams that shows 25 streams per page. The first page of results will display the 25 oldest streams.
 
curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/live_streams/?page=1&per_page=25"
The response should look something like this:
 
{
  "live_streams": [1,2,3,...25]
   },
{
  "pagination": {
    "total_records": 541,
    "page": 1,
    "per_page": 25,
    "total_pages": 22,
    "page_first_index": 0,
    "page_last_index": 24
  }
}

Recordings example

The following request generates a paginated list of recordings that shows 5 recordings per page. Because there happen to be 25 total records, the first page of results will display the 5 newest recordings.
 
curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/recordings/?page=5&per_page=5"
The response should look something like this:
 
{
  "recordings": [1,2,3,4,5]
   },
{
  "pagination": {
    "total_records": 25,
    "page": 5,
    "per_page": 5,
    "total_pages": 5,
    "page_first_index": 20,
    "page_last_index": 24
  }
}

Stream targets example

The following request generates a paginated list of stream targets that shows 10 stream targets per page. The first page of results will display the oldest stream targets.
 
curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/stream_targets/?page=1&per_page=10"
The response should look something like this:
 
{
  "stream_targets": [1...10]
   },
{
  "pagination": {
    "total_records": 41,
    "page": 1,
    "per_page": 10,
    "total_pages": 5,
    "page_first_index": 10,
    "page_last_index": 1
  }
}