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

realtimeTrends sends "Error 400 (Bad Request)!!1" when queried with certain country code

Open thoriqadillah opened this issue 4 years ago • 1 comments

I have a problem that give me "Error 400 (Bad Request)!!1" when I use my country code in geo option, Indonesia (ID). Other message from the error is

</span></a><p><b>400.</b> <ins>That’s an
        error.</ins><p>The server cannot process the request because it is
        malformed. It should not be retried. <ins>That’s all we know.</ins></div>

my code :

googleTrends.realTimeTrends({
        geo: 'ID',
        category: 'all',
    }, function(err, results) {
        if (err) {
            res.send(err);
        } else {
            res.send(results);
        } 
    });

anyone has the same issue?

thoriqadillah avatar Nov 17 '21 02:11 thoriqadillah

Not all country codes have daily trends available to them. For example check the web page: https://trends.google.com/trends/trendingsearches/daily?geo=id.

I was having same issue with my app where you click a country on the map and it shows daily trends, clicking a lot of countries in Africa returned the same error. I tested Indonesia and had the same error.

blackIImesa avatar Dec 23 '21 20:12 blackIImesa