BETA: API & Feeds

Hey everyone, we just launched our first dabble into providing a stable, documented, read-only API for Channels DVR Server.

This is early still, but provides a lot of coverage for your library. It's currently read-only for now. Eventually the API will evolve to provide ways to mutate the data in your library like marking things as favorites, or editing metadata.

But for now, we're looking to nail down the data we're providing you and also making sure everything is running smoothly.

Feeds?

The API provides data in 4 formats: JSON, RSS, ATOM, and iCAL. The iCal format is only available for Jobs. We've provided these different types of formats so your data is available in as many different ways that you want to use it.

Additionally, since Channels DVR Server provides feeds now, you'll see feed buttons scattered throughout the web admin while browsing your library. These are little helpers to let you grab prebuilt feeds for certain content like Recently Added Movies. Simply click the button to copy the URL for the feed.

Documentation

Documentation does not yet exist, but will be provided eventually during the beta process. For now, here's some information to get you started

Formats

The API can return the data you request in 4 different formats:

  • JSON
  • RSS
  • ATOM
  • iCAL - Jobs only

Data Models

Here's the object types you can retrieve from the API:

  • TV Shows
  • Video Groups
  • Episodes
  • Movies
  • Videos
  • Jobs

Each item has an endpoint to receive all of them, or a unique item by providing it's unique ID.

Sort

You have the ability to specify how they are sorted.

  • Alphabetically
  • Date Added
  • Date Released
  • Date Updated
  • Date Watched

Episodes & Videos

Episodes and videos can be filtered by their show or video group to return those for just the show or group you choose.

Sources

You can filter the results based on how they were added to the library or what type they are:

  • Recordings
  • Imports
  • Play On Cloud
  • Stream Links
  • Stream Files

Filters

You can filter the results based on certain properties:

  • Watched status
  • Favorited status
  • Verified status

API & Feed Explorer

Under the Support tab in the main navigation, you'll find API & Feeds.

We've provided a way to explore the API, help build the URLs you need, and preview the results they provide.

We hope this is a helpful way for you to get to know the API and helps you build and utilize endpoints for whatever way you're using them. With documentation non existent for now, use the Explorer to see the properties of the data models that are available.

Here's a short video showing how it works.

Feedback

Please check out the API and use it where you may have been using the undocumented API endpoints, as this is the proper way to consume data from your Channels DVR Server library now.

Please use this thread to provide feedback on:

  • Is there any properties of the data models that you are missing or need?
  • Is there any way filtering could improve?
  • Anything in general that you feel like is missing.

Thanks so much in advances for your feedback and remember that this is currently beta so things will change, the API will be stable, but it's not stable yet.

Thanks!

16 Likes

Great new feature! Thanks for putting this into the WebUI.

I'm seeing something weird in preview. In API & Feed Explorer I select JSON, Date Added, Descending and select the preview tab. This looks good and matches what I would expect.

Then I select the RSS feed pulldown, and the preview looks good. [edit: fixed image]

Then I go back and select the JSON output and the preview shows four different shows before listing the same shows initially previewed. Selecting the response tab instead of preview shows what looks like the correct recordings in JSON. It seems that selecting output feed types confuses the preview.

1 Like

please consider adding a way to create m3u/xml feeds for external players. a way that will allow different types of feeds by source, xml data duration, etc.

thanks.

2 Likes

I’m seeing this too and can’t reproduce it in development mode. But I’m on it!

2 Likes

@cyoungers OK, update to the latest pre-release. I've made a bunch of changes that I think will fix the things you've seen. Please let me know.

Actually, I think it's still happening. I'll keep at it!

3 Likes

It seems to be fixed in 2023.02.17.0132. No preview weirdness switching between JSON, RSS and Atom.

1 Like

OK, with the latest pre-release build, things should be settled down now and be better.

Trying it out for jobs on v2023.02.17.1927

RSS feed

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Channels DVR Server</title>
    <link>http://192.168.1.3:8089/admin/browse/jobs?sort=date_added</link>
    <description>Scheduled Jobs</description>

Following <link>http://192.168.1.3:8089/admin/browse/jobs?sort=date_added</link> results in javascript error

Atom feed

<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>Channels DVR Server</title>
  <id>http://192.168.1.3:8089/admin/browse/jobs?sort=date_added</id>
  <updated>2023-02-18T21:25:35-08:00</updated>
  <subtitle>Scheduled Jobs</subtitle>
  <link href="http://192.168.1.3:8089/admin/browse/jobs?sort=date_added"></link>

Following <id>http://192.168.1.3:8089/admin/browse/jobs?sort=date_added</id> results in javascript error
Following <link>http://192.168.1.3:8089/admin/browse/jobs?sort=date_added</link> results in javascript error

In fact going to http://192.168.1.3:8089/admin/browse/jobs results in javascript error

Looks like an excellent start with the API's.

Just looking at one series episode as an example, I see the JSON output for JOBS is missing the following information;
Airing.Categories
Airing.FullSummary
Airing.ProgramID
Airing.SeriesID

Would it be easy to add these?

Haven't looked at Specials, Sports Events or Movies yet.

We don’t really expose that info anywhere, but I think this is a good place to do that.

I’ll look into it for sure.

3 Likes

Thanks, I use those in a lot of my curl/jq scripts and also copy/paste the last three into the MCEBuddy Metadata json files Channels DVR generates for recordings. Hopefully those are in one of the other API's for Library files (I have to check).
Nope, looks like just seriesID (as show_id) appears for Library files.

Another request, this one for Imported content.
This appears in /dvr/files, but not the new API.
Path
which shows where the imported file is on disk.

Thanks for considering it.

Update: Actually would like to see that for all Library file types (since it's already there in /dvr/files)

3 Likes

Ahh, this URL is incorrect, that's why. This has been resolved in the latest pre-release.

Thank you!

Aww shucks!
And I thought it was a new scheduled jobs browser that let you filter by Title or Channel.
Can we get the channel added to the API for Jobs?
/dvr/jobs > .Airing.Channel NOT .Channels

No, this is the format of the public api, please adjust your scripts accordingly.

OK, I'll quit asking for things :smile:

1 Like

Nah, your previous suggestions were great and useful. Keep the feedback coming.

5 Likes