AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

My Business
1.6K members online now
1.6K members online now
For developers who are using the Google My Business API to manage locations
Guide Me

Error 500: "Internal error encountered."

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Sometimes when I get list of account locations, I have this error:

"error": {
    "code": 500,
    "message": "Internal error encountered.",
    "errors": [
        "message": "Internal error encountered.",
        "domain": "global",
        "reason": "backendError"
    "status": "INTERNAL"



This account contains more then 10000 locations. Sometimes I can get all locations and all work fine, sometimes I get this error.

I use similar code for request to API:

$locationsObjects = $service->accounts_locations->listAccountsLocations($accountId);
while ($locationsObjects->nextPageToken) {
    $locationsObjects = $service->accounts_locations->listAccountsLocations(
        array('pageToken' => $locationsObjects->nextPageToken)

Can you help me please?
1. What is a reason of this error?
2. Why is this error only sometimes?

3. Can I test similar queries with pageToken in Playground ?



1 Expert replyverified_user

Re: Error 500: "Internal error encountered."

Google Employee
# 2
Google Employee

Hi @Вячеслав Б,


  1. You most likely exceeded the Usage Limits of 5 queries per second (QPS) per project when making the GET request to list all locations for your large account. Please try to limit your API usage to 5 queries per second (QPS) per project when sending requests to avoid the 500 Internal Server Error.
  2. Because this 500 Internal Server Error may have been invoked when you exceeded your API Usage Limits.
  3. Yes you can use the OAuth 2.0 Playground for testing the GET request query to list the locations for the specified account with the pageSize and pageToken query parameters.