Hey guys,
I know a lot of you have been waiting for this so here it is, the TV API.
We currently have 17 methods available:
GET '/3/tv/:id'
GET '/3/tv/:id/credits'
GET '/3/tv/:id/external_ids'
GET '/3/tv/:id/images'
GET '/3/tv/:id/translations'
GET '/3/tv/:id/season/:season_number'
GET '/3/tv/:id/season/:season_number/credits'
GET '/3/tv/:id/season/:season_number/external_ids'
GET '/3/tv/:id/season/:season_number/images'
GET '/3/tv/:id/season/:season_number/episode/:episode_number'
GET '/3/tv/:id/season/:season_number/episode/:episode_number/credits'
GET '/3/tv/:id/season/:season_number/episode/:episode_number/external_ids'
GET '/3/tv/:id/season/:season_number/episode/:episode_number/images'
GET '/3/tv/on_the_air'
GET '/3/tv/top_rated'
GET '/3/tv/popular'
GET '/3/search/tv'
GET '/3/discover/tv'
And 3 new person credit methods to support TV and external IDs:
GET '/3/person/:id/movie_credits'
GET '/3/person/:id/tv_credits'
GET '/3/person/:id/combined_credits'
GET '/3/person/:id/external_ids'
And also new credit, find and network namespace:
GET '/3/credit/:id'
GET '/3/find/:id'
GET '/3/network/:id'
Functionality wise, they work almost identical to movies or the way you expect things to work on v3. The most notable thing missing right now is getting to the TV credits from the person side of things. I'll be working on that this week.
Understandably, this is a preview release and should be considered a risk. Some data could change depending on the feedback I get and if you roll this out publicly you are assuming that risk. I don't expect it to be like this for long, maybe a few weeks. I'll let everyone know when the design is final.
Now go ahead everyone, test!
Open Tickets
Resolved Tickets
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by jigas
on December 22, 2013 at 10:21 AM
: (
Well , that forces me to make 2 requests to the server. In my database i have the :imdbid that i need to convert to id
so , i will request /find/{imdbid} --> return {id}
a new call : /3/tv/ {id} /images
how can we merge that to one call ? regards
Reply by Travis Bell
on December 22, 2013 at 10:36 AM
You will have to make two calls. It's how the API is designed.
If I was you, I would run through all of your IMDB IDs and get the TMDb ID and save it in your DB. You would only have to do this once per ID and then never worry about it again.
Reply by RoliSoft
on December 26, 2013 at 9:31 AM
Hello,
Is it possible to fetch all episodes with a single query?
If I understand correctly, currently
/3/tv/:id
returns only the available season numbers, and I'd have to send a request for each season to/3/tv/:id/season/:num
in order to fetch all episodes. This would be undesirable in some cases, where there are just way too many seasons.Thank you for your response in advance.
EDIT: Nevermind, I've figured it out. Solution in case anyone else is bothered by this:
/3/tv/:id?api_key=:key&append_to_response=season/1,season/2[,etc]
Reply by Travis Bell
on December 26, 2013 at 12:48 PM
HA! Truthfully, I didn't even know that would work, but very cool to know that it does.
Reply by Zippie
on December 27, 2013 at 5:30 AM
Hey Travis,
Noticed that the freebase Id's don't seem to be working when searching for tv series. I suspect this is because they include '/' ex: '/en/breaking_bad' or '/m/03d34x8' respectively the freebase id and freebase mid for breaking bad.
I've tried url encoding them but then I just don't get any hits
Reply by Travis Bell
on December 27, 2013 at 11:20 AM
Hey Zippie,
Good catch, interesting. I'm sure you're right, it's tripping on the slashes and treating them as URL paths instead of discrete values. I've created a new ticket for this here.
Reply by samingle
on January 19, 2014 at 5:14 PM
I'm attempting to get a list of credits for several actors with one request, and running into a bit of a wall. The request works fine in every context except AJAX, where it hits a cross-site scripting error (the rest of the requests I'm doing work fine over AJAX, so I'm assuming this is a configuration issue of some sort).
Here's the request I'm sending:
It works exactly as expected over CURL etc., returning the tv credits of the 5 actors listed, but over AJAX the request gets denied.
Reply by Travis Bell
on January 20, 2014 at 12:49 PM
Actually, I think what is happening is that you're not specifying a person ID so the API is returning a 404 not found, even though it's finding some results via the append to response.
Basically, the API is not designed to be used like this. The
/person/:id
method enforces the lookup of an ID and there is no way around this right now. There is no/person
method.Reply by samingle
on January 20, 2014 at 3:06 PM
Wouldn't it also receive a 404 on other access methods if that were the case? It returns exactly as expected if I query it from PHP, etc., just not AJAX (and it sort of has to happen over AJAX due to the rate limiting).
Reply by Travis Bell
on January 20, 2014 at 3:30 PM
The issue being that I'm betting PHP isn't caring about the response headers and only the response body, so it's working. Your browser (or specifically whatever library you're using jQuery, Ext, etc…) does care about the response headers and since it's not getting a 200 status back it's failing, regardless of any response body being returned.
At this time, there is no
/person
method, only/person/:id
.Reply by samingle
on January 20, 2014 at 3:32 PM
Makes sense. Any future plans to add a method of fetching this sort of data, or should I just separate it into a bunch of individual requests?
Reply by Travis Bell
on January 20, 2014 at 3:38 PM
There is no plans at this time, you should make separate requests.
There are lots of neat ways you can use
?append_to_response
to blend requests into a single HTTP call similar to this but this specific example isn't officially supported.I'll probably push a fix to simply ignore the
append_to_response
param on 404 responses so at least then it wouldn't be a little confusing like it is here.Reply by rcoenen
on January 22, 2014 at 1:29 PM
Why is the duration of episodes listed as property of the TV series instead of a length/duration property for each single episode? Currently it is impossible to track any series that have episodes that have a variable length. Basically, the current approach works for ie Game of Thrones where every episode is indeed exactly 60 minutes, but what if a special episode (christmas edition, etc.) would be say, 90 minutes?
Reply by Travis Bell
on January 22, 2014 at 1:45 PM
We don't track per episode runtimes. We can think about adding that later but I'm betting most of the time these values wouldn't be filled in. In any case, I've created a new ticket for this and will consider it in the future.
Reply by Travis Bell
on February 3, 2014 at 1:10 PM
FYI, the
/tv/on_the_air
method is live.I also pushed a fix for the Freebase lookups:
And also, there's now a
/person/:id/external_ids
method.Cheers.