const NewsAPI = require('newsapi');
const newsapi = new NewsAPI('ea06ed5a53cf44bcb49973b3bd593fea');
newsapi.v2.topHeadlines({
sources: 'bbc-news,the-verge',
q: 'bitcoin',
category: 'business',
language: 'en',
country: 'us'
}).then(response => {
console.log(response);
});
newsapi.v2.everything({
q: 'bitcoin',
sources: 'bbc-news,the-verge',
domains: 'bbc.co.uk, techcrunch.com',
from: '2017-12-01',
to: '2017-12-12',
language: 'en',
sortBy: 'relevancy',
page: 2
}).then(response => {
console.log(response);
});
newsapi.v2.sources({
category: 'technology',
language: 'en',
country: 'us'
}).then(response => {
console.log(response);
});