Search code examples
google-analytics-api

Increase Batch Quota in Google Core Reporting API


Does anyone know if there is a way to increase the quota limit of 10 queries when batching calls to the core reporting API?

This question/answer mentions the limit of 10: How can I combine/speed up multiple API calls to improve performance?

If I try to add more than 10 queries to the batch only the first ten are processed, each one after that contains a 403 quota exceeded error.

Is there a pay option? Would love to speed up the process of reporting on GA data for a bunch of URLs. I looked in my Google Developer's Console under the Analytics API where there is an option to increase the per-user limit and a link to request additional quota but I don't need total quota to increase, only allowed batch requests.

Thanks!


Solution

  • Quota is the number of requests you are allowed to make to a Google API without requesting permission to access more. Most of the Google APIs have a free quota, a number of requests Google lets you make without asking for permission to make more request. There are project based quotas and user based quotas.

    Unless it says other wise APIs Quotas are projects based not user based.
    

    User quota example

    Per-user limit 10 requests/second/user

    Some Quotas are user based, a user is normally the person that has authenticated the request. Every request sent to google contains information about who is making the request in the form of the IP address where the request came from. If you have your code running on a server the IP address is the same all the time so Google sees it as the same user. You can get around his by adding a random Quotauser to your request this will identify the request based upon different users.

    If you send to many requests to fast from the same user you will see the following error.

    userRateLimitExceeded The request failed because a per-user rate limit has been reached.

    The best way to get around this is to use QuotaUser in all of your requests, and identify different users to Google. Or just send a random number every time should also work.

    Answer: You can't apply for an extension of the flood protection user rate limit. But you can get around it by using QuotaUser.

    more info on quotas can be found on Google developers console APIs