bzarras / newsapi

A promise-based node interface for NewsAPI
MIT License
144 stars 39 forks source link

Example on https://newsapi.org/docs/client-libraries/node-js throws an error #17

Closed mayeaux closed 4 years ago

mayeaux commented 5 years ago

The example on the newsapi site for this library is broken. It is listed as:

newsapi.v2.topHeadlines({
  sources: 'bbc-news,the-verge',
  q: 'bitcoin',
  category: 'business',
  language: 'en',
  country: 'us'
}).then(response => {
  console.log(response);
  /*
    {
      status: "ok",
      articles: [...]
    }
  */
});

returns NewsAPIError: parametersIncompatible: You cannot mix the sources parameter with the country or category parameters.

Just a heads up, may want to have that fixed

Echomo-Xinyu commented 4 years ago

I'm also having the same problem with python