Help with API Request

Hello,

I am trying to ween myself from Sickbeard and move all to Sonarr. For a year or so, I have been relying on a personal web portal that scrapes data from Sickbeard and posts it into the portal. Specifically (via PHP) I scraped:

  • Missed Episodes
  • Episodes Airing Today (which I have not yet downloaded)
  • Episodes Airing in the upcoming week, sorted by most recet first.
  • Scrapes the number of episodes currently snatched and being downloaded

Can some kind soul please help me with what the http url would be to return this data… It should be something like:

http://localhost:8989/api/myapinumberhere/

For each of the items above, I want to return the show name, Sonarr url for the show, episode title, show banner link, episode number (s02e12), and episode plot.

It has been a long while since I have touched programming this stuff, and I could not figure it out from reading the Sonarr API wiki.

Many thanks!

H.

The API key needs to be sent as a header (X-Api-Key = x) or a query param (?apikey=x or &apikey=x depending if there are other query params).

/api/wanted/missing will get you missing (see the wiki page for the parameters you need to send)
/api/calendar will get you the upcoming episodes (which can be adjusted by start and end date)
/api/queue will get you the items being downloaded

Thank you markus… I am embarrassed to say I do not understand the header/query thing… Could I trouble you to post a full example of what the url would look like? I am doing this via a PHP via filegetcontents and specifying the full url.

What is the format of the start and end dates…?

Thanks again.

http://localhost:8989/api/queue?apikey=x
http://localhost:8989/api/calendar?start=y&end=z&apikey=x

ISO 8601 (the same format that Sonarr’s API returns) is preferred: YYYY-DD-MM HH:mm:ssZ

Thank you Markus,

I will be trying it out. I really appreciate your help.