The Movie Database Support

Is it possible to set a maximum number of results on a list page? Current value is 20 results per page and I want to change it.

14 replies (on page 1 of 1)

Jump to last post

Hi BinaryFork,

No, it is not possible to increase the page size.

Sorry to resurrect an old topic. Is this a feature on the roadmap?

I'm trying to to inner join the results of a similar_movies query with movies already present in my DB and it would be extremely helpful to be able to pull down 100 movies all at once instead of 20 five times. It'd be easier on you guys too.

This ought to be a trivial change on your end as well, just setting the limit to a parameter page_size (like page) and having a sane maximum (like 100).

Sorry to resurrect an old topic. Is this a feature on the roadmap?

That's ok, but no it is not. We're content to keep it as is.

Cheers.

Care to share why? This would be super helpful in a lot of applications, and shouldn't be that hard to implement.

It's not a matter of how easy it is, it's to do with how practical of a feature it is vs. the performance side affects. The way we see it is you have two common use cases (looking at the majority of how users use our data):

  1. Search results. Search is almost universally showing the results you're looking for within the first 20 items. If it's not, the problem isn't the page size, it's your search query. Over 98% of users never hit page 2 on our own website and we only show 10 results! 20 is more than enough.

  2. Misc. list pages like top rated, popular, now playing. The first common use case would be if you're bringing the data in house. Limiting the pages to 20 items has little bearing on anything but a few extra requests. We cap these requests to 1000 pages so 20,000 items. Having some kind of a background job process these is trivial. The second common example would be a mobile app of a sort. There are many apps that support the "infinite" scrolling concept and this is quite simply, the smarter way to build your app anyways. It keeps the requests fast and short and we are only ever loading what the user sees, so very little wastes resources. There are many examples of apps already doing this for both iOS, Android and web.

Cheers.

How about an option to DECREASE the page size? As you mention you yourself only show 10 results per page. And in a situation where there are 15 items per page, you'd need to do 2 request to get all the results for page 2. Re-paginating paginates results, for only 2% of the users, is cumbersome.

I currently only want the first or first 5 results and have written a piece of code to discard the other results. Transferring and parsing that extra 1.5 kB is no big deal, but it doesn't feel efficient.

We have no plans to allow changing the page size.

Hi. This would be a great improvement. I don't want to get 20 related movies, 4 is enough to me. Faster and lighter request, less code for us to limit the request manually. Is it out of roadmap yet? Thank you!

Hi scerrutti,

We do not have any plans to support custom page sizes at this time.

Hi I think that should be a dynamic parameter the number of results you want and with that would solve the problem

Hi @dieggo Yes, that would solve it but it's still not something I am worrying about right now.

I recently discussed this in another post and pointed out that a fairly standard page of 20 items sent over the wire with gzip is only 5.7KB. I appreciate the desire to get small optimizations like this but 5.7KB is pretty small.

Travis,

Where can I find out how to query more results as the user scrolls the page (iOS ) to create the "infinite scrolling"?

Hi @gdeleon101,

You can use the page parameter to scroll through pages.

https://api.themoviedb.org/3/search/movie?api_key=###&query=star+wars&page=1
https://api.themoviedb.org/3/search/movie?api_key=###&query=star+wars&page=2
https://api.themoviedb.org/3/search/movie?api_key=###&query=star+wars&page=3

Etc...

Travis,

I get the string you are adding to the call, but I'm not sure how to call that in swift. Do I need to call another function? What I'm currently doing is loading a collectionView using this function:

        func fetchMovies() {
        let apiKey = "MYKEYGOESHERE"
        let url = NSURL(string: "https://api.themoviedb.org/3/movie/now_playing?api_key=\(apiKey)")
        let request = URLRequest(
            url: url! as URL,
            cachePolicy: NSURLRequest.CachePolicy.reloadIgnoringLocalCacheData,
            timeoutInterval: 10)

        let session = URLSession(
            configuration: URLSessionConfiguration.default,
            delegate: nil,
            delegateQueue: OperationQueue.main
        )

        let task: URLSessionDataTask = session.dataTask(with: request, completionHandler: { (dataorNil, response, error) in
            if let data = dataorNil {
                if let responseDictionary = try! JSONSerialization.jsonObject(with: data, options:[]) as? NSDictionary {
                    print("response: \(responseDictionary)")
                    self.movies = responseDictionary["results"] as? [NSDictionary]
                    self.collectionView.reloadData()
                }
            }
        })
        task.resume()
     }

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

Global

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

On media pages

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

On TV season pages

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

On TV episode pages

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

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

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

Want to rate or add this item to a list?

Login