How can I see all Quotas and Limits

67 views
Skip to first unread message

Stiven Ariza

unread,
Jan 12, 2019, 3:47:25 PM1/12/19
to AdWords API and Google Ads API Forum
I am loging with a Google Account and get MCC Account and SubAccounts, firts I get Customers Id and then I need to call another service to get Accounts name but I catch the next error:

RESOURCE_EXHAUSTED: Quota exceeded for quota metric 'googleads.googleapis.com/get_requests' and limit 'GetsPerMinutePerProject' of service 'googleads.googleapis.com' for consumer 'project_number:974234XXXXXXX'.

Where can I see All Quotas and Limits of Google Ads API?

is there way to obtain customer id and name in a one call to API?

I share my code:


public static List<String> GetAllCustomersId(GoogleAdsClient googleAdsClient) {
List<String> customerLst = new ArrayList<String>();
try (CustomerServiceClient customerServiceClient = googleAdsClient.getCustomerServiceClient()) {
ListAccessibleCustomersRequest request = ListAccessibleCustomersRequest.newBuilder().build();
ListAccessibleCustomersResponse response = customerServiceClient.listAccessibleCustomers(request);
for (String custResource : customerServiceClient.listAccessibleCustomers(request).getResourceNamesList()) {
custResource = custResource.substring(custResource.lastIndexOf("/") + 1, custResource.length());
/* Get tree customers*/
String query = "SELECT customer.id, customer.descriptive_name, customer_client.resource_name, "
+ "customer_client.client_customer, customer_client.level, "
+ "customer_client.hidden FROM customer_client";

try (GoogleAdsServiceClient client = googleAdsClient.getGoogleAdsServiceClient()) {
SearchPagedResponse response1 = client.search(String.valueOf(custResource), query);

for (GoogleAdsRow row : response1.iterateAll()) {
String clientCus = row.getCustomerClient().getClientCustomer().getValue();
clientCus = clientCus.substring(clientCus.lastIndexOf("/") + 1, clientCus.length());
System.out.println("Data: " + clientCus);
String accountNameStr = GetAccountName(googleAdsClient, Long.parseLong(clientCus));
System.out.println("subaccount: " + accountNameStr);
}
}

/**/
}
}
return customerLst;
}

public static String GetAccountName(GoogleAdsClient googleAdsClient, long customerId) {
String accountNameStr = "";
try (CustomerServiceClient customerServiceClient = googleAdsClient.getCustomerServiceClient()) {
String customerResourceName = ResourceNames.customer(customerId);
Customer customer = customerServiceClient.getCustomer(customerResourceName);
// Print account information.
System.out.printf(
"Customer with ID %d, descriptive name '%s', currency code '%s', timezone '%s', "
+ "tracking URL template '%s' and auto tagging enabled '%s' was retrieved.%n",
customer.getId().getValue(), customer.getDescriptiveName().getValue(),
customer.getCurrencyCode().getValue(), customer.getTimeZone().getValue(),
customer.getTrackingUrlTemplate().getValue(), customer.getAutoTaggingEnabled().getValue());
accountNameStr = customer.getDescriptiveName().getValue();
}
return accountNameStr;
}


Regards,

Luis Xander Talag (AdWords API Team)

unread,
Jan 14, 2019, 1:03:50 AM1/14/19
to AdWords API and Google Ads API Forum
Hi Stiven,

The RESOURCE_EXHAUSTED error that you encountered means that a system frequency limit has been exceeded due to too many requests in a short period of time. This being said, I would suggest you to set up short delays between requests or combine more operations in fewer requests. Currently, the Google Ads API doesn't have a documentation for limits since it is still in beta. However, you could find in this guide the common errors available in the API which you might encounter. Also, this guide for more information on troubleshooting.

With regards to retrieving the account id and the account name in one API I call, I'm afraid it is not currently possible as the service for retrieving the list of customers under one's account and retrieving of customer information are two separate services.

Thanks and regards,
Luis
Google Ads API Team
Reply all
Reply to author
Forward
0 new messages