pat310 / google-trends-api

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

TypeError: Cannot read property 'apiMethod' of undefined #133

Open BilawalGul opened 4 years ago

BilawalGul commented 4 years ago
var {googleTrends} = require('google-trends-api');

var options = {
    geo: 'country code or name',
    date: 'yyyymm',
    keywords: ['some', 'list', 'of', 'keywords'],
    category: 'some category',
    // timePeriod: {
    //     type: enumerated string 'hour', 'day', 'month', or 'year'
    //     value: number
    // }
}

googleTrends.apiMethod(options)
.then(function(results){
    console.log("Here are your google trend results!", results);
})
.catch(function(err){
    console.log("there was an error :(", err);
});