How are API calls counted?

33 views
Skip to first unread message

Costantin

unread,
May 13, 2019, 4:46:24 AM5/13/19
to AdWords API and Google Ads API Forum
If I want to create 100 ad groups, something like this:

# Create ad group.
all_adgroups = []
for x in range(200):

ad_group_operation = client.get_type('AdGroupOperation', version=google_ads_version)
ad_group = ad_group_operation.create
ad_group.name.value = 'Earth to Mars cruises %s' % uuid.uuid4()
ad_group.status = client.get_type('AdGroupStatusEnum', version=google_ads_version).ENABLED
ad_group.campaign.value = campaign_service.campaign_path(customer_id, campaign_id)
ad_group.type = client.get_type('AdGroupTypeEnum', version=google_ads_version).SEARCH_STANDARD
ad_group.cpc_bid_micros.value = 10000000
all_adgroups.append(ad_group_operation)

# Add the ad groups.
try:
    ad_group_response = ad_group_service.mutate_ad_groups(customer_id, all_adgroups[:2])
except google.ads.google_ads.errors.GoogleAdsException as ex:
    abort(400, "ERROR")

Does this count as 1 API call or 200 ones?

googleadsapi...@google.com

unread,
May 13, 2019, 3:58:08 PM5/13/19
to AdWords API and Google Ads API Forum
Hello,

It should be counted as 1 API call and 200 operations. You could refer here to know more about counting the API operations.

Regards,
Sai Teja, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages