Get Public Events for a Channel
Updated
Want to show viewers when you're live, or let them know when your next stream starts? Sardius provides a public calendar endpoint that returns event information for any channel. You can use it to add a "Live Now" banner to your website, display a countdown to your next event, or send viewers straight to your live page.
How It Works
The endpoint returns events from a two-week window: 7 days in the past and 7 days in the future. Depending on the route you choose, it returns your most recent event, your current live event, your next upcoming event, or all of them.
The endpoint is public, so no authentication is required.
Endpoint URL
https://watch.sardius.media/calendar/{accountId}/{channelId}/{route}
| Parameter | Description |
|---|---|
accountId | Your Sardius account ID |
channelId | The ID of the channel (site) whose events you want to retrieve |
route | The type of event data to return (see below) |
Available Routes
| Route | What It Returns |
|---|---|
previous | The most recent past event |
live | The event that is currently live, if there is one |
next | The next upcoming event |
event | The previous, live, and next events together |
events | All events in the feed |
all | Everything above in a single response |
Example request:
https://watch.sardius.media/calendar/YOUR_ACCOUNT_ID/YOUR_CHANNEL_ID/event
Example Response
Below is a shortened example of a response from the event route. In this example, nothing is live, so live returns an empty object.
{
"previous": {
"id": "91",
"title": "Sunday Service",
"start": "2023-04-17T09:58:09-05:00",
"end": "2023-04-17T10:05:00-05:00",
"timezone": "America/Chicago",
"locked": false,
"metadata": {
"description": "",
"subtitle": "",
"eventImage": ""
},
"accountId": "YOUR_ACCOUNT_ID",
"calendarId": "YOUR_CHANNEL_ID",
"siteId": "YOUR_CHANNEL_ID"
},
"live": {},
"next": {
"id": "51_51_2023113",
"title": "Weekly Broadcast",
"start": "2023-04-23T08:00:00-04:00",
"end": "2023-04-23T09:00:00-04:00",
"timezone": "America/New_York",
"locked": false,
"metadata": {
"description": "",
"subtitle": "",
"eventImage": ""
},
"recurring": {
"ends": "never",
"days": ["SU"],
"interval": 1
},
"accountId": "YOUR_ACCOUNT_ID",
"calendarId": "YOUR_CHANNEL_ID",
"siteId": "YOUR_CHANNEL_ID"
}
}
Note: Full responses include additional fields, such as publishing and live encoding settings. The fields below are the ones most useful for displaying events on your site.
Key Fields
| Field | Description |
|---|---|
id | Unique ID of the event |
title | Event name |
start / end | Event start and end times in ISO 8601 format, including the time zone offset |
timezone | The time zone the event was scheduled in |
locked | Whether the event is locked |
metadata.description | Event description |
metadata.subtitle | Event subtitle |
metadata.eventImage | Event image, if one is set |
recurring | Present on recurring events; shows the repeat schedule (for example, "days": ["SU"] repeats every Sunday) |
