Validate Query via API

242 views
Skip to first unread message

Nicholas Lee

unread,
Mar 27, 2023, 5:06:36 PM3/27/23
to Google Ads API and AdWords API Forum
Is there a way to validate a google ads query before sending it to the search api without having to check it manually via the validator?

Google Ads API Forum Advisor

unread,
Mar 27, 2023, 5:49:51 PM3/27/23
to nichol...@pmg.com, adwor...@googlegroups.com

Hi Nicholas, 

Thanks for reaching out to the Google Ads API Team. I hope you are doing well today.

Moving forward to our concern, you really need to put your query in the query validator to validate it. If you don’t use the query validator beforehand and your query happens to be invalid, then, you will surely get an error. That is why we really recommend using the “Google Ads Query Validator” to test if the entered query is valid.

Have a great day.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kCBNj:ref

Zweitze

unread,
Mar 28, 2023, 9:03:49 AM3/28/23
to Google Ads API and AdWords API Forum
Of course, you actually do send the query to the API - but the query won't be executed, just tested for errors.

Beware of the following (or: my disclaimers)
1. I don't know whether this still counts as an operation - important if you have Basic access.
2. I don't know whether this catches all possible errors.

Google Ads API Forum Advisor

unread,
Mar 28, 2023, 12:38:02 PM3/28/23
to zwe...@gmail.com, adwor...@googlegroups.com

Hi All,

You may refer to this SearchGoogleAdsRequest documentation, when setting validate_only to “true” the request will be validated but not executed. You may also refer to GoogleAdsService documentation for the list of thrown errors for each corresponding method.

Please note that when executing a query when you have test access, this operation can only be done on test accounts.

Regards,

Reply all
Reply to author
Forward
0 new messages