RapidAPI logo

Dark Sky

FREEMIUM
By darkskyapis
Updated 4 months ago
Weather
8.7/10
Popularity Score
397ms
Latency
97%
Success Rate

Dark Sky API Documentation

The easiest, most advanced, weather API on the web.

View API Details
GETForecast
GETTime Machine
GETForecast

A Forecast Request returns the current weather conditions, a minute-by-minute forecast for the next hour (where available), an hour-by-hour forecast for the next 48 hours, and a day-by-day forecast for the next week.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
latitudeSTRING
REQUIREDThe latitude of a location (in decimal degrees). Positive is north, negative is south.
longitudeSTRING
REQUIREDThe longitude of a location (in decimal degrees). Positive is east, negative is west.
Optional Parameters
langSTRING
OPTIONALReturn summary properties in the desired language. (Note that units in the summary will be set according to the units parameter, so be sure to set both parameters appropriately.) language should be 2-letter language code. English is default
extendSTRING
OPTIONALWhen extend=hourly, return hour-by-hour data for the next 168 hours, instead of the next 48. When using this option, we strongly recommend enabling HTTP compression.
unitsSTRING
OPTIONALReturn weather conditions in the requested units. [units] should be one of the following: auto: automatically select units based on geographic location ca: same as si, except that windSpeed and windGust are in kilometers per hour uk2: same as si, except that nearestStormDistance and visibility are in miles, and windSpeed and windGust in miles per hour us: Imperial units (the default) si: SI units
excludeSTRING
OPTIONALExclude some number of data blocks from the API response. This is useful for reducing latency and saving cache space. The value blocks should be a comma-delimeted list (without spaces) of any of the following: currently, minutely, hourly, daily, alerts, flags
Code Snippet
unirest.get("https://dark-sky.p.rapidapi.com/{latitude},{longitude}?lang=en&units=auto")
.header("X-RapidAPI-Host", "dark-sky.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://dark-sky.p.rapidapi.com/{latitude},{longitude}
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://dark-sky.p.rapidapi.com/{latitude},{longitude}?lang=en&units=auto")
.header("X-RapidAPI-Host", "dark-sky.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