Reputation: 447
I need an explaination.
I use DriveAPI with a service account which has a domain-wide delegation of authority on my domain.
I send requests connected with the service account as a user like this:
credentials = SignedJwtAssertionCredentials(
dico_account['client_email'],
dico_account['private_key'],
scope=['https://www.googleapis.com/auth/drive'],
sub= "[email protected]")
I would like to know if the quota per second per user is for the service account or for the user?
Upvotes: 2
Views: 480
Reputation: 116958
The Google Drive API default allows you to send 1 million requests per second per user. Now how do they decide what a user is. Well its the IP address normally and the authenticated user.
In the case of a service account you have only one authenticated user. So by default your application will be able to send 1 million requests a second. and it should be based upon the IP address so assuming that I am sending it and you are sending it from two different IPs there should be two different sets of quota. (If that made any sense at all.)
Now this can be tweaked. Standard Query Parameters If you have a way of knowing that your service account is requesting for me vs for yourself then you can send quotaUser. So when I run your application I am able to make a million requests a second and you are also able to make a million requests a second. QuotaUser just needs to be tacked onto the end of what ever request you are making.
The google drive API has such a big quota that I have never tested with it. However I have used quotauser to get around the quota in the Google Analytics API, all the APIs should be the same so this information should still be valid for you and Google Drive.
Upvotes: 1