google-trends-api icon indicating copy to clipboard operation
google-trends-api copied to clipboard

relatedQueries empty results

Open ryankaka92 opened this issue 4 years ago • 1 comments

const googleTrends = require('google-trends-api');

googleTrends.relatedQueries({
   keyword: 'tips', 
   startTime: new Date('2021-01-20'),
   endTime: new Date('2021-01-22'),
   geo:'US'
})
.then((res) => {
  console.log(res);
})
.catch((err) => {
  console.log(err);
})

returns:

{"default":{"rankedList":[{"rankedKeyword":[]},{"rankedKeyword":[]}]}}

Am i Doing something wrong? any missing parameter

ryankaka92 avatar Jan 23 '21 14:01 ryankaka92

Something else going on, code is correct.

Copied and pasted your exact code in and got the following:

{"default":{"rankedList":[{"rankedKeyword":[{"query":"word tips","value":100,"formattedValue":"100","hasData":true,"link":"/trends/explore?q=word+tips&date=2021-01-20+2021-01-22&geo=US"},{"query":"linus tech tips","value":89,"formattedValue":"89","hasData":true,"link":"/trends/explore?q=linus+tech+tips&date=2021-01-20+2021-01-22&geo=US"}]},{"rankedKeyword":[{"query":"word tips","value":70,"formattedValue":"+70%","link":"/trends/explore?q=word+tips&date=2021-01-20+2021-01-22&geo=US"}]}]}}

Dramier avatar Feb 10 '21 19:02 Dramier