Skip to main content

Now Playing

Get what's currently on air and what's coming up next.

Get now playing

GET /v1/now-playing

Returns the show that's currently on air and the next scheduled show. Useful for building "now playing" displays or live status indicators.

Response (show on air)

{
"is_live": true,
"current": {
"title": "Morning Drive",
"show_id": 15,
"description": "Wake up with the best music",
"image": "https://cdn.example.com/shows/morning.png",
"start_time": 1707472800,
"end_time": 1707483600
},
"next": {
"title": "Afternoon Show",
"show_id": 16,
"description": "Your afternoon soundtrack",
"image": "https://cdn.example.com/shows/afternoon.png",
"start_time": 1707483600,
"end_time": 0
}
}

Response (nothing scheduled)

{
"is_live": false,
"current": null,
"next": null
}

Fields

FieldTypeDescription
is_livebooleantrue if a show is currently on air
currentobject or nullThe show currently on air
nextobject or nullThe next upcoming show

Show fields

FieldTypeDescription
titlestringShow title
show_idintegerShow ID
descriptionstringShow description
imagestringShow artwork URL
start_timeintegerUnix timestamp when the show starts
end_timeintegerUnix timestamp when the show ends (0 for the next show when end time is not calculated)

How it works

The endpoint checks your broadcast schedule and the current time (in your station's timezone) to determine:

  1. Current show: The schedule entry where the current time falls between start and end
  2. Next show: The first schedule entry that starts after the current show ends

If there's nothing scheduled right now, both current and next are null and is_live is false.

Caching

This endpoint is cached for 15 seconds server-side. There's no benefit to polling more frequently than every 15 seconds.

Example

curl -H "X-API-Key: your-key" \
https://api.autopod.xyz/v1/now-playing

Use cases

  • "Now playing" widget — show what's on air on your website
  • Live status indicator — display "LIVE" when a show is on air
  • Schedule transitions — trigger actions when shows change
  • Chatbot integration — answer "what's on?" queries

Polling recommendation

If you're building a live display that updates in real time, poll every 30 seconds:

async function updateNowPlaying() {
const response = await fetch('https://api.autopod.xyz/v1/now-playing', {
headers: { 'X-API-Key': apiKey }
});
const data = await response.json();

if (data.is_live) {
showCurrentShow(data.current);
showUpNext(data.next);
} else {
showOffAir();
}
}

// Update every 30 seconds
setInterval(updateNowPlaying, 30000);
updateNowPlaying(); // Initial fetch
tip

If you only need now-playing information for display on your website, consider using the Now/Next widget instead of building a custom integration — it handles polling and display automatically.