I'm trying to access a user's feed of actual ratings using http://api.netflix.com/users/xxx/ratings/title/actual.
This feed doesn't support the max_results parameter, and seems to only return the last 20 titles rated.
How would I access the deep history of actual title ratings? I know I can pass in title refs but I'm not sure which titles to query for, since the user could have rated movies that they didn't rent.
If the title_refs are not passed in, then the most recent ratings (up to 20) are returned. Apart from this, you are right, to get any deeper than that, you would have to pass in the title refs to get the ratings for the other titles. If you are looking to get all the ratings for the user without passing the title refs explicitly, that is currently not supported. Hope this helps.
A brute-force approach seems perfectly viable: get the title_refs from the master catalog, and submit 500 at a time. If you care about tracking user ratings, this will have to be repeated every time the most recent 20 ratings don't include at least one that your app has seen before. It's a poor design, but you have the tools to cope with it.
@irons, one statement you made puzzled me for a while: "If you care about tracking user ratings, this will have to be repeated every time the most recent 20 ratings don't include at least one that your app has seen before."
I think I've figured out what you mean:
- the first time, you have to retrieve all user Ratings, 500 at a time -- let's call this the "new Ratings sync" method
- after that, if you want to incrementally update a local cache of user Ratings with just the ones that were updated since last "sync", an incremental download will only be practical if there are 19 or fewer new Ratings since last time you sync'd.
- This is because if there are 20 or more Ratings returned in a query for the "most recent ratings" (i.e. /ratings/title/actual without an explicit title_refs parameter), there's no way to know if you happened to catch up when there were only 20 new Ratings, or if there were additional new Ratings that weren't retrieved (e.g. there are 25 new Ratings, but the /ratings/title/actual request only retrieved 20, and missed the 5 oldest "new" Ratings that weren't returned to the request)
- so the recommended "incremental" algorithm is this:
--- request the "most recent ratings" (/ratings/title/actual)
--- check the Titles against the local cache of already-retrieved Ratings
----- If you find a local instance of one of the just-retrieved Titles, then you can simply append the just-retrieved results to your local cache
----- If you find no matches in the local cache among the just-retrieved Titles, then you should assume that there are more than 20 new Ratings, and your app should switch to using the "new Ratings sync" method (i.e. retrieve all Ratings, in 500-Title blocks)
I am working on just such an app myself (though I don't anticipate managing a local cache of Ratings to be appended with "new" Ratings), and so based on my own design needs, I'd add the following recommendations:
- if there are any matches in the "most recent ratings" response, check whether the Rating value is different from what the response contains
--- If the Ratings match for each overlapping Title, then discard that entry from the Response array
--- If the Ratings are different for any overlapping Title, then cache both the existing local rating and the new rating, and display them for the user to dispense as they please (e.g. "sync conflict logic").
- We could be more simple-minded, and just overwrite whatever's local with whatever came from the server, but I can imagine some users that might not anticipate that behaviour (e.g. if they believed their .NET app was the "master" of the Ratings data, rather than assuming that the Netflix site contained your "master" Ratings data).
I'm trying to access a user's feed of actual ratings using http://api.netflix.com/users/xxx/ratings/title/actual.
This feed doesn't support the max_results parameter, and seems to only return the last 20 titles rated.
How would I access the deep history of actual title ratings? I know I can pass in title refs but I'm not sure which titles to query for, since the user could have rated movies that they didn't rent.
Any help would be appreciated.
Cheers,
Mathew
Message edited by Automatt 3 years ago
Tags
priya – 3 years ago
If the title_refs are not passed in, then the most recent ratings (up to 20) are returned. Apart from this, you are right, to get any deeper than that, you would have to pass in the title refs to get the ratings for the other titles. If you are looking to get all the ratings for the user without passing the title refs explicitly, that is currently not supported. Hope this helps.
Automatt – 3 years ago
That's what I was afraid of... too bad, it was hoping it would work just like the interface for pulling reviews. Thanks for your help.
irons – 3 years ago
A brute-force approach seems perfectly viable: get the title_refs from the master catalog, and submit 500 at a time. If you care about tracking user ratings, this will have to be repeated every time the most recent 20 ratings don't include at least one that your app has seen before. It's a poor design, but you have the tools to cope with it.
ParanoidMike – 3 years ago
@irons, one statement you made puzzled me for a while: "If you care about tracking user ratings, this will have to be repeated every time the most recent 20 ratings don't include at least one that your app has seen before."
I think I've figured out what you mean:
- the first time, you have to retrieve all user Ratings, 500 at a time -- let's call this the "new Ratings sync" method
- after that, if you want to incrementally update a local cache of user Ratings with just the ones that were updated since last "sync", an incremental download will only be practical if there are 19 or fewer new Ratings since last time you sync'd.
- This is because if there are 20 or more Ratings returned in a query for the "most recent ratings" (i.e. /ratings/title/actual without an explicit title_refs parameter), there's no way to know if you happened to catch up when there were only 20 new Ratings, or if there were additional new Ratings that weren't retrieved (e.g. there are 25 new Ratings, but the /ratings/title/actual request only retrieved 20, and missed the 5 oldest "new" Ratings that weren't returned to the request)
- so the recommended "incremental" algorithm is this:
--- request the "most recent ratings" (/ratings/title/actual)
--- check the Titles against the local cache of already-retrieved Ratings
----- If you find a local instance of one of the just-retrieved Titles, then you can simply append the just-retrieved results to your local cache
----- If you find no matches in the local cache among the just-retrieved Titles, then you should assume that there are more than 20 new Ratings, and your app should switch to using the "new Ratings sync" method (i.e. retrieve all Ratings, in 500-Title blocks)
I am working on just such an app myself (though I don't anticipate managing a local cache of Ratings to be appended with "new" Ratings), and so based on my own design needs, I'd add the following recommendations:
- if there are any matches in the "most recent ratings" response, check whether the Rating value is different from what the response contains
--- If the Ratings match for each overlapping Title, then discard that entry from the Response array
--- If the Ratings are different for any overlapping Title, then cache both the existing local rating and the new rating, and display them for the user to dispense as they please (e.g. "sync conflict logic").
- We could be more simple-minded, and just overwrite whatever's local with whatever came from the server, but I can imagine some users that might not anticipate that behaviour (e.g. if they believed their .NET app was the "master" of the Ratings data, rather than assuming that the Netflix site contained your "master" Ratings data).
Cheers, Mike