Retrieving previous/now/next programmes – pre-defined queries
Using pre-defined queries
To retrieve previous, now and next information for a given channel or all channels, use the pre-defined query API which both abstracts away the complexity of the underlying data model and provides for the most performant query.
This API allows the user to:
Get the current programme for all channels
Get previous, now and next programme
Get previous, now and next programme for a specific channel
Pagination over channels
Request
To retrieve current events, either for all for specific channels channels, or previous, now and next programmes, send a GET request to:
https://<host>:<port>/<endpoint>/metadata/epg/now
Headers
Authorization: Bearer
– bearer tokenContent-Type: application/json
Mandatory arguments
None
Other arguments
All these arguments are query parameters:
ltcu
– the lower bound (time) from which we want programmes either specified in ISO8601 format, or as a time offset (e.g. +08:00 or -08:00)stcu
– the upper bound (time) to which we want programmes either specified in ISO8601 format, or as a time offset (e.g. +08:00 or -08:00)channel
– a specific channel IDnext
– whether to show next programme in listingprevious
– whether to show previous programme in listingfields
– a list of fields names to return in the responsepage
– the page of results to retrievelimit
– the page sizeAccept-Language
– the language (locale) of the response data
Response
A successful request returns an HTTP 200 status.
A bad request returns an HTTP 404 status.
Examples
Retrieves the previous, now and next programme for all channels:
https://<host>:<port>metadata/epg/now?next=true&previous=true
Get previous, now and next programme for a specific channel:
https://<host>:<port>/metadata/epg/now?next=true&previous=true&channel=GLOBAL_bbc_one
Pagination over channels – takes page 2 of size 10, (channels 11-20 inclusive):
https://<host>:<port>/metadata/epg/now?limit=10&page=2
See also
The Content discovery facade API documentation