Topic: API 2.1

Hey guys,

I have migrated all of the methods over to the new system. As well as introduced the new, longly awaited Person.x methods. Lots has been improved, such as, but not limited to:

  • Improve text searching: I have done some major tweaking to the index movie search filter. This is going to take a lot testing but the API should find the proper movie higher in the list (ie. it's score). Things like apostrophes and other characters shouldn't impact searching any more. If you find one that doesn't work properly, let me know.

  • Fix UTF-8 issues: Searching characters like é will work properly now.

  • Make API RESTful: The API supports XML, YAML, and JSON output now.

  • Proper genres: I have re-implemented the categories section to properly display actual genres now.

  • Add studios: Studios have been added to the Movie.getInfo method.

The new request URLs looks like the following:

Movie Methods

http://api.themoviedb.org/2.1/Movie.search/en/xml/APIKEY/Fight+Club

AND

http://api.themoviedb.org/2.1/Movie.getInfo/en/xml/APIKEY/550

AND

http://api.themoviedb.org/2.1/Movie.imdbLookup/en/xml/APIKEY/tt0137523

Person Methods

http://api.themoviedb.org/2.1/Person.search/en/xml/APIKEY/Brad+Pitt

AND

http://api.themoviedb.org/2.1/Person.getInfo/en/xml/APIKEY/287

You'll notice the URL is split into 4 groups, language, type, api key and your search.

  • Language: The language is only available for English right now, but obviously I am working towards changing that.

  • Type: Can be set to either: XML, YAML, JSON

  • API Key: Same API key you've been using all along.

  • Search: Either the ID or title depending on the method you are using.

Please post all issues in this thread.

Thanks!

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

hey Travis,
Thanks for this update! Is there a place where i can see the XML schema for the new version?

Also, in the previous API, if there was no item entered for movie.getinfo (for example there was no Released date set), it would not even have the "Released" tag in the xml, will it now send a blank <Released /> tag?

Edit 2: a search for "Batman Begins" still returns "The Dark Knight" as the first result with a score of 1. I'm guessing it's b/c of the alternate title of The Dark Knight, which is set to Batman Begins 2.

Edit 3: rating does not seem to be included in the XML.

Edit 4: for some backdrops you have size="thumb" and for others size="thumbnail"

Take Care

Last edited by <>< (2009-05-04 16:28:48)

Re: API 2.1

Hey,

Thanks for mentioning these, I'll take a look tonight when I get home. This is why I wanted some extra eyes! big_smile

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

It's working good so far except for the items listed above, i released a new version of meta<browser/> using the 2.1 api for testing purposes to see if users find any errors.

The only real error i've gotten thus far is for for movie.search when searching for "Purple Rain" which returns the error: '--' is an unexpected token. The expected token is '>'. Line 31, position 3.

Also the search and getinfo is a lot slower than the previous version, although images are super fast.

Take Care

Re: API 2.1

<>< wrote:

Thanks for this update! Is there a place where i can see the XML schema for the new version?

There isn't yet, as I move towards final, I will be updating/creating the documentation section.

<>< wrote:

Also, in the previous API, if there was no item entered for movie.getinfo (for example there was no Released date set), it would not even have the "Released" tag in the xml, will it now send a blank <Released /> tag?

All of the tags should show now, regardless if they are empty or not.

<>< wrote:

Edit 2: a search for "Batman Begins" still returns "The Dark Knight" as the first result with a score of 1. I'm guessing it's b/c of the alternate title of The Dark Knight, which is set to Batman Begins 2.

Ya, this is a tricky one since the titles are in essence the same. I'll see if I can lower the score if they are the same, but one is a primary title, and the other is an alternative.

<>< wrote:

Edit 3: rating does not seem to be included in the XML.

Added.

<>< wrote:

Edit 4: for some backdrops you have size="thumb" and for others size="thumbnail"

Good catch, this is from the old _original_sized thumbnails. I still have plans on resizing those so when I do, they will change over to just "thumb". But for now, I will just hardcode them all to be "thumb".

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

<>< wrote:

The only real error i've gotten thus far is for for movie.search when searching for "Purple Rain" which returns the error: '--' is an unexpected token. The expected token is '>'. Line 31, position 3.

It's actually returning an error, in HTML which is why you're getting the strange XML parsing. I will investigate what's causing the error, looks like there's a few movies doing it.

<>< wrote:

Also the search and getinfo is a lot slower than the previous version, although images are super fast.

2.1 is not cached right now, which is why it is slower big_smile

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

Hoy travis,

Excellent api you have here! I already implemented the beta in my personal application.

I have found the same mistake as above with the movie "Wanted".

Re: API 2.1

Yea, I'm not sure what's causing those errors quite yet. I will dedicated some time tonight to figure it out.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

All of the bugs above should be fixed. If you find any more movies that error, let me know.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

10

Re: API 2.1

Hey travis,

The text search seems a little off for some titles, for examples (reported by some users)

A search for "A bug's life" returns the correct movie as the first result
A search for "A bugs life" returns transformers as the first result
A search for "Without a Paddle" returns "Rebel Without a Cause" as the first result
A search for "Spider-Man X" (where x is a number) always returns "Spider-Man 3" as the first result

Another user's experience with the title search:

Jon wrote:

For example, titles with words such as 'The', 'A', 'An', etc. (i.e. filtered words) seem to return results where the actual title is further down the detected list. Such as 'The Sword in the Stone'. There are a bunch of titles found long before it appears in the list...titles that are nowhere near a closer match. Also, titles that have special characters like a ':' or '!' may not even show up at all. A search for the title 'Top Secret!' returns absolutely nothing. If I remove the '!', it's found right away. I know I didn't have to do this when i first began using MB.

Other than the text search inconsistencies everything else has been working very well, no issues.

Take Care

Last edited by <>< (2009-05-15 12:11:13)

Re: API 2.1

Hi Travis,
I'm not sure if this is the place to mention this, but "Planet of the Apes (1968)" doesn't show up when you search from the homepage. It shows the 2001 remake and all the 1970's sequels. The movie does exist. It's ID is 871

Thanks...
Mark

Re: API 2.1

Abbymark wrote:

Hi Travis,
I'm not sure if this is the place to mention this, but "Planet of the Apes (1968)" doesn't show up when you search from the homepage. It shows the 2001 remake and all the 1970's sequels. The movie does exist. It's ID is 871

Hey Mark,

This isn't actually the right place wink but the movie can be found now.

Cheers,

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

Is there by any chance an ETA as to when a 2.1 version of the API will be solid and dependable enough to use for production usage?

As well, am I correct in thinking that the only other version in such a state currently is 1.0?

Thanks

Re: API 2.1

Hey Akiva,

2.1 is pretty damn near, and I am ok if you guys start rolling everything over. I am moving back home this weekend (from here in Australia back to Canada) so I'll be MIA for probably about a week. I mention this since there is still a very key method ) the imdbLookup method that hasn't been ported over to 2.1 yet.

I also need to continue some title searching tweaks but all in all, the system and the structure seem to be solid, as I haven't heard much from anyone.

Cheers,

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

Working great so far. I did find some results that could be improved. For example:

- 'Underdog' matches 'Dodgeball: A True Underdog Story' first then 'Underdog' itself.
- 'The Secret Life Of Bees' matches 'Transformers', a lot of others and then 'The Secret Life Of Bees'. API 2.0 matches it perfectly.
- 'Boy A' matches a lot of others first, then 'Boy A'.
- Same for 'Into The Blue'.

Maybe a simple addition could be made to sort exact matches first and/or rate them the highest. I'm thinking about adding this to my own code for now.

Last edited by redindian (2009-05-25 17:08:31)

Re: API 2.1

I've noticed that languages are not being returned by the Movie.getInfo method. Is this intentional or an oversight?

Also, only categories with type genre are returned. I won't be using the other types production, source, etc. but should be included for completeness.

Overall it's a vast improvement on the previous API.

Many thanks.

SwissCenter Developer
www.swisscenter.co.uk

Re: API 2.1

Hi Travis,
I've noticed a the Movie search method returns two results for "Meet The Parents" the first ID being 17215 and the second is 1597. If you use the first id (17215) with the movie getinfo method, you get an internal server error.

Re: API 2.1

Pernod wrote:

I've noticed that languages are not being returned by the Movie.getInfo method. Is this intentional or an oversight?

Languages are not being returned (they weren't in 2.0 either) but I could definitely add them. This was not really on purpose, just an oversight.

Pernod wrote:

Also, only categories with type genre are returned. I won't be using the other types production, source, etc. but should be included for completeness.

I'll be fleshing out those other categories later.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

Stick wrote:

I've noticed a the Movie search method returns two results for "Meet The Parents" the first ID being 17215 and the second is 1597. If you use the first id (17215) with the movie getinfo method, you get an internal server error.

Looks like that stems from an issue searching even the site. When I get more time I'll look into what's causing the error.

Thanks.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API 2.1

is there any chance you can include "Series" and "Part" in the getmovieinfo method?

eg for "Star Wars Episode 1", series would be "Star Wars" and part would be "1".  this would come in handy when sorting films (since some dont have a number in them, "Indiana Jones and the Last Crusade" would appear before "Indiana Jones and the Raiders of the Lost Ark" if sorted alphabetically)

Re: API 2.1

reven wrote:

is there any chance you can include "Series" and "Part" in the getmovieinfo method?

eg for "Star Wars Episode 1", series would be "Star Wars" and part would be "1".  this would come in handy when sorting films (since some dont have a number in them, "Indiana Jones and the Last Crusade" would appear before "Indiana Jones and the Raiders of the Lost Ark" if sorted alphabetically)

I second that request, it was talked about a bit on the XBMC forums as their software can't group movies at the moment.

http://xbmc.org/forum/showthread.php?t= … mp;page=11

Re: API 2.1

I'm not sure if this is a bug as I'm new to using the api but when you search for some films you get repetition in the results.

The only one that I have come across so far is Amélie:

http://api.themoviedb.org/2.1/Movie.sea … ain%201994

As I haven't seen films being repeated in results before I thought I better report it

I hope that helps.

Re: API 2.1

So I had a chance to look at the repetition of Amélie. This is due to there being a repeat of the film in the system, I originally was only looking at the imdb numbers, which are the same. But they have different tmdb id's:

194
16357

Where 16357 clearly needs to be removed...

So nothing wrong with the api where that issue is concerned.

Re: API 2.1

I have gone ahead and deleted 16357. Thanks for the extra troubleshooting.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

25

Re: API 2.1

Just another lil issue...

When searching for a movie, for example "Dehli 6" (and a lot of other movies)...if the movie does not exist it should come back as 0 results found instead of listing 17 movie results for "Dehli 6" which really have nothing to do w/ the text being searched for.

For example Searching for "Mr. ABCDEFG" returns 19 results...maybe bet a little more strict for the search? the 2.0 API returns better results...

Thanks

Last edited by <>< (2009-06-11 21:44:12)