Skip to content

Visual Crossing API

by visualcrossing.com

API keyHTTPSCORSWeather
Open documentation ↗

Overview

Global historical and weather forecast data

Visual Crossing is a weather API from visualcrossing.com. Requests are authenticated with an API key. It is served over HTTPS and allows browser requests (CORS). Its OpenAPI description documents 5 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Yes
Category
Weather
Base URL
https://weather.visualcrossing.com
Version
4.6
Endpoints
5
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/VisualCrossingWebServices/rest/services/timeline/{location}Historical and Forecast Weather API
GET/VisualCrossingWebServices/rest/services/timeline/{location}/{startdate}Historical and Forecast Weather API
GET/VisualCrossingWebServices/rest/services/timeline/{location}/{startdate}/{enddate}Historical and Forecast Weather API
GET/VisualCrossingWebServices/rest/services/weatherdata/forecastWeather Forecast API
GET/VisualCrossingWebServices/rest/services/weatherdata/historyRetrieves hourly or daily historical weather records.

Questions

Does the Visual Crossing API need an API key?

Yes. The Visual Crossing API uses API key authentication; the documentation explains how to get credentials.

Can I call the Visual Crossing API from the browser?

Yes. The Visual Crossing API sends CORS headers, so a web page can call it directly with fetch().

Does the Visual Crossing API support HTTPS?

Yes, the Visual Crossing API is served over HTTPS.

How many endpoints does the Visual Crossing API have?

Its OpenAPI description lists 5 endpoints in version 4.6. All of them are shown on this page.

What are alternatives to the Visual Crossing API?

Other Weather APIs include NOAA CO-OPS, NASA POWER, US Weather, AccuWeather, Aemet.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).