MetaRadio WordPress is a WordPress plugin which allows displaying now-playing song data on your WordPress website. This page explains some API details for advanced users.

API: Track Input

This API endpoint allows you to send live now-playing data to WordPress for storage and display. This endpoint is designed to be used by MetaRadio Standalone (the Windows app which connects your automation system to WordPress).

This API isn’t needed by most users, as MetaRadio Standalone is the preferred integration method. However, in some limited cases you may find it useful – especially when creating custom integrations.

Endpoint: /wp-json/metaradio/v1/trackinput/

This endpoint accepts these POST fields:

  • station (the station slug as configured in WordPress)
  • stationkey (the station key as configured in WordPress)
  • title (the title of the track)
  • artist (the artist of the track)
  • playoutid (a unique ID for each track)
  • duration (the duration in seconds of the track)
  • starttime (format: YYYY-MM-DD HH:MM:SS)

The start time must be in the same timezone as your WordPress site, or else it will not display correctly.

API: Station Now

This endpoint allows you to get current data about a specific station. It is used by the Javascript on your site, to fetch all the current date (current track, recent tracks, current program, etc).

Endpoint: /wp-json/metaradio/v1/stationnow/?station=<station_id>

Example URLs:

This endpoint returns data in JSON format. These are the main details available:

  • station
    • name
    • shortName
    • playerUrl
    • programguideUrl
    • streams (list)
      • url
      • format
      • bitrate
  • recent (list)
    • title
    • artist
    • time
    • token
    • links
      • artwork
      • artwork_600
      • audio_preview
      • itunes_store
  • now
    • title
    • artist
    • time
    • token
    • links
      • artwork
      • artwork_600
      • audio_preview
      • itunes_store
  • program_now
    • programId
    • name
    • presenter
    • image_600
    • url
    • startTime
    • endTime
    • startDateTime
    • endDateTime
    • startDateTime_unix
    • endDateTime_unix
  • program_next
    • programId
    • name
    • presenter
    • image_600
    • url
    • startTime
    • endTime
    • startDateTime
    • endDateTime
    • startDateTime_unix
    • endDateTime_unix

Here is an example payload:

API: Program Guide

This endpoint allows you to request the Program Guide for a station as a JSON feed. This will allow you to consume it in other systems, such a mobile apps.

Endpoint: /wp-json/metaradio/v1/stationguide/?station=<station_id>

Example URL:

API: Program Guide (RSS Feed)

This endpoint allows you to request your Program Guide as an RSS Feed. This can be useful for integrating with systems that support a generic RSS feed as a data source.

Endpoint: /feed/metaradio/guide/?station=<station_id>

API: Program Guide (AIM Format)

You can fetch the Program Guide in a JSON format specifically designed to be used by the AIM Radio Apps, including Community Radio Plus.

Endpoint: /wp-json/metaradio/v1/stationguide/?station=<station_id>&format=aim

Example URL:

API: Simple Output Feeds

While the JSON feed is the preferred way to get data out of MetaRadio WordPress, some simple text feeds also exist. These may be useful in some limited scenarios.

Endpoints:

  • /metaradiofeed/test-station/ (ARITST – TITLE)
  • /metaradiofeed/test-station/?mode=track_now_titleartist (TITLE – ARTIST)
  • /metaradiofeed/test-station/?mode=program_next (TITLE – PRESENTER)
  • /metaradiofeed/test-station/?mode=program_now(TITLE – PRESENTER)