pat310 / google-trends-api

An API layer on top of google trends
https://www.npmjs.com/package/google-trends-api
MIT License
894 stars 178 forks source link

relatedQueries empty results #151

Open ryankaka92 opened 3 years ago

ryankaka92 commented 3 years ago
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

Dramier commented 3 years ago

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"}]}]}}