Using API in AdWords

Posted on March 13, 2015 in is a great tool for extracting structured data from HTML. In this post, we’ll explore the possibilities of taking this data and auto updating our Ads in AdWords. Look at the following add for a Monster Moto mini bike showing the name, an image, product reviews, description, product color types, etc.


Now you could create and maintain a spreadsheet manually to keep all your product information up to date. Or maybe you directly interact with the store’s database via API like our AdWords script with WooCommerce API example. But if you want to try and solve this problem without involving updates from your development team, is an excellent solution.

Simple Example


function main() {

function importIO() {
  var GUID = 'YOUR GUID';
  var url = "" + CONNECTOR + "/_query?_user=" + GUID + "&_apikey=" + API_KEY + "&input/webpage/";
  var response = UrlFetchApp.fetch(url);
  response = response.getContentText();
  var data = JSON.parse(response);
  for(var i=0; i < data.results.length; i++) {

The above example for AdWords scripts just uses one of the example URLs in the API. You can see where I print the entire response, then loop through the results and log the data. Here’s a snippet of the output:

    "offset": 0,
    "results": [{
        "photo/_title": "Iron Man",
        "origin": "Earth",
        "more_info/_title": "Wikipedia",
        "photo": "",
        "more_info": "",
        "alter_egos": "Anthony Edward \"Tony\" Stark",
        "more_info/_text": "Iron Man on Wikipedia",
        "photo/_source": "img/iron-man.png",
        "skills": "Intellect Cyperpathic Link Strenght and durability Energy repulsors Missiles",
        "species": "Human",
        "photo/_alt": "Iron Man using repulsors",
        "name": "Iron Man"
    }, {
        "photo/_title": "Captain America",
        "origin": "Earth",
        "more_info/_title": "Wikipedia",
        "photo": "",
        "more_info": "",
        "alter_egos": "Steven \"Steve\" Rogers",
        "more_info/_text": "Captain America on Wikipedia",
        "photo/_source": "img/captain-america.png",
        "skills": "Intellect Sheild-fighting Hyperkinetic senses Field commanding",
        "species": "Human",
        "photo/_alt": "Captain America looking forlorn",
        "name": "Captain America"

While this isn’t specific product data, you can follow the same procedure of your pages to extract the data from within your AdWords script. I hope this helps even a little bit pulling data into your account for more effective ads, but if you have any specific questions, feel free to ask in the comments below.

By Nathan Byloff

Nathan is the CTO for RankHammer. His area of expertise is technical SEO and everything to do with data - collection, analysis, etc. He is driven by automating any reporting task that has to be done more than once.