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

relatedQueries category key does nothing

Open cbaucom opened this issue 3 years ago • 0 comments

According to the README, the relatedQueries api takes an optional category param. However, upon testing this out with different category numbers, the data never changes.

Sample code:

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

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

When changing the number 0 above, which references "All Categories", to another acceptable category ID like 16 (News) or 67 (Travel), the data never changes. Full category wiki here.

Am I missing something here on how to properly query by category as well?

cbaucom avatar Aug 15 '22 19:08 cbaucom