pat310 / google-trends-api

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

No 'Access-Control-Allow-Origin' header is present on the requested resource. #86

Closed Hujjat closed 6 years ago

Hujjat commented 6 years ago

Hi.

I am following the instructions in the readme file. but the examples are not working. For instance,

googleTrends.autoComplete({keyword: 'Back to School'}) .then(function(results) { console.log(results); }) .catch(function(err) { console.error(err); })

Give the following error on console page.

capture

Can anyone say what's wrong?

Thank's :)

pat310 commented 6 years ago

Hello @Hujjat. It seems to be working for me:

{"default":{"topics":[{"mid":"/m/0414j6","title":"Back to School","type":"1986 film"},{"mid":"/m/068pw8","title":"Back to school","type":"Topic"},{"mid":"/m/05357_","title":"Tax holiday","type":"Holiday"},{"mid":"/m/04vwgn","title":"Fight Back to School","type":"1991 film"},{"mid":"/m/02pb6kt","title":"Fight Back to School II","type":"1992 film"}]}}

You are running this in node right? It won't work if you try to run it from the browser because of CORS