0987b00e542141369049e647701b65d9
source (required) - The identifer for the news source or blog you want headlines from. Use the /sources endpoint to locate this or use the sources index.
apiKey (required) - Your API key. Alternatively you can provide this via the X-Api-Key HTTP header.
sortBy (optional) - Specify which type of list you want. The possible options are top, latest and popular. Note: not all options are available for all sources. Default: top. top Requests a list of the source's headlines sorted in the order they appear on its homepage. latest Requests a list of the source's headlines sorted in chronological order, newest first. popular Requests a list of the source's current most popular or currently trending headlines.
category (optional): business, entertainment, gaming, general, music, politics, science-and-nature, sport, technology. Default: empty (all sources returned)
language (optional) : en, de, fr. Default: empty (all sources returned)
country (optional) : au, de, gb, in, it, us. Default: empty (all sources returned)
https://newsapi.org/v1/sources?language=en&country=us&category=technology
fetch('https://newsapi.org/v1/articles?source=the-next-web&sortBy=latest',{
method: 'get',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Api-Key': `0987b00e542141369049e647701b65d9`
}
})
.then(function(response) {
return response.json()
}).then(function(json) {
console.log('parsed json: ', json)
}).catch(function(error) {
console.log('parsing failed: ', error)
});
fetch('https://newsapi.org/v1/articles?source=the-next-web&sortBy=latest&apiKey=0987b00e542141369049e647701b65d9')
.then(function(response) {
return response.json()
}).then(function(json) {
console.log('parsed json: ', json)
}).catch(function(error) {
console.log('parsing failed: ', error)
});
https://gist.github.com/xgqfrms-GitHub/b44ba9049575654e36e3032c58576931
canary
https://www.google.com/intl/en/chrome/browser/canary.html