MetaRadio:
WordPress API Documentation

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:

{
    "station": {
        "name": "Test Station",
        "shortName": "test-station",
        "playerUrl": "https://example-com-10.mediarealm.dev/radioplayer/test-station/",
        "programguideUrl": "https://example-com-10.mediarealm.dev/guide/",
        "streams": [
            {
                "url": "https://stream1.hopemedia.com.au/hope-mp3",
                "format": "audio/mp3",
                "bitrate": "96"
            },
            {
                "url": "https://stream1.hopemedia.com.au/hope",
                "format": "audio/aacp",
                "bitrate": "64"
            }
        ]
    },
    "recent": [
        {
            "title": "Tones for Elvin Jones",
            "artist": "John McLaughlin",
            "time": "2021-04-07 16:21:02",
            "links": {
                "artwork": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/d4/9e/f5/d49ef58d-4148-2837-682b-0c71def1d470/source/100x100bb.jpg",
                "artwork_600": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/d4/9e/f5/d49ef58d-4148-2837-682b-0c71def1d470/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview118/v4/c6/7c/a0/c67ca0fa-7092-4dfe-d465-36e7612006f5/mzaf_4173962343043119023.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/tones-for-elvin-jones/1442870894?i=1442870911&uo=4"
            },
            "token": "1c90b5684c3914ac7bad023afbc1eb07"
        },
        {
            "title": "Lazy River",
            "artist": "Pete Fountain",
            "time": "2021-04-07 16:18:02",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/26/a1/6d/26a16df9-cf4b-6cb0-e6a1-7d50a3d046b3/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/26/a1/6d/26a16df9-cf4b-6cb0-e6a1-7d50a3d046b3/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/v4/f0/8a/b6/f08ab6d5-0caa-8dc4-4961-bf8edf8040e4/mzaf_6110043923225169267.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/the-lazy-river/284828751?i=284828779&uo=4"
            },
            "token": "a8416933482f681a23eae709e614f5f4"
        },
        {
            "title": "Big Chief",
            "artist": "Professor Longhair",
            "time": "2021-04-07 16:15:03",
            "links": {
                "artwork": "https://is1-ssl.mzstatic.com/image/thumb/Music/v4/fd/81/8b/fd818bb6-1e11-046d-b5da-7e76c6cc8e62/source/100x100bb.jpg",
                "artwork_600": "https://is1-ssl.mzstatic.com/image/thumb/Music/v4/fd/81/8b/fd818bb6-1e11-046d-b5da-7e76c6cc8e62/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview122/v4/d1/03/eb/d103eb9a-590e-d22a-91de-0ab369186765/mzaf_8453772585586990812.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/big-chief-complete-version/301683856?i=301683858&uo=4"
            },
            "token": "9e89922eb5b0066fde88fbbadd967650"
        },
        {
            "title": "Strange Fruit",
            "artist": "Billie Holiday",
            "time": "2021-04-07 16:12:02",
            "links": {
                "artwork": "https://is2-ssl.mzstatic.com/image/thumb/Music118/v4/d8/48/98/d848983c-cc36-ad96-bb00-75ece050dfee/source/100x100bb.jpg",
                "artwork_600": "https://is2-ssl.mzstatic.com/image/thumb/Music118/v4/d8/48/98/d848983c-cc36-ad96-bb00-75ece050dfee/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview118/v4/69/59/21/69592141-eaaf-8df3-871a-33c4e895b9b2/mzaf_3149108395393096449.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/strange-fruit-tricky-tool-remix/1440932824?i=1440933032&uo=4"
            },
            "token": "1dae2349ce1ed9dc8326cac09df9d307"
        },
        {
            "title": "Cover Girl",
            "artist": "Larry Coryell",
            "time": "2021-04-07 16:09:02",
            "links": {
                "artwork": "https://is4-ssl.mzstatic.com/image/thumb/Music3/v4/f6/d9/5f/f6d95f79-7eca-a530-a881-d73f181f265c/source/100x100bb.jpg",
                "artwork_600": "https://is4-ssl.mzstatic.com/image/thumb/Music3/v4/f6/d9/5f/f6d95f79-7eca-a530-a881-d73f181f265c/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music3/v4/a0/73/82/a07382cc-286b-2203-af3b-6d177317eaa2/mzaf_5044105790413623123.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/the-cover-girl-remastered-live/1037722772?i=1037723025&uo=4"
            },
            "token": "a5e1a949f4ce826ee3abc6ddb048c2ab"
        },
        {
            "title": "Captain Fingers",
            "artist": "Lee Ritenour",
            "time": "2021-04-07 16:06:04",
            "links": {
                "artwork": "https://is3-ssl.mzstatic.com/image/thumb/Music/v4/9b/37/da/9b37dae9-a67b-2fd9-494d-324cc86ffaf2/source/100x100bb.jpg",
                "artwork_600": "https://is3-ssl.mzstatic.com/image/thumb/Music/v4/9b/37/da/9b37dae9-a67b-2fd9-494d-324cc86ffaf2/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/ac/8f/0e/mzm.ayqioaha.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/isnt-she-lovely/185858011?i=185858334&uo=4"
            },
            "token": "432e1c1d96dd30bcfb60a53fd40f85aa"
        },
        {
            "title": "It Might as Well be Spring",
            "artist": "Sarah Vaughan",
            "time": "2021-04-07 16:03:04",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music3/v4/65/76/39/657639ca-d8ac-8523-e423-b080413b7480/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music3/v4/65/76/39/657639ca-d8ac-8523-e423-b080413b7480/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music1/v4/ba/f3/ab/baf3ab01-6e14-2902-07b5-7208a3ec8f7e/mzaf_7725367874576348608.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/it-might-as-well-be-spring-from-state-fair/934006376?i=934006862&uo=4"
            },
            "token": "3a6085c9693e5a2cafcca28b90b01938"
        },
        {
            "title": "Out of the Night",
            "artist": "Brian Melvin Trio",
            "time": "2021-04-07 16:00:02",
            "links": {
                "artwork": "https://example-com-10.mediarealm.dev/wp-content/plugins/metaradio-wordpress/img/default_100.jpg",
                "artwork_600": "https://example-com-10.mediarealm.dev/wp-content/plugins/metaradio-wordpress/img/default_600.jpg",
                "audio_preview": "",
                "itunes_store": ""
            },
            "token": "f819f058a5e0fd681241cf6c21de1d30"
        },
        {
            "title": "A Remark You Made",
            "artist": "Weather Report",
            "time": "2021-04-07 15:57:02",
            "links": {
                "artwork": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/ed/e4/d4/ede4d4a5-0080-add4-aecb-cc74487d9ce4/source/100x100bb.jpg",
                "artwork_600": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/ed/e4/d4/ede4d4a5-0080-add4-aecb-cc74487d9ce4/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music4/v4/ca/fe/d1/cafed1f8-56ad-da3e-1372-d07083352bc1/mzaf_3400216001350830749.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/a-remark-you-made/170409940?i=170410008&uo=4"
            },
            "token": "ba63ebf30f9da05ab5c258d459d44b78"
        },
        {
            "title": "School Days",
            "artist": "Stanley Clarke",
            "time": "2021-04-07 15:54:02",
            "links": {
                "artwork": "https://is2-ssl.mzstatic.com/image/thumb/Music1/v4/7f/76/d5/7f76d5e7-d8e1-adb2-7308-0702febef1cf/source/100x100bb.jpg",
                "artwork_600": "https://is2-ssl.mzstatic.com/image/thumb/Music1/v4/7f/76/d5/7f76d5e7-d8e1-adb2-7308-0702febef1cf/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music7/v4/95/6a/8e/956a8efd-162e-b599-07e4-f8b9c5b9a751/mzaf_8850345662220901071.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/school-days/993820729?i=993820736&uo=4"
            },
            "token": "ba07dc4f72b76552a73b5c28d9d1f6a7"
        },
        {
            "title": "Bemsha Swing",
            "artist": "Thelonious Monk",
            "time": "2021-04-07 15:51:02",
            "links": {
                "artwork": "https://is3-ssl.mzstatic.com/image/thumb/Music/v4/35/e4/c3/35e4c3b4-f21d-ff4c-61f6-abf8b88ff212/source/100x100bb.jpg",
                "artwork_600": "https://is3-ssl.mzstatic.com/image/thumb/Music/v4/35/e4/c3/35e4c3b4-f21d-ff4c-61f6-abf8b88ff212/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview71/v4/54/e0/73/54e07316-21aa-950a-76e4-d9bbdb41017b/mzaf_5150559234687422903.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/bemsha-swing-remastered/390732580?i=390735074&uo=4"
            },
            "token": "d19e01017fc5bda8d1b612108bb514e4"
        },
        {
            "title": "Speak no Evil",
            "artist": "Wayne Shorter",
            "time": "2021-04-07 15:48:04",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music118/v4/01/5e/c8/015ec8c2-82d6-bfc9-df2a-022ff438bc64/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music118/v4/01/5e/c8/015ec8c2-82d6-bfc9-df2a-022ff438bc64/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview128/v4/4a/0e/03/4a0e0394-aa8b-f92c-6af2-69bde1ec648f/mzaf_8685698439484235885.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/infant-eyes/723473694?i=723473860&uo=4"
            },
            "token": "a2602f112ca0b1c7d9097c5da0d20a0e"
        },
        {
            "title": "In a Silent Way",
            "artist": "Miles Davis",
            "time": "2021-04-07 15:45:02",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/63/c9/9d/63c99dfb-219b-bfa9-e2e3-eb818672ccae/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/63/c9/9d/63c99dfb-219b-bfa9-e2e3-eb818672ccae/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/da/17/b2/mzm.cmgqgwfv.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/in-a-silent-way-original-lp-excerpt/185606603?i=185607502&uo=4"
            },
            "token": "c3550f8bb0efaa9dff64549181b895e1"
        },
        {
            "title": "A Night in Tunisia",
            "artist": "Sonny Rollins",
            "time": "2021-04-07 15:42:02",
            "links": {
                "artwork": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/4b/2f/d2/4b2fd25e-986b-e153-2342-19c99e2ddb8f/source/100x100bb.jpg",
                "artwork_600": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/4b/2f/d2/4b2fd25e-986b-e153-2342-19c99e2ddb8f/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/v4/d8/fc/80/d8fc809d-f1a3-5478-8662-addb68a5f32e/mzaf_4043635465359286134.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/night-in-tunisia-live/81898910?i=81898906&uo=4"
            },
            "token": "f8889001205d990467130e735c1c9b24"
        },
        {
            "title": "Maiden Voyage",
            "artist": "Herbie Hancock",
            "time": "2021-04-07 15:39:02",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music128/v4/18/d9/64/18d96440-8b09-25d1-a4cd-8851be177c90/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music128/v4/18/d9/64/18d96440-8b09-25d1-a4cd-8851be177c90/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview118/v4/69/6a/96/696a961c-59df-6670-4f4d-c7064909bddb/mzaf_2023562182141633471.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/maiden-voyage/1443065642?i=1443065650&uo=4"
            },
            "token": "44a9e4f7900719d4360f5479f2a49846"
        },
        {
            "title": "Hello, Dolly",
            "artist": "Louis Armstrong",
            "time": "2021-04-07 15:36:02",
            "links": {
                "artwork": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/4c/ff/b2/4cffb261-0571-9825-99a0-92c549777fdb/source/100x100bb.jpg",
                "artwork_600": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/4c/ff/b2/4cffb261-0571-9825-99a0-92c549777fdb/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview128/v4/59/43/45/59434599-5287-3fea-c3ca-6bdbb080316d/mzaf_974278136448536047.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/hello-dolly/1434925400?i=1434925920&uo=4"
            },
            "token": "fb64849e738f0ab59c6359ad54c77e70"
        },
        {
            "title": "Red Clay",
            "artist": "Freddie Hubbard",
            "time": "2021-04-07 15:33:02",
            "links": {
                "artwork": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/20/49/73/20497349-989c-1359-a9ed-b2dca0b5eb59/source/100x100bb.jpg",
                "artwork_600": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/20/49/73/20497349-989c-1359-a9ed-b2dca0b5eb59/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/2f/7e/0f/mzm.oyxunorn.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/suite-sioux/190632242?i=190632343&uo=4"
            },
            "token": "1fabfcba16c90dcb00c36c12ec750057"
        },
        {
            "title": "Lazy River",
            "artist": "Pete Fountain",
            "time": "2021-04-07 15:30:02",
            "links": {
                "artwork": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/26/a1/6d/26a16df9-cf4b-6cb0-e6a1-7d50a3d046b3/source/100x100bb.jpg",
                "artwork_600": "https://is5-ssl.mzstatic.com/image/thumb/Music/v4/26/a1/6d/26a16df9-cf4b-6cb0-e6a1-7d50a3d046b3/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/Music/v4/f0/8a/b6/f08ab6d5-0caa-8dc4-4961-bf8edf8040e4/mzaf_6110043923225169267.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/the-lazy-river/284828751?i=284828779&uo=4"
            },
            "token": "a8416933482f681a23eae709e614f5f4"
        },
        {
            "title": "Three Views of a Secret",
            "artist": "Jaco Pastorious",
            "time": "2021-04-07 15:27:02",
            "links": {
                "artwork": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/7d/8a/ff/7d8affc3-7f53-91cc-fdb7-8be4be38394d/source/100x100bb.jpg",
                "artwork_600": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/7d/8a/ff/7d8affc3-7f53-91cc-fdb7-8be4be38394d/source/600x600bb.jpg",
                "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview122/v4/78/65/e3/7865e3cd-e5f7-b2cf-1b3c-b3976c159d63/mzaf_3171526639962260569.plus.aac.p.m4a",
                "itunes_store": "https://music.apple.com/au/album/three-views-of-a-secret/504179391?i=504179393&uo=4"
            },
            "token": "f78950b6d9fd309faf2eb1a2e648c941"
        }
    ],
    "now": {
        "title": "Tones for Elvin Jones",
        "artist": "John McLaughlin",
        "time": "2021-04-07 16:21:02",
        "links": {
            "artwork": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/d4/9e/f5/d49ef58d-4148-2837-682b-0c71def1d470/source/100x100bb.jpg",
            "artwork_600": "https://is3-ssl.mzstatic.com/image/thumb/Music128/v4/d4/9e/f5/d49ef58d-4148-2837-682b-0c71def1d470/source/600x600bb.jpg",
            "audio_preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview118/v4/c6/7c/a0/c67ca0fa-7092-4dfe-d465-36e7612006f5/mzaf_4173962343043119023.plus.aac.p.m4a",
            "itunes_store": "https://music.apple.com/au/album/tones-for-elvin-jones/1442870894?i=1442870911&uo=4"
        },
        "token": "1c90b5684c3914ac7bad023afbc1eb07"
    },
    "refreshSecs": 68,
    "program_now": {
        "programId": "38",
        "name": "Czech Downunder Wed",
        "presenter": "Karel and Stanya",
        "image_600": "https://amrap-pages-image.s3.amazonaws.com/profile/8810.jpg?cacbeb=71626701",
        "url": "/",
        "startTime": "15:30",
        "endTime": "17:00",
        "startDateTime": "2021-04-07 15:30",
        "endDateTime": "2021-04-07 17:00",
        "startDateTime_unix": "1617773400",
        "endDateTime_unix": "1617778800"
    },
    "program_next": {
        "programId": "39",
        "name": "Brisbanen Suomiradio Wed (Finnish)",
        "presenter": "See Description",
        "image_600": "https://amrap-pages-image.s3.amazonaws.com/profile/8811.jpg?cacbeb=28680522",
        "url": "/",
        "startTime": "17:00",
        "endTime": "18:00",
        "startDateTime": "2021-04-07 17:00",
        "endDateTime": "2021-04-07 18:00",
        "startDateTime_unix": "1617778800",
        "endDateTime_unix": "1617782400"
    }
}

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)

Get the Broadcast Technology Newsletter

Sign up for the email newsletter about media and technology. Sent irregularly. No spam.