Visual Crossing Weather

FREEMIUM
By awigmore
Updated 23 days ago
Weather
5.9/10
Popularity Score
1513ms
Latency
100%
Success Rate

Visual Crossing Weather API Documentation

Visual Crossing Weather API provides instant access to both historical weather records and weather forecast data

View API Details
GETHistorical weather record
GETWeather forecast data
GETHistorical weather record

The weather history data is suitable for retrieving hourly or daily historical weather records.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
startDateTimeSTRING
REQUIREDhe date time for the start of the data request using the time zone of the location. In the ISO format: yyyy-MM-ddTHH:mm:ss. Hours should be specified in 24 hour clock format.
aggregateHoursNUMBER
REQUIREDThe interval between weather history data in the output. 1 represent hourly records, 24 represents a daily forecast. As the source data is recorded at the hourly level, 24 hour records are aggregated to indicate the predominant weather conditions during that time period. Supported values 1 or 24.
locationSTRING
REQUIREDThe address or latitude or longitude of the location. Addresses can be specified as full addresses. The system will also attempt to match partial addresses such as city, state, zip code, postal code and other common formats. When specify a point based on longitude, latitude, the format must be specifed as latitude,longitude where both latitude and longitude are in decimal degrees. latitude should run from -90 to 90 and longitude from -180 to 180 (with 0 being at the prime meridian through London, UK).
endDateTimeSTRING
REQUIREDThe date time for the start of the data request using the time zone of the location. In the ISO format: yyyy-MM-ddTHH:mm:ss. Hours should be specified in 24 hour clock format.
unitGroupSTRING
REQUIREDThe system of units used for the output data. Supported values are us,uk,metric
Optional Parameters
dayStartTimeSTRING
OPTIONAL When present and not set to the same as the dayEndTime, filters the output to records that between the specified day times. This is useful for setting filters for business hours. Format h:m:ss (eg 9:00:00 woudl be 9am).
dayEndTimeSTRING
OPTIONALWhen present and not set to the same as the dayEndTime, filters the output to records that between the specified day times.
shortColumnNamesBOOLEAN
OPTIONALWhen false, the returned dataset includes descriptive column names. When true, returns shorter, abbreviated column names with only alphanumeric characters. The short names are useful for programmatic use of the data.
Code Snippet
unirest.get("https://visual-crossing-weather.p.rapidapi.com/history?dayStartTime=8%3A00%3A00&dayEndTime=17%3A00%3A00&startDateTime=2019-01-01T00%3A00%3A00&aggregateHours=24&location=Washington%2CDC%2CUSA&endDateTime=2019-01-03T00%3A00%3A00&unitGroup=us")
.header("X-RapidAPI-Host", "visual-crossing-weather.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://visual-crossing-weather.p.rapidapi.com/history
Request Method: GET
Response Headers
"access-control-allow-headers": "X-Requested-With, Content-Type, X-Codingpedia"
"access-control-allow-methods": "GET, POST, DELETE, PUT"
"access-control-allow-origin": "*"
"cache-control": "no-cache,no-transform"
"content-type": "text/plain; charset=UTF-8"
"date": "Wed, 26 Jun 2019 20:11:04 GMT"
"server": "RapidAPI-1.0.16"
"x-powered-by": "Visual Crossing Map Services"
"x-rapidapi-region": "AWS - us-east-1"
"x-rapidapi-version": "1.0.16"
"content-length": "498"
"connection": "Close"
Address,Date time,Latitude,Longitude,Minimum Temperature,Maximum Temperature,Temperature,Wind Speed,Wind Gust,Wind Direction,Precipitation,Precipitation Cover,Snow Depth,Visibility,Sea Level Pressure,Weather Type
Washington,DC,USA,01/01/2019,38.89037,-77.03196,52.8,62.7,58.2,14.6,25.3,297.4,,,,10,1015.2,
Washington,DC,USA,01/02/2019,38.89037,-77.03196,43.7,46.7,45.7,7,10.3,165.2,,,,10,1025.4,
Washington,DC,USA,01/03/2019,38.89037,-77.03196,46,49.6,48.3,12.3,15,312.78,,,,10,1016.2,

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://visual-crossing-weather.p.rapidapi.com/history?dayStartTime=8%3A00%3A00&dayEndTime=17%3A00%3A00&startDateTime=2019-01-01T00%3A00%3A00&aggregateHours=24&location=Washington%2CDC%2CUSA&endDateTime=2019-01-03T00%3A00%3A00&unitGroup=us")
.header("X-RapidAPI-Host", "visual-crossing-weather.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