Class: Wrapi

Hierarchy

  • Wrapi

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Wrapi(__namedParameters: object): Wrapi

Parameters:

▪ __namedParameters: object

NameTypeDefault
baseURLstring | URL"https://api.radioplayer.org/v2"
keystring-
keyIdstring-

Returns: Wrapi

Properties

Private baseURL

• baseURL: string | URL


Private keys

• keys: object

The keys (a pem file and a corresponding key ID) can be obtained from Radioplayer by emailing contact@radioplayer.co.uk

Type declaration:

  • key: string

  • keyId: string

Methods

Private createRequest

▸ createRequest(requestUrl: string): object

Parameters:

NameType
requestUrlstring

Returns: object

  • keys(): object

    • key: string

    • keyId: string

  • url: string = requestUrl


getCategories

▸ getCategories(params: CategoriesParams): Promise‹CategoryResponse›

Returns a list of category names and hrefs for ondemand or live data.

Parameters:

NameType
paramsCategoriesParams

Returns: Promise‹CategoryResponse›


getOnAir

▸ getOnAir(params: OnAirParams): Promise‹OnAirResponse›

Retrieve on air, now-playing events, such as programs or songs. You can specify one or multiple stations to request information from, and can optionally retrieve any events that are playing next.

Parameters:

NameType
paramsOnAirParams

Returns: Promise‹OnAirResponse›


getOnDemand

▸ getOnDemand(params: OdParams): Promise‹StationOnDemandResponse›

Retrieves ondemand items. These can be as a result of a text search, a search-by-country, or a search-by-category. Also retrieves information about particular, specified ondemand items, indicated by the odIds parameter.

Parameters:

NameType
paramsOdParams

Returns: Promise‹StationOnDemandResponse›


getRecommendation

▸ getRecommendation(params: RecommendationParams): Promise‹RecommendationResponse›

Retrieve recommendations of stations and (optionally) ondemand items. A default request will just return recommended stations; an optional onDemand paramter can be included in the body to include onDemand items in the response.

Parameters:

NameType
paramsRecommendationParams

Returns: Promise‹RecommendationResponse›


getSchedule

▸ getSchedule(params: StationScheduleParams): Promise‹ScheduleResponse›

Retrieve station schedules. You can specify one or multiple stations to request information from, up to a maximum of five rpuids per request. Results will be organised by station, and each station's results will be paginated.

Parameters:

NameType
paramsStationScheduleParams

Returns: Promise‹ScheduleResponse›


getStationOndemand

▸ getStationOndemand(params: StationOndemandParams): Promise‹StationOnDemandResponse›

Returns a paginated subset of on demand items for a given station. Results are returned in chronological order, the most recent first. You may also provide the station rpuid for the series you are requesting.

Parameters:

NameType
paramsStationOndemandParams

Returns: Promise‹StationOnDemandResponse›


getStations

▸ getStations(params: StationParams | GetStationsByRpUidsParams): Promise‹StationResponse›

Retrieve information about stations. An entire list of stations can be returned, or query parameters can be added to filter the results. You may also use the same endpoint to retrieve station information for one or more stations.

Parameters:

NameType
paramsStationParams | GetStationsByRpUidsParams

Returns: Promise‹StationResponse›