RapidAPI logo

Weather

FREEMIUM
By weatherbit
Updated 3 months ago
Data
8.9/10
Popularity Score
139ms
Latency
100%
Success Rate

Weather API Documentation

Current weather data API, and Weather forecast API - Basic access to the Weatherbit.io Weather API.

View API Details
GETCurrent Weather Data of a location.
GET5 day Forecast
GETSevere Weather Alerts
GET48 Hour Forecast
GET16 Day Forecast
GETCurrent Weather Data of a location.

Returns the current (most recent) weather observation of a given location

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
lonNUMBER
REQUIREDLongitude
latNUMBER
REQUIREDLatitude
Optional Parameters
unitsSTRING
OPTIONALI = Imperial, S = Scientific, M = Metric (Default)
langENUM
OPTIONALLanguage
Code Snippet
unirest.get("https://weatherbit-v1-mashape.p.rapidapi.com/current?lon=<required>&lat=<required>")
.header("X-RapidAPI-Host", "weatherbit-v1-mashape.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://weatherbit-v1-mashape.p.rapidapi.com/current
Request Method: GET
Response Headers
Response Body
Log inSign up

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.get("https://weatherbit-v1-mashape.p.rapidapi.com/current?lon=<required>&lat=<required>")
.header("X-RapidAPI-Host", "weatherbit-v1-mashape.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication