Download spend data from Google Ads API

71 views
Skip to first unread message

Hao Long

unread,
Nov 24, 2021, 12:41:46 AM11/24/21
to AdWords API and Google Ads API Forum
Hi Team,

I have two questions on download spend data from Google Ads API:
1. how to save the SearchGoogleAdsStreamResponse  as csv/jason file? tried writeto function but seems not work

ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsServiceClient.searchStreamCallable().call(request);

2. is there have volume limitation on SearchGoogleAdsStreamResponse? if there have huge volume returned from GAQL how to handle it?


Thanks

Google Ads API Forum Advisor

unread,
Nov 24, 2021, 10:59:51 AM11/24/21
to adwor...@googlegroups.com
Hi Hao,

Thank you for reaching out to Google Ads API support with your questions. The API returns results in JSON, and you can process it however you wish. 

With that being said, I was able to modify the GetKeywordStats.java sample to print out the JSON of the stream with this modification:
 
for (SearchGoogleAdsStreamResponse response : stream) {
  for (GoogleAdsRow googleAdsRow : response.getResultsList()) {

    System.out.println(googleAdsRow.getAllFields().toString());
  }
}

For further assistance you may reach out to the Java Client Library Issue Tracker.

Here are listed the limitations on SearchStream.

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Regards,
​​​​​​​

Google Logo
Aryeh Baker
Google Ads API Team
 


 


 

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