High API call time for campaign_search_term_insight report

41 views
Skip to first unread message

Shiva Deepthi Badam

unread,
Mar 6, 2025, 4:57:02 AM3/6/25
to Google Ads API and AdWords API Forum
Hi team,

We are using campaign_search_term_insight report to pull Performance Max campaign search term insights. We observed that the API call time has doubled from January 2025. Here are some details on what and how we are. making API calls:
  • Number of performance max campaigns: ~50

  • Number of search categories pulled per campaign: 3000

  • Number of API calls: ~50*3000 = 1,50,000

  • Number of parallel threads - 10

  • Average API call time taken to pull Search term insights per each search category: ~3.5 seconds

  • Total time: 1,50,000 * 3.5 = 5,25,000 seconds / 60*60 = ~145.8333 hours / 10 = ~14.5 hours

Hence, our tool takes ~15 hours every day to pull the data we intended to. I would like to understand why the API call is taking so long and whether there is a way to optimize the API call times. Here are the API calls that we make:

Query to pull performance max campaigns for a given date range:
"SELECT \n" +
                "  campaign.id, \n" +
                "  campaign.name, \n" +
                "  campaign.advertising_channel_type, \n" +
                "  segments.date \n" +
                "FROM campaign \n" +
                "WHERE \n" +
                "  metrics.impressions > 0 \n" +
                "  AND campaign.advertising_channel_type = 'PERFORMANCE_MAX' \n" +
                "  AND segments.date BETWEEN '" + dateRange.getStartDate().toString() + "' AND '" + dateRange.getEndDate().minusDays(1) + "' ";
Query to pull search categories for each performance max campaigns:
"SELECT \n" +
                "  metrics.clicks, \n" +
                "  metrics.impressions, \n" +
                "  campaign_search_term_insight.id \n" +
                "FROM campaign_search_term_insight \n" +
                "WHERE \n" +
                "  campaign_search_term_insight.campaign_id = " + campaignId + " \n" +
                "  AND segments.date  = '" + date.toString() + "' \n" +
                "  AND metrics.impressions > 0 \n" +
                "ORDER BY \n" +
                "  metrics.impressions DESC, \n" +
                "  metrics.clicks DESC \n" +
                "LIMIT = 3000 ";
Query to pull search term insights for each search category:
"SELECT \n" +
                "  campaign_search_term_insight.category_label, \n" +
                "  metrics.clicks, \n" +
                "  metrics.ctr, \n" +
                "  metrics.impressions, \n" +
                "  segments.search_term, \n" +
                "  segments.search_subcategory, \n" +
                "  segments.date \n" +
                "FROM campaign_search_term_insight \n" +
                "WHERE \n" +
                "  segments.date BETWEEN '" + dateRange.getStartDate().toString() + "' AND '" + dateRange.getEndDate().minusDays(1) + "' \n" +
                "  AND campaign_search_term_insight.id  = " + searchCategoryId + " \n" +
                "  AND campaign_search_term_insight.campaign_id = " + campaignId + " ";
We are looking to understand why API calls are taking longer time and how to reduce the API call time.

Thanks
Siva Deepthi Badam

Google Ads API Forum Advisor

unread,
Mar 6, 2025, 8:28:00 AM3/6/25
to adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Support.

I understand your concern is related to high API call time. To speed up the data retrieval process, I would suggest you refer to Paging Through Results documentation. To assist you further, could you please provide us with complete API logs (request and response logs with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

Reply privately to the author option, or direct private reply to this email.

 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-03-06 13:27:10Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vH6ha:ref" (ADR-00291958)



Reply all
Reply to author
Forward
0 new messages