Autocomplete has never been exempt from the queries per second limit. Your application needs to take steps to make sure it stays below 4 queries/second. This limit is per key, not ip, so if you are not making these requests with an authenticated user, all instances will share the same query per second limit.
I thought that non-authenticated calls such as autocomplete could not be made with an authenticated user. If so, 4 queries/second per application would not be sufficient for a distributed application that may have hundreds of thousands of users.
To get around this limit, can autocomplete be made as a protected request?
You can, in fact, make autocomplete calls as protected requests. In fact, once a user has authenticated, you're encouraged to make all subsequent requests by signing as a protected request, to help stretch your limits further.
Kirsten, I'm using your Python library to write an app. Does it have the capability to sign autocomplete calls as protected requests? I looked through the code and I didn't see anything that indicated that I could do that, but I wanted to make sure I wasn't missing anything.
This Python library is fantastic. Keep up the great work.
Thank you so much Kirsten! I look forward to version 2!
The Netflix API is great and all, but OAuth is rough, and the less time we have to think about that, the more time we can think about our actual application. Your library does a great job of abstracting that out.
Will calls to the Autocomplete interface deduct from our API total? Or is it unlimited?
Message edited by QuizEngine 2 years ago
Michael Hart – 3 years ago
Currently they do. We may change this in the future since this is a lightweight call for us to handle and the request is not strongly auth'd.
sprybytes – 2 years ago
Has this now changed? Will calls to the autocomplete interface deduct from the API total?
Also, is the rate limit on the autocomplete calls per application or per requesting IP address?
Kirsten Jones – 2 years ago
Autocomplete has never been exempt from the queries per second limit. Your application needs to take steps to make sure it stays below 4 queries/second. This limit is per key, not ip, so if you are not making these requests with an authenticated user, all instances will share the same query per second limit.
sprybytes – 2 years ago
I thought that non-authenticated calls such as autocomplete could not be made with an authenticated user. If so, 4 queries/second per application would not be sufficient for a distributed application that may have hundreds of thousands of users.
To get around this limit, can autocomplete be made as a protected request?
Kirsten Jones – 2 years ago
You can, in fact, make autocomplete calls as protected requests. In fact, once a user has authenticated, you're encouraged to make all subsequent requests by signing as a protected request, to help stretch your limits further.
Thanks,
Kirsten
sprybytes – 2 years ago
Thanks Kirsten. I'll make this change to my code now.
Sam Jones – 2 years ago
Kirsten, I'm using your Python library to write an app. Does it have the capability to sign autocomplete calls as protected requests? I looked through the code and I didn't see anything that indicated that I could do that, but I wanted to make sure I wasn't missing anything.
This Python library is fantastic. Keep up the great work.
Kirsten Jones – 2 years ago
Hi Sam,
I'm glad you're finding the Python library useful :-)
I'm planning to rewrite it for the upcoming version 2 of the API (and update the existing version 1 one as well).
In the meantime, you can edit the Netflix.py that you have to add a user version of autocomplete by adding the following subroutine under NetflixUser:
def autocomplete(self, term,startIndex=None,maxResults=None):
requestUrl = '/catalog/titles/autocomplete'
accessToken=self.accessToken
parameters = {'term': term}
if startIndex:
parameters['start_index'] = startIndex
if maxResults:
parameters['max_results'] = maxResults
if not isinstance(accessToken, oauth.OAuthToken):
accessToken = oauth.OAuthToken(
accessToken['key'],
accessToken['secret'] )
info = simplejson.loads( self.client._getResource(
requestUrl,
parameters=parameters,
token=accessToken))
print simplejson.dumps(info)
return info['autocomplete']['autocomplete_item']
You can call it with:
autocomplete = netflix.user.autocomplete(arg)
Sam Jones – 2 years ago
Thank you so much Kirsten! I look forward to version 2!
The Netflix API is great and all, but OAuth is rough, and the less time we have to think about that, the more time we can think about our actual application. Your library does a great job of abstracting that out.