How to get active keywords via. API?

43 views
Skip to first unread message

Simon Thomsen

unread,
Jan 9, 2017, 12:10:14 AM1/9/17
to AdWords API Forum
Hello people,
I'm trying to fetch the keywords on my Adwords account via. API.

At the moment, I'm getting the keywords without problems, except one problem.
It looks like I keep getting removed keywords in my output.

In my system I can see, that I should have 8 keywords, but the API is showing me 9 keywords.

Here is the code:

$query = 'SELECT Id, CriteriaType, KeywordText LIMIT 0,100';
$page = $campaignService->query($query);

Is there a way to say something like "WHERE Status = "ENABLED" like you can on campaigns?

(I need to check whether the keyword exists on my account, just for anyone wondering what I'm using this for)

Looking forward to hear from you :-)

Peter Oliquino

unread,
Jan 9, 2017, 12:59:02 AM1/9/17
to AdWords API Forum
Hi Simon,

You will need to use a different AdWords API service for your Keywords since the CampaignService will return campaign specific information. You may use the AdGroupCriterionService and refer to our GetKeywords example in PHP and add the Status field as a predicate to filter only the "ENABLED" keywords. Let me know if this works.

Thanks and regards,
Peter
AdWords API Team 
Reply all
Reply to author
Forward
0 new messages