Radioplayer Developer Reference
Analytics
Technical reference for Radioplayer analytics and insights endpoints.
Link to the actual version of the API: Swagger Doc
Overview
CURRENT API VERSION: 1.3-stable
This API provides endpoints to retrieve values and analytical insights for radio stations, with the ability to specify various filters as explained below. To function, the user must be authenticated via an access_token, which can be obtained through an auth0 endpoint or by logging into the Insights platform and extracting it from sessionStorage.auth_token in the console.
The API is divided into three sections: Filters, Analytics, and Analytics Contents.
Filters : Users can obtain values for filter parameters for a given user.
- /dev/filters/v2/{table_name}/{column_name}
- /dev/on_demand/filters/v2/{table_name}/{column_name}
- Live Analytics : Provides radio listening analytics such as Reach (the number of unique users), Audience (the number of distinct listening sessions), Total Time Spent Listening (TTSL), which is the total listening time (in minutes) for a given content.
- Use the /aggregation endpoint to retrieve the aggregated value over the specified metric
- Analytics Contents : Users can obtain analytics for specific content types (programs and songs) through three separate endpoints (/music, and /programs).
- User Journey: Provides data about user journey through the RP platforms, e.g. the average number of favourite stations, the most favourite stations by users, the number of alarm set with a specific station.
- On Demand Analytics: Users can obtain analytics for on demand content types in aggregated and detailed responses. You can insights for sessions, listeners,
- Migration: there are new endpoints in order to retrieve data from Old RP Insights. These endpoints can calculate:
- reach (as number of listeners, where each listener is a unique device per station)
- audience, as number of distinct 60-sec min duration listening sessions
- there is also, from 0.6 version, the /comparison endpoint that tracks the daily difference in terms of "Reach" between RP old data and new data.
_Update from 1.1 version: you can use the equivalent version of the endpoints also with POST methods, where query params become body params of the requests._
Station Insights Endpoints
/dev/analytics/v2/aggregations/{metric_name}
GET /dev/analytics/v2/aggregations/{metric_name}
Tags : Analytics
Summary : Retrieve analytics aggregation (AQH, TTSL, Audience, Reach) over the current period specified and previous period of the same duration (e.g. 05/10 - 10/10 - previous period 01/10 - 05/10).
Parameters:
Path Parameters :
metric_name(required): The metric of interest (audience, reach, average_session_duration, aqh, total_tsl)
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatpublisher_id(optional): Comma-separated list of Publisher IDs. Multi publisher filtering is now supported.rpuid(optional): Comma-separated list of RPUIDs. Multi radio filtering is now supported.radio_name(optional): Comma-separated list of Radio Names. Multi radio filtering is now supported.geo_country(optional): Comma-separated list of Listening countries (Italy, Germany, etc.)category(optional): Comma-separated list of Device categories (SmartPhones, SmartSpeakers, ConnectedTV, etc.)source: Comma-separated list of Source (ANALYTICS, RP_INSIGHTS, SDK)local_timezone: Default UTC Data are returned. If set to true, insights are retrieved with timezone of the capital of the country code involved. (E.g. 380 (Italy) -> 'Europe/Rome'min_session_duration: One of 0,15,30,60 seconds of minimum session duration, for USERS metric this parameter will be ignored.
Responses:
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
/dev/analytics/v2/{metric_name}
GET /dev/analytics/v2/{metric_name}
Tags : Analytics
Summary : Retrieve analytics data with either rpuid or radio_name for different metrics. This version supports category filtering.
Parameters:
Path Parameters :
metric_name(required): The selected metrics among: sessions, users, total_tsl
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatgroup_by(optional): Parameters to group by (day_param, rpuid, output, platform, geo_country, city, type, category, sub_category, sub_category_detail)publisher_id(optional): The ID of the publisher group.rpuid(optional): RPUID. Multi radio filtering is not supported yet.radio_name(optional): Radio Name. Multi radio filtering is not supported yet.geo_country(optional): Listening country (Italy, Germany, etc.)category(optional): Device category (SmartPhones, SmartSpeakers, ConnectedTV, etc.)city(optional): City (London, Berlin, etc.)granularity(optional): HOUR or DAYaggregation(optional): Obtain an aggregation of the data, it can be AVG (average) or SUM (the sum over the specified parameters). (deprecated)source: Comma-separated list of Source (ANALYTICS, RP_INSIGHTS, SDK)local_timezone: Default UTC Data are returned. If set to true, insights are retrieved with timezone of the capital of the country code involved. (E.g. 380 (Italy) -> 'Europe/Rome'min_session_duration: One of 0,15,30,60 seconds of minimum session duration, for USERS metric this parameter will be ignored.
Responses:
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
/dev/analytics/v2/date_part/{metric_name}
GET /dev/analytics/v2/date_part/{metric_name}
Tags : Analytics
Summary : Retrieve analytics data, aggregating on the datetime part of interest (DAY or HOUR), for different metrics.
Parameters:
Path Parameters :
metric_name(required): The metric of interest (sessions, users, total_tsl)
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatgranularity(optional): Date part extraction, can be HOUR or DAYgroup_by(optional): Parameters to group by (day_param, rpuid, output, platform, geo_country, city)publisher_id(optional): The ID of the publisher group.rpuid(optional): RPUID.radio_name(optional): Radio Name.email_address(optional): Email of the broadcasteroutput(optional): Output type (CARPLAY, ANDROIDAUTO, SPEAKER, etc.)platform(optional): Platform type (IOS, ANDROID, etc.)category(optional): Category to be chosen.geo_country(optional): Listening country (Italy, Germany, etc.)city(optional): City (London, Berlin, etc.)source: Comma-separated list of Source (ANALYTICS, RP_INSIGHTS, SDK)local_timezone: Default UTC Data are returned. If set to true, insights are retrieved with timezone of the capital of the country code involved. (E.g. 380 (Italy) -> 'Europe/Rome'min_session_duration: One of 0,15,30,60 seconds of minimum session duration, for USERS metric this parameter will be ignored.
Responses:
#analyticscomplexextractiondata
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
/dev/filters/v2/{table_name}/{column_name}
GET /dev/filters/v2/{table_name}/{column_name}
Tags : Filters
Summary : Retrieve distinct values for dashboards filters.
Parameters:
Path Parameters :
table_name(required): Table Namecolumn_name(required): Column Name
Responses:
200 : Successful Response
- Content :
FilterResponse
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
GET/dev/on_demand/filters/v2/{table_name}/{column_name}
/dev/publisher_and_radio_info
GET /dev/publisher_and_radio_info
Tags : User Management
Summary : Get Publisher and RPUID Radio Information.
Responses:
200 : Successful Response
- Content :
array of ParamResponse
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
Contents KPI Endpoints
/dev/analytics/programmes/{metric_name}
GET /dev/analytics/programmes/{metric_name}
Tags : Analytics Contents
Summary : Retrieve station programmes analytics.
Parameters:
Path Parameters :
metric_name(required): The metric of interest (audience, reach, average_session_duration, aqh, total_tsl). Only audience (listening sessions) is currently available.
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatgroup_by(optional): Parameters to group byradio_name(optional): Comma-separated list of radio station names.publisher_id(optional): Comma-separated list of publisher IDs.rpuid(optional): Comma-separated list of station RPUIDs.
Responses:
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
/dev/analytics/music/{metric_name}
GET /dev/analytics/music/{metric_name}
Tags : Analytics Contents
Summary : Retrieve music analytics.
Parameters:
Path Parameters :
metric_name(required): The metric of interest (audience, reach, average_session_duration, aqh, total_tsl). Only audience (listening sessions) is currently available.
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatgroup_by(optional): Parameters to group byradio_name(optional): Comma-separated list of radio station names.publisher_id(optional): Comma-separated list of publisher IDs.rpuid(optional): Comma-separated list of station RPUIDs.
Responses:
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
Migration Support Endpoints
/dev/old_insights/v2/{metric_name}
Summary : Retrieve analytics data with either rpuid or radio_name for different metrics. This version supports category filtering.
URL : /dev/old_insights/v2/{metric_name}
Method : GET
Tags : Migration
Path Parameters :
metric_name(required): The metric of interest (audience, reach, average_session_duration, aqh, total_tsl). Only "audience" (listening sessions) is currently available.
Query Parameters :
start_date(required): Start Date inYYYY-MM-DDformat.end_date(required): End Date inYYYY-MM-DDformat.group_by(optional): Parameters to group by (e.g., day_param, rpuid, radio_name, publisher_id, group_name, device_id, device).country_code(optional): Comma-separated list of country codes.publisher_id(optional): Comma-separated list of publisher IDs.rpuid(optional): Comma-separated list of station RPUIDs.radio_name(optional): Comma-separated list of radio station names.device_category(optional): Old Device type (e.g., ANDROID_PUB_7, IOS_PUB_7...).granularity(optional): Granularity options: DAY, WEEK, or MONTH.token(required): The token for authentication (passed in theAuthorizationheader).
Response:
Returns analytics data based on the specified parameters, with the ability to filter by categories and metrics.
/dev/old_insights/v2/aggregations/{metric_name}
Summary : Retrieve old insights aggregation over specified periods.
URL : /dev/old_insights/v2/aggregations/{metric_name}
Method : GET
Tags : Migration
Path Parameters :
metric_name(required): Metric (audience, reach, total_tsl, average_session_duration).
Query Parameters :
start_date(required): Start Date inYYYY-MM-DDformat.end_date(required): End Date inYYYY-MM-DDformat.country_code(optional): Comma-separated list of country codes.publisher_id(optional): Comma-separated list of Publisher IDs.rpuid(optional): Comma-separated list of RPUIDs.radio_name(optional): Comma-separated list of Radio Names.device_category(optional): Comma-separated list of Device categories.token(required): The token for authentication (passed in theAuthorizationheader).
Response:
Returns aggregated insights data based on the specified parameters for the given metric over the specified period.
/dev/old_insights/v2/comparison/{metric_name}
Summary : Retrieve analytics data with either rpuid or radio_name for different metrics. This version supports category filtering. Comparison between New SourceBase and Old RP Insights Endpoint.
URL : /dev/old_insights/v2/comparison/{metric_name}
Method : GET
Tags : Migration
Path Parameters :
metric_name(required): The metric of interest (AUDIENCE, REACH, HOURS, AVERAGE_HOURS).
Query Parameters :
start_date(required): Start Date inYYYY-MM-DDformat.end_date(required): End Date inYYYY-MM-DDformat.country_code(optional): The comma-separated list of country codes.group_by(optional): Group_by fields.publisher_id(optional): The comma-separated list of publisher ids.rpuid(optional): RPUIDs.radio_name(optional): Radio Names.device_category(optional): Device Categories.token(required): The token for authentication (passed in theAuthorizationheader).
Response:
On Demand Analytics Endpoints
/dev/analytics/v2/ondemand/{metric_name}
GET /dev/analytics/v2/ondemand/{metric_name}
Tags : On Demand Analytics Contents
Summary : Retrieve detailed on-demand analytics (sessions, visits, users, etc.) for podcasts or episodes with grouping, filtering and granularity support.
Parameters:Path Parameters:
metric_name(required): The metric of interest (sessions,users,subscriptions,churns,visits,downloads,overall_subscribers).
Query Parameters:
start_date(required): Start Date inYYYY-MM-DDformat.end_date(required): End Date inYYYY-MM-DDformat.country_code(optional): Comma-separated list of country codes.station_country(optional): Comma-separated list of station countries.group_by(optional): Comma-separated list of fields to group by. Must includeday_paramifgranularityis specified.publisher_id(optional): Comma-separated list of Publisher IDs.rpuid(optional): Comma-separated list of RPUIDs.radio_name(optional): Comma-separated list of Radio Names.podcast_id(optional): Comma-separated list of podcast IDs.device_category(optional): Comma-separated list of device categories.source(optional): Comma-separated list of source systems. Default includesANALYTICS,RP_INSIGHTS,AUTOMOTIVE,SDK.media_type(optional): Must be eitherpodcastsorepisodes. Required for some metrics.granularity(optional): Time granularity. One ofDAY,WEEK, orMONTH. Requiresgroup_byto containday_param.limit(optional): Limit on the number of results. Default:1000.
Responses:
200: Successful Response
Content-Type : application/json Returns an array of records with aggregated metric values, grouped by specified dimensions.
400: Bad Request (e.g., invalid metric, group_by field, or unauthorized identifiers)403: Forbidden - Not authorized to access specified identifiers422: Validation Error
Content-Type : HTTPValidationError
/dev/analytics/v2/ondemand/aggregations/{metric_name}
GET /dev/analytics/v2/ondemand/aggregations/{metric_name}
Tags : On Demand Analytics Contents
Summary : Retrieve on-demand analytics aggregation (e.g., reach, sessions, visits, active_subscribers) for the current period and the previous equivalent period.
Parameters:Path Parameters:
metric_name(required): The metric of interest. Must be one of:sessions,visits,reach,active_subscribers.
Query Parameters:
start_date(optional): Start Date inYYYY-MM-DDformat. Defaults to1970-01-01.end_date(optional): End Date inYYYY-MM-DDformat. Defaults to today.country_code(optional): Comma-separated list of country codes.station_country(optional): Comma-separated list of station countries.publisher_id(optional): Comma-separated list of Publisher IDs.rpuid(optional): Comma-separated list of RPUIDs.radio_name(optional): Comma-separated list of Radio Names.podcast_id(optional): Comma-separated list of podcast (series) IDs.podcast_name(optional): Comma-separated list of podcast names.category(optional): Comma-separated list of device categories (e.g.,SmartPhones,SmartSpeakers).device_category(optional): Same as above, alternative parameter name.source(optional): Comma-separated list of sources.
Responses:
200: Successful Response
Content-Type : application/json JSON object with:
{ "current_period_value": <number>, "previous_period_value": <number> }
400: Bad Request (e.g., invalid metric or conflicting parameters)403: Forbidden - Not authorized to access specified identifiers422: Validation Error
Content-Type : HTTPValidationError
/dev/analytics/podcasts/{metric_name} (in future this will be deprecated)
GET /dev/analytics/podcasts/{metric_name}
Tags : On Demand Analytics Contents
Summary : Retrieve station podcast analytics.
Parameters:
Path Parameters :
metric_name(required): The metric of interest (audience, reach, average_session_duration, aqh, total_tsl). Only audience (listening sessions) is currently available.
Query Parameters :
start_date(required): Start Date in YYYY-MM-DD formatend_date(required): End Date in YYYY-MM-DD formatgroup_by(optional): Parameters to group byradio_name(optional): Comma-separated list of radio station names.publisher_id(optional): Comma-separated list of publisher IDs.rpuid(optional): Comma-separated list of station RPUIDs.
Responses:
200 : Successful Response
- Content :
application/json
- Content :
422 : Validation Error
- Content :
HTTPValidationError
- Content :
User Journey Endpoints
/dev/analytics/v2/user_journey/{metric_name}
GET /dev/analytics/v2/user_journey/{metric_name}
Tags : User Journey
Summary : Retrieve user journey analytics for specific metrics such as sleep_timer, share_request, and station_alarm_set. The response can be grouped by various fields.
Parameters:Path Parameters:
metric_name(required): The metric of interest (sleep_timer,share_request,station_alarm_set,station_subscriptions).
Query Parameters:
start_date(required): Start Date inYYYY-MM-DDformat.end_date(required): End Date inYYYY-MM-DDformat.country_code(optional): Comma-separated list of country codes.station_country(optional): Comma-separated list of station countries.group_by(optional): Comma-separated list of fields to group by.publisher_id(optional): Comma-separated list of Publisher IDs.rpuid(optional): Comma-separated list of RPUIDs.radio_name(optional): Comma-separated list of Radio Names.device_category(optional): Comma-separated list of device categories.source(optional): Comma-separated list of source systems. Default includesANALYTICS,RP_INSIGHTS,AUTOMOTIVE,SDK.granularity(optional): Time granularity. One ofDAY,WEEK, orMONTH. Requiresgroup_byto containday_param.limit(optional): Limit on the number of results. Default:1000.
Responses:
200: Successful Response
Content-Type : application/json Returns an array of records with aggregated metric values, grouped by specified dimensions.
400: Bad Request (e.g., invalid metric, group_by field, or unauthorized identifiers)403: Forbidden - Not authorized to access specified identifiers422: Validation Error
Content-Type : HTTPValidationError
/dev/analytics/user_journey/aggregations/{metric_name}
/dev/analytics/v2/user_journey/aggregations/{metric_name}
GET /dev/analytics/v2/user_journey/aggregations/{metric_name}
Tags : User Journey
Summary : Retrieve user journey analytics aggregation for metrics like station active subscriptions, average number of favourite stations per user for both the current period and the previous period.
Parameters:Path Parameters:
metric_name(required): The metric of interest. Must be one of:station_subscriptions,average_number_of_favourites_per_user.
Query Parameters:
start_date(optional): Start Date inYYYY-MM-DDformat. Defaults to1970-01-01.end_date(optional): End Date inYYYY-MM-DDformat. Defaults to today.country_code(optional): Comma-separated list of country codes.station_country(optional): Comma-separated list of station countries.publisher_id(optional): Comma-separated list of Publisher IDs.rpuid(optional): Comma-separated list of RPUIDs.radio_name(optional): Comma-separated list of Radio Names.podcast_id(optional): Comma-separated list of podcast (series) IDs.podcast_name(optional): Comma-separated list of podcast names.category(optional): Comma-separated list of device categories (e.g.,SmartPhones,SmartSpeakers).device_category(optional): Same as above, alternative parameter name.source(optional): Comma-separated list of sources.
Responses:
200: Successful Response
Content-Type : application/json JSON object with:
json
Copia
{ "current_period_value": <number>, "previous_period_value": <number> }
400: Bad Request (e.g., invalid metric or conflicting parameters)403: Forbidden - Not authorized to access specified identifiers422: Validation Error
Content-Type : HTTPValidationError
Response Models
AnalyticsComplexExtractionData
- time_param :
Optional[int] - app_country :
Optional[str] - publisher :
Optional[str] - rpuid :
Optional[str] - radio_name :
Optional[str] - output :
Optional[str]
- output :
- geo_country :
Optional[str] - city :
Optional[str] - device_category :
Optional[str] - device_brand_name :
Optional[str] - operating_system :
Optional[str] - type :
Optional[str] - platform :
Optional[str] - total :
Optional[float]
AnalyticsComplexData
- time_param :
Optional[datetime.datetime] - app_country :
Optional[str] - publisher :
Optional[str] - rpuid :
Optional[str] - radio_name :
Optional[str] - output :
Optional[str] - geo_country :
Optional[str] - city :
Optional[str] - type :
Optional[str] - category :
Optional[str] - sub_category :
Optional[str] - sub_category_detail :
Optional[str] - total :
Optional[float]
AnalyticsMusicData
- time_param :
Optional[datetime.datetime] - app_country :
Optional[str] - publisher :
Optional[str] - song_title :
Optional[str] - artist :
Optional[str] - rpuid :
Optional[str] - radio_name :
Optional[str] - output :
Optional[str] - geo_country :
Optional[str] - device_category :
Optional[str] - device_brand_name :
Optional[str] - operating_system :
Optional[str] - type :
Optional[str] - platform :
Optional[str] - total :
Optional[float]
AnalyticsProgrammesData
- time_param :
Optional[datetime.datetime] - app_country :
Optional[str] - publisher :
Optional[str] - program_title :
Optional[str] - rpuid :
Optional[str] - radio_name :
Optional[str] - output :
Optional[str] - geo_country :
Optional[str] - device_category :
Optional[str] - device_brand_name :
Optional[str] - operating_system :
Optional[str] - type :
Optional[str] - platform :
Optional[str] - total :
Optional[float]
AnalyticsPodcastsData
- time_param :
Optional[datetime.datetime] - app_country :
Optional[str] - publisher :
Optional[str] - podcast_title :
Optional[str] - rpuid :
Optional[str] - radio_name :
Optional[str] - output :
Optional[str] - geo_country :
Optional[str] - device_category :
Optional[str] - device_brand_name :
Optional[str] - operating_system :
Optional[str] - type :
Optional[str] - platform :
Optional[str] - total :
Optional[float]
AggData
- current_period_value :
Optional[float] - previous_period_value :
Optional[float]
Filter
- parameter :
Optional[str]
OldInsightsData
- time_param (
Optional[datetime]): The timestamp of the data. - country_code (
Optional[str]): Country code. - station_country (
Optional[str]): Country of the station. - publisher_id (
Optional[str]): Publisher ID. - group_name (
Optional[str]): Group name. - rpuid (
Optional[str]): Unique ID for the user or device. - radio_name (
Optional[str]): Name of the radio. - device (
Optional[str]): Device type. - device_category (
Optional[str]): Device category. - total (
Optional[float]): Total value.
OldInsightsDataHour
- time_param (
Optional[int]): The timestamp of the data. - country_code (
Optional[str]): Country code. - station_country (
Optional[str]): Country of the station. - publisher_id (
Optional[str]): Publisher ID. - group_name (
Optional[str]): Group name. - rpuid (
Optional[str]): Unique ID for the user or device. - radio_name (
Optional[str]): Name of the radio. - device (
Optional[str]): Device type. - device_category (
Optional[str]): Device category. - total (
Optional[float]): Total value.
MigrationComparisonModel
- time_param (
Optional[datetime]): The timestamp of the data. - country_code (
Optional[str]): Country code. - station_country (
Optional[str]): Country of the station. - publisher_id (
Optional[str]): Publisher ID. - group_name (
Optional[str]): Group name. - rpuid (
Optional[str]): Unique ID for the user or device. - radio_name (
Optional[str]): Name of the radio. - old_rp_insights_value (
Optional[float]): Old RP insights value. - new_insights_value (
Optional[float]): New insights value.
AnalyticsOnDemandData
- time_param (Optional[int]): The timestamp of the data.
- metric (Optional[str]): The metric of interest.
- country_code (Optional[str]): Country code.
- station_country (Optional[str]): Country of the station.
- group_name (Optional[str]): Group name.
- rpuid (Optional[str]): Unique ID for the user or device.
- radio_name (Optional[str]): Name of the radio.
- radio_image_url (Optional[str]): URL of the radio image.
- device_category (Optional[str]): Device category.
- episode_count (Optional[int]): Number of episodes.
- media_type (Optional[str]): Media type (e.g., 'podcasts' or 'episodes').
- podcast_title (Optional[str]): Title of the podcast.
- podcast_image_url (Optional[str]): URL of the podcast image.
- episode_title (Optional[str]): Title of the episode.
- total (Optional[float]): Total value.
AnalyticsUserJourneyData
- time_param (Optional[int]): The timestamp of the data.
- metric (Optional[str]): The metric of interest.
- country_code (Optional[str]): Country code.
- station_country (Optional[str]): Country of the station.
- group_name (Optional[str]): Group name.
- rpuid (Optional[str]): Unique ID for the user or device.
- radio_name (Optional[str]): Name of the radio.
- radio_image_url (Optional[str]): URL of the radio image.
- device_category (Optional[str]): Device category.
- episode_count (Optional[int]): Number of episodes.
- media_type (Optional[str]): Media type (e.g., 'podcasts' or 'episodes').
- podcast_title (Optional[str]): Title of the podcast.
- podcast_image_url (Optional[str]): URL of the podcast image.
- episode_title (Optional[str]): Title of the episode.
- total (Optional[float]): Total value.