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
| Field | Type | Description |
|---|---|---|
is_live | boolean | true if a show is currently on air |
current | object or null | The show currently on air |
next | object or null | The next upcoming show |
Show fields
| Field | Type | Description |
|---|---|---|
title | string | Show title |
show_id | integer | Show ID |
description | string | Show description |
image | string | Show artwork URL |
start_time | integer | Unix timestamp when the show starts |
end_time | integer | Unix 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:
- Current show: The schedule entry where the current time falls between start and end
- 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
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.