RESOURCE_EXHAUSTED error with standard access

5,696 views
Skip to first unread message

Inessa M

unread,
Feb 23, 2022, 8:49:06 PM2/23/22
to Google Ads API and AdWords API Forum
Hi all,
I try to migrate to Google Ads API from Google AdWords API (I use googleads/google-ads-php library) and I encountered with an RESOURCE_EXHAUSTED error:

{
    "message": "Resource has been exhausted (e.g. check quota).",
    "code": 8,
    "status": "RESOURCE_EXHAUSTED",
    "details": [
        {
            "@type": 0,
            "data": "type.googleapis.com\/google.ads.googleads.v9.errors.GoogleAdsFailure"
        },
        {
            "@type": 0,
            "data": [
                {
                    "errorCode": {
                        "quotaError": "RESOURCE_EXHAUSTED"
                    },
                    "message": "Too many requests. Retry in 84106 seconds.",
                    "details": {
                        "quotaErrorDetails": {
                            "rateScope": "DEVELOPER",
                            "rateName": "Get requests for standard access",
                            "retryDelay": "84106s"
                        }
                    }
                }
            ]
        },
        {
            "@type": 0,
            "data": "rLZmNhdxJm-nrf17-oUCvw"
        }
    ]
}

But in my code I don't send any get() requests, I use only search() or searchStream() methods. Besides my developer token has standard access so I don't understand why I get this error. Here is my code sample:


        $client = $this->clientFactory->getClient($this->authIni, $account->getMccId());
        $googleAdsServiceClient = $client->getGoogleAdsServiceClient();

        $query = "SELECT campaign.id, campaign.name, campaign.status, campaign.serving_status, campaign.campaign_budget "
            . "FROM campaign "
            . "WHERE campaign.status IN('PAUSED', 'ENABLED')";

        $response = $googleAdsServiceClient->search($account->getCustomerId(), $query, ['pageSize' => 500]);

        $campaignIds = [];
        foreach ($response->iteratePages() as $page) {
            foreach ($page as $googleAdsRow) {
                // save campaigns into DB
            }
        }

Could you help me? Thanks in advance.

Google Ads API Forum Advisor

unread,
Feb 24, 2022, 8:06:20 AM2/24/22
to matuznay...@gmail.com, adwor...@googlegroups.com

Hello Inessa,

Thanks for reaching out to the Google Ads API support. The RESOURCE_EXHAUSTED error usually 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. That said, 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.
You may also experience this error if you have already exceeded the daily (1,000 requests) quota for GET requests for All developer tokens, including those with Standard Access. Please refer to this documentation for the quota values you need to consider daily when performing requests using the API.

If the issue persists, please share the complete update request and response logs with the request-id, so that our team may take a closer look. Please send via the Reply privately to the author option while sharing the details.

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team

 



ref:_00D1U1174p._5004Q2WycHM:ref
Reply all
Reply to author
Forward
0 new messages