curl commands to pull AD_PERFORMANCE_REPORT using google adwords api

640 views
Skip to first unread message

Rohith Madamshetty

unread,
Apr 13, 2020, 1:54:44 PM4/13/20
to AdWords API and Google Ads API Forum
I need curl commands to pull AD_PERFORMANCE_REPORT using google adwords api, I have all the credential that are required. Kindly help me with curl command. Also provide me if you have any source where we have all curl commands. The things that I found on documentation is just to get the access token.


But i want curl command to pull complete report using curl command. Kindly help me with this.


Thanks and Regards
Rohith

Google Ads API Forum Advisor Prod

unread,
Apr 13, 2020, 11:25:11 PM4/13/20
to rmadam...@demonware.net, adwor...@googlegroups.com

Hi Rohith,

 

Thank you for reaching out to AdWords API and Google Ads API Forum.

 

For cURL requests in AdWords API, you should read and refer to the documentation here: https://developers.google.com/adwords/api/docs/guides/call-structure#request

 

In the guide, point 3 describes adding a budget in hello_world.xml:

Create a SOAP request. The following sample XML snippet defines a SOAP request that adds a budget. Save this XML (with your authentication token and account login replacing the placeholders) as hello_world.xml.

 

You should replace this XML file with your use-case of pulling reports. Please read up on the Reporting guides available here: https://developers.google.com/adwords/api/docs/guides/reporting

 

Hope that this helps



ref:_00D1U1174p._5001UZXqZT:ref

Rohith Madamshetty

unread,
Apr 17, 2020, 4:52:57 PM4/17/20
to AdWords API and Google Ads API Forum
Hi there,

thanks for the reply. I am expecting something like below: 

curl commands: -

curl -G \
-d 'status=["ACTIVE","PAUSED"]' \
-d 'fields=CampaignName, CampaignID' \
-d 'access_token= <token>

Question 1: - can you provide curl commands like above where i get the report directly? Also can you tell me whether I am hitting the right endpoint or not?

Question2:- If I want to pull last 7 days of report only for the campaigns with ACTIVE status, do I get records of those campaigns which are active for the first three days and inactive for the next four days?

Thanks and Regards
Rohith

Google Ads API Forum Advisor Prod

unread,
Apr 19, 2020, 10:00:21 PM4/19/20
to rmadam...@demonware.net, adwor...@googlegroups.com
Hi Rohith,

> Question 1: - can you provide curl commands like above where i get the report directly? Also can you tell me whether I am hitting the right endpoint or not?

You will need to create a report definition in an XML file and use this with the cURL command. As mentioned in the previous email, you should refer to https://developers.google.com/adwords/api/docs/guides/reporting to see how to create this report definition.
 
The same guide also describes the endpoint at https://adwords.google.com/api/adwords/reportdownload/v201809
curl --header "Content-Type: application/soap+xml" \
     --header "Authorization : Bearer access-token" \
     --data @<report_definition>.xml \
       https://adwords.google.com/api/adwords/reportdownload/v201809

> Question2:- If I want to pull last 7 days of report only for the campaigns with ACTIVE status, do I get records of those campaigns which are active for the first three days and inactive for the next four days?

If you query for DateRangeType LAST_7_DAYS and CampaignStatus ENABLED, you will get results where campaigns are currently serving adshttps://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.CampaignStatus

Hope that this helps your issue, thank you.


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