Very new to using API's and Python in general but I was able to generate an AD Performance report using the following:
report_query = (adwords.ReportQueryBuilder()
.Select('CampaignName', 'AdGroupName', 'HeadlinePart1', 'HeadlinePart2', 'Description', 'Clicks','Cost','AverageCpc','Labels')
.From('AD_PERFORMANCE_REPORT')
.Where('CampaignStatus').EqualTo('ENABLED')
.Where('Clicks').GreaterThan('0')
.During('YESTERDAY')
.Build())
report_downloader.DownloadReportWithAwql(
report_query, 'CSV', sys.stdout, skip_report_header=False,
skip_column_header=False, skip_report_summary=False,
include_zero_impressions=True)
However, the call prints the output within the cmd prompt and closes. This is probably a very basic question but how would i update the report download section to produce a CSV file? Would i need to pass the information to a Pandas DataFrame and write to excel?
Thanks in advance.