The Movie Database Support

Hi,

Having my first play with the API and have found a problem that I can't see mentioned in the documentation anywhere.

I am trying to use the API to retrieve the latest movie a user rated, but the problem is that the rated movies aren't coming back in the same order each time. I was hoping they would come back in the order they were rated, but it doesn't seem to be, and nor does there appear to be any logic in how they are ordered as when you refresh it, it can be different.

For example with the request http://api.themoviedb.org/3/account/LevysFace/rated_movies?api_key=XXXX&session_id=YYY&sort_by=created_at

On first attempt I got the following:

{"page":1,"results":[{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":457,"rating":9.5},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1987,"rating":10.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":782,"rating":5.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1644,"rating":6.5},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0}],"total_pages":1,"total_results":9}

It then returned the same thing for half a dozen refreshed, but then on the next refresh, it returned the following, which is in a totally different order:

{"page":1,"results":[{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1644,"rating":6.5},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":457,"rating":9.5},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1987,"rating":10.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":782,"rating":5.5}],"total_pages":1,"total_results":9}

Is there any way to get a more consistent result from this?

Cheers

Pete

4 replies (on page 1 of 1)

Jump to last post

Are you setting a sort_order param? It doesn't look like it, try this:

http://api.themoviedb.org/3/account/LevysFace/rated_movies?api_key=###&session_id=###&sort_by=created_at&sort_order=desc

I'm seeing consistent results with this.

Thanks for the reply. I wasn't using that parameter, but I am now. Unfortunately it doesn't seem to have helped though, I'm still getting inconsistent results.

For example, for my first 28 refreshes I got the following (which I think is the correct order):

{"page":1,"results":[{"adult":false,"backdrop_path":"/5bKy4O0WQTa3MG2wPWViUNUTIEG.jpg","id":82992,"original_title":"Fast & Furious 6","release_date":"2013-05-24","poster_path":"/3Izae8UATwSHizQiEVZEWf53wjM.jpg","popularity":26.8458140459715,"title":"Fast & Furious 6","vote_average":6.4,"vote_count":930,"rating":6.5},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1648,"rating":6.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":785,"rating":5.5},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1989,"rating":10.0},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":458,"rating":9.5}],"total_pages":1,"total_results":10}

Then on the 29th refresh I got this, which is not the order the films were rated in:

{"page":1,"results":[{"adult":false,"backdrop_path":"/5bKy4O0WQTa3MG2wPWViUNUTIEG.jpg","id":82992,"original_title":"Fast & Furious 6","release_date":"2013-05-24","poster_path":"/3Izae8UATwSHizQiEVZEWf53wjM.jpg","popularity":26.8458140459715,"title":"Fast & Furious 6","vote_average":6.4,"vote_count":930,"rating":6.5},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":785,"rating":5.5},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1989,"rating":10.0},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":458,"rating":9.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1648,"rating":6.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5}],"total_pages":1,"total_results":10}

Cheers

Pete

Hey Pete,

Not sure then. I've created a new ticket for this here but I'm in the middle of some fairly large features and won't likely find time for this in the next few weeks.

Thanks for spotting the issue.

No worries, thanks for looking into it Travis.

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