Hi Sohail,
Thanks for reaching out to the Google Ads API team. I hope you are doing well today.
Kindly note that the RESOURCE_EXHAUSTED error generally occurs when you are sending too many requests in a short period of time. The server throws this error once it detects that your request has exceeded the system frequency limit. I would recommend setting up short delays between requests or combining more operations in fewer requests. Please refer to the Best practices guide to optimize the efficiency and performance.
Also, this may occur if you have already exceeded the daily limit of 15,000 API operations per day. You may refer to this documentation for the quota you need to consider daily when performing requests using the API. It says that the basic access level allows the developer token to execute up to 15,000 operational requests per day and 1,000 get operations per day only. However, we would request that you provide the complete request and response logs, with the request-id, generated for the RESOURCE_EXHAUSTED error in order to check further. You can enable logging, which you may do so by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.
You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.
Regards,
|
||||||
I am clear about the reasoning if I am doing too many requests in a short time. This is why I sent the screeshot showing that I only did 56 or so requests in over 10 hours.
Also as noted in the error response, the message suggested that retry after 4 seconds. I did try not only 4 seconds but after 10 minutes, 30 minutes and such without success and the same error message.
Is there something else I should look?
Thanks
Sohail
Hi Peter and Sohail,
Thank you for your reply.
Kindly note that the API request and API operations are different from each other. A mutate request can have 10,000 operations per request. As said by Sohail, you are using a simple keyword idea search request. This request is the planning services in the Google Ads API. Due to cost and complexity, the Planning service methods listed below are subject to separate limits from other types of requests. Limited to 1 request per second per CID or developer token:
All requests to Keyword Planning services for both standard and basic access are rate limited. Fewer requests are allowed per minute when compared to other services. Our recommendation is to cache or store results as you will receive the same response over a long time span. For example, if you request a set of existing keywords, the response is not going to change over a period of hours or days. In the case of historical metrics, the statistics refresh monthly.
Moreover, I would recommend setting up short delays between requests or combine more operations in fewer requests. The server throws this error once it detects that your request has exceeded the system frequency limit. When you retry requests, you may continue using an exponential backoff policy by delaying 5-10 seconds. For example, if you first pause 5 seconds before the first retry, you could pause 10 seconds after the second and 20 seconds after the third retry. Exponential backoff helps ensure you are not calling the API too aggressively.
In addition, we suggest setting a reasonable upper bound for the total number of concurrent tasks that are going to make requests (across all processes and machines), and adjusting upward to optimize your throughput without exceeding the rate limit is recommended. Otherwise, you may possibly experience the exceeding rate limits that the client app is spawning an excessive number of parallel tasks since we don't limit the number of parallel requests a client app can have, this can easily exceed the Requests Per Second limit at the developer token level. However, Throttles can be implemented at the consumer side by limiting the number of concurrent consumers, or implement rate limiters or throttlers for either the producers or consumers.For more information, you may refer to this throttling QPS from the client side (check out Throttling and rate limiters).
Let us know if you need further clarification.
Regards,
|
||||||
Hi everyone,
Thanks for commenting in this forum thread.
I understand the inconvenience you are encountering due to this issue. However, for me to request my rest of the team to look into this matter, could you provide us with the complete request and response logs with request ID generated for the RESOURCE_EXHAUSED error? These logs should help our team better investigate this matter.
Kindly send your complete logs via reply privately to author option.
Regards,
|
||||||
Google Ads API Team |