The Movie Database Support

I am writing an application in Perl to display movies released in the last week. I have the code working, but it's slow. I call the API with discover/movie to get all the newly released movies, and then call the API with movie/{id}/releases for each of the movies so I can extract only movies with US releases. This code takes about 10 seconds. Then I call the API with movie/{id} to get basic information about each of the movies. This portion takes about 13 seconds. So, to get a complete list of US-released movies for one week takes about 23 seconds (depending on how many movies were released that week). This is obviously slow. If I want to use the API for this purpose, is it expected that I write code to download the entire database, update the data periodically, and access the data locally?

1 reply (on page 1 of 1)

Jump to last post

Hi celiao,

A few things.

Use ?append_to_response so you only have to make the movie call with releases once. That's half as many calls as you're currently making.

Depending on the way the interface works, most people don't go and query every page of the discover results. Most UI's might only show 10 items at a time, so you can only grab the first page and as the user scrolls be loading more pages behind the scene. This way you're only grabbing 20 items at a time. For examples of this depending what platform you're on, there's a number of apps you can see who have implemented something like that on our apps page.

We let you do approximately 3 requests per second so you can do multiple requests at a time if you spun up concurrent requests.

Depends what you're trying to build. Lots of apps just query our DB directly while others are doing a lot more custom things that require their own DB.

Can't find a movie or TV show? Login to create it.

ყველგან

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

მედიის გვერდზე

b go back (or to parent when applicable)
e go to edit page

ტელევიზიის სეზონების გვერდზე

(right arrow) go to next season
(left arrow) go to previous season

ტელევიზიის ეპიზოდების გვერდზე

(right arrow) go to next episode
(left arrow) go to previous episode

გამოსახულებების გვერდზე

a open add image window

რედაქტირების ყველა გვერდზე

t open translation selector
ctrl+ s submit form

დისკუსიების გვერდზე

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

გსურთ შეაფასოთ ან დაამატოთ ეს ელემენტი სიაში?

ავტორიზაცია