- Joined
- Feb 24, 2021
- Messages
- 13
- Likes
- 27
- Degree
- 0
Would you like to have all Google Suggestions for specific terms?
I've built a script that everyone can use for free. There are multiple uses, some of them:
After that, save the following code as sug.js from a text editor.
Then run: node sug.js "your main keyword here"
The script will print all google suggestion from A to Z.
Hope it helps,
Kira
I've built a script that everyone can use for free. There are multiple uses, some of them:
- Optimize content;
- Keyword researching.
Code:
npm install request iconv-lite
After that, save the following code as sug.js from a text editor.
JavaScript:
// Google suggestion extractor
const request = require('request')
const iconv = require('iconv-lite')
ra()
async function ra(){
let kw = process.argv[2]
let alfa = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'
let r = []
let k = await getSugg(kw)
k.forEach(function(name){
r.push(name)
})
r.push('-----')
for(let each of alfa.split(',')){
let y = await getSugg(kw+'+'+each)
y.forEach(function(name){
r.push(name)
})
}
for(let each of r){
console.log(each)
}
}
async function getSugg(kw){
return new Promise(function(resolve, reject) {
var requestOptions = {encoding: null, method: "GET", uri: "https://www.google.com/complete/search?q="+kw+"&cp=3&client=psy-ab&xssi=t&gs_ri=gws-wiz&hl=en-US&authuser=0"};
let result = []
request(requestOptions, function(error, response, body) {
var utf8String = iconv.decode(Buffer.from(body), "ISO-8859-1");
let js = JSON.parse(utf8String.replace(")]}'\n", ''))
for(let each of js[0]){
result.push(each[0].replace(/<(.|\n)*?>/g, ''))
}
resolve(result)
})
})
}
Then run: node sug.js "your main keyword here"
The script will print all google suggestion from A to Z.
Hope it helps,
Kira