Retrieve monthly search volume for a keyword using the Google Adwords API and Ruby
I recently needed to pull down monthly search totals for a number of keywords, after a quick search, that came up empty, I decided to whip one out and post the code (simplified of course), which uses the Google Ads API, Ruby and the Ruby Google Ads API client library (http://code.google.com/p/google-api-ads-ruby/). In order to run this example, you must first initialize your sandbox accounts, described in my previous posting, as well as have ruby and the Ads API libraries installed.
2 Comments:
It's great to see some blog posts about the AdWords API. As a reminder, if you want to get the stats on a lot of keywords it's more efficient (and costs less API units) to batch together multiple keywords into a single request:
http://code.google.com/apis/adwords/docs/bestpractices.html#batch_stats
And just in case you didn't know, the stats returned back by the sandbox environment are dummy values:
http://code.google.com/apis/adwords/docs/sandbox.html#behavior
Thanks for the RT Eric! I did some quick googling' looking for something similar, since my familiarity with the API was non-existent, but came up with nothing, so I whipped this up; glad to share!
Post a Comment
<< Home