API2.NINJA - News Aggregator and Weather Data

FREE
By api2ninja
Updated 4 months ago
Data
-/10
Popularity Score
-
Latency
-
Success Rate

API2.NINJA - News Aggregator and Weather Data API Documentation

Advanced news aggregator, CNN articles, Weather by location & more. news aggr includes results from https://newsapi.org/

View API Details
CNN
POSTCNN News
Weather
POSTWeather
News Aggr
POSTNews Sources
POSTNews Articles
POSTCNN News

Get news from CNN by section. Please use on of the sections: top ,world ,us ,business ,politics ,crime ,technology ,health ,entertainment ,travel ,living ,video ,studentNews ,latest

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
sectionSTRING
REQUIREDSelect section name, options: top ,world ,us ,business ,politics ,crime ,technology ,health ,entertainment ,travel ,living ,video ,studentNews ,latest
Code Snippet
unirest.post("https://api2ninja-api2-ninja-news-aggregator-and-weather-data-v1.p.rapidapi.com/api2ninja/news/cnn")
.header("X-RapidAPI-Host", "api2ninja-api2-ninja-news-aggregator-and-weather-data-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("section=top")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://api2ninja-api2-ninja-news-aggregator-and-weather-data-v1.p.rapidapi.com/api2ninja/news/cnn
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://api2ninja-api2-ninja-news-aggregator-and-weather-data-v1.p.rapidapi.com/api2ninja/news/cnn")
.header("X-RapidAPI-Host", "api2ninja-api2-ninja-news-aggregator-and-weather-data-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("section=top")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication