Extract Related Keyword Using Google Sheets

Sachin Seo
1 min readMay 8, 2021

This is the best way you can extract hundreds of keywords using google sheets.

  • Open google sheets.
  • Go to tools.
  • Open script editor.
  • Add a new script using + sign.
  • Add the script

SEO_RULER_EMAIL = “”;

SEO_RULER_API_KEY = “”;

MAX_KEYWORDS = ‘5000’;

function onOpen() {

var ui = SpreadsheetApp.getUi();

ui.createMenu(‘Keyword Ideas’)

.addItem(‘Generate Ideas (columns)’, ‘seoRulerSuggestColumns’)

.addItem(‘Generate Ideas (columns, append)’, ‘seoRulerSuggestColumnsAppend’)

.addItem(‘Generate Ideas (rows)’, ‘seoRulerSuggestRows’)

.addItem(‘Generate Ideas (rows, append)’, ‘seoRulerSuggestRowsAppend’)

.addToUi();

}

function seoRulerSuggestRows() {

var sheet = SpreadsheetApp.getActiveSheet();

var seed = sheet.getActiveCell().getValue();

var response = UrlFetchApp.fetch(`https://growkeywords.com/api/suggest?query=${seed}&max=${MAX_KEYWORDS}&token=${SEO_RULER_API_KEY}&email=${SEO_RULER_EMAIL}`);

var json = response.getContentText();

var data = JSON.parse(json);

var cell = sheet.getCurrentCell();

sheet.getRange(cell.getRow()+1, cell.getColumn(), data.suggestions.length, 1).setValues(data.suggestions.map((s) => [s]));

}

function seoRulerSuggestRowsAppend() {

var sheet = SpreadsheetApp.getActiveSheet();

var seed = sheet.getActiveCell().getValue();

var response = UrlFetchApp.fetch(`https://growkeywords.com/api/suggest?query=${seed}&max=${MAX_KEYWORDS}&token=${SEO_RULER_API_KEY}&email=${SEO_RULER_EMAIL}`);

var json = response.getContentText();

var data = JSON.parse(json);

var cell = sheet.getCurrentCell();

sheet.getRange(sheet.getLastRow()+1, cell.getColumn(), data.suggestions.length, 1).setValues(data.suggestions.map((s) => [s]));

}

function seoRulerSuggestColumns() {

var sheet = SpreadsheetApp.getActiveSheet();

var seed = sheet.getActiveCell().getValue();

var response = UrlFetchApp.fetch(`https://growkeywords.com/api/suggest?query=${seed}&max=${MAX_KEYWORDS}&token=${SEO_RULER_API_KEY}&email=${SEO_RULER_EMAIL}`);

var json = response.getContentText();

var data = JSON.parse(json);

var cell = sheet.getCurrentCell();

sheet.getRange(cell.getRow(), cell.getColumn()+1, 1, data.suggestions.length).setValues([data.suggestions]);

}

function seoRulerSuggestColumnsAppend() {

var sheet = SpreadsheetApp.getActiveSheet();

var seed = sheet.getActiveCell().getValue();

var response = UrlFetchApp.fetch(`https://growkeywords.com/api/suggest?query=${seed}&max=${MAX_KEYWORDS}&token=${SEO_RULER_API_KEY}&email=${SEO_RULER_EMAIL}`);

var json = response.getContentText();

var data = JSON.parse(json);

var cell = sheet.getCurrentCell();

sheet.getRange(cell.getRow(), sheet.getLastColumn()+1, 1, data.suggestions.length).setValues([data.suggestions]);

}

  • Save the script and run it.
  • Reload the script.
  • The new tab will occur in the sheet with name-related keywords.

If the script wont works visit this link and copy the script from here

https://www.evernote.com/shard/s694/sh/1df1203b-07b5-5364-1e34-d23e3feaefb9/c83915dcb47649647c7e5d938098bc6b

--

--

Sachin Seo

A hands-on Digital Marketing professional with more than two years of progressive experience at the forefront of SEO, Ecommerce and technical SEO