Skip to content

Weatherbit API

by weatherbit.io

API keyHTTPSWeather
Open documentation ↗

Overview

Weather API documentation for current weather, forecasts, historical weather data, air quality, maps, lightning, agriculture, and energy APIs.

Weatherbit is a weather API from weatherbit.io. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 47 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Category
Weather
Base URL
https://api.weatherbit.io/v2.0
Version
2.0.0
Endpoints
47
Spec updated
2023-03-06

Make a first request

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

cURL
curl -X GET "https://api.weatherbit.io/v2.0/alerts?lat=LAT&lon=LON" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://api.weatherbit.io/v2.0/alerts?lat=LAT&lon=LON", {
  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://api.weatherbit.io/v2.0/alerts?lat=LAT&lon=LON",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/alerts?lat={lat}&lon={lon}Returns severe weather alerts issued by meteorological agencies - Given a lat/lon.
GET/bulk/files/{file}Download pre-generated bulk datasets
GET/current/airquality?city={city}&country={country}Returns current air quality conditions - Given City and/or State, Country.
GET/current/airquality?city_id={city_id}Returns current air quality conditions - Given a City ID.
GET/current/airquality?lat={lat}&lon={lon}Returns current air quality conditions - Given a lat/lon.
GET/current/airquality?postal_code={postal_code}Returns current air quality conditions - Given a Postal Code.
GET/current?cities={cities}Returns a group of observations given a list of cities
GET/current?city={city}&country={country}Returns a Current Observation - Given City and/or State, Country.
GET/current?city_id={city_id}Returns a current observation by city id.
GET/current?lat={lat}&lon={lon}Returns a Current Observation - Given a lat/lon.
GET/current?points={points}Returns a group of observations given a list of points in the format (lat1, lon1), (lat2, lon2), (latN, lonN), ...
GET/current?postal_code={postal_code}Returns a current observation by postal code.
GET/current?station={station}Returns a Current Observation. - Given a station ID.
GET/current?stations={stations}Returns a group of observations given a list of stations
GET/forecast/airquality?city={city}&country={country}Returns 72 hour (hourly) Air Quality forecast - Given City and/or State, Country.
GET/forecast/airquality?city_id={city_id}Returns 72 hour (hourly) Air Quality forecast - Given a City ID.
GET/forecast/airquality?lat={lat}&lon={lon}Returns 72 hour (hourly) Air Quality forecast - Given a lat/lon.
GET/forecast/airquality?postal_code={postal_code}Returns 72 hour (hourly) Air Quality forecast - Given a Postal Code.
GET/forecast/daily?city={city}&country={country}Returns a daily forecast - Given City and/or State, Country.
GET/forecast/daily?city_id={city_id}Returns a daily forecast - Given a City ID.
GET/forecast/daily?lat={lat}&lon={lon}Returns a daily forecast - Given Lat/Lon.
GET/forecast/daily?postal_code={postal_code}Returns a daily forecast - Given a Postal Code.
GET/forecast/energy?lat={lat}&lon={lon}Returns Energy Forecast API response - Given a single lat/lon.
GET/forecast/hourly?city={city}&country={country}Returns an hourly forecast - Given City and/or State, Country.
GET/forecast/hourly?city_id={city_id}Returns an hourly forecast - Given a City ID.
GET/forecast/hourly?lat={lat}&lon={lon}Returns an hourly forecast - Given a lat/lon.
GET/forecast/hourly?postal_code={postal_code}Returns an hourly forecast - Given a Postal Code.
GET/history/airquality?city={city}&country={country}Returns 72 hours of historical quality conditions - Given City and/or State, Country.
GET/history/airquality?city_id={city_id}Returns 72 hours of historical air quality conditions - Given a City ID.
GET/history/airquality?lat={lat}&lon={lon}Returns 72 hours of historical air quality conditions - Given a lat/lon.
GET/history/airquality?postal_code={postal_code}Returns 72 hours of historical air quality conditions - Given a Postal Code.
GET/history/daily?city={city}&country={country}Returns Historical Observations - Given City and/or State, Country.
GET/history/daily?city_id={city_id}Returns Historical Observations - Given a City ID
GET/history/daily?lat={lat}&lon={lon}Returns Historical Observations - Given a lat/lon.
GET/history/daily?postal_code={postal_code}Returns Historical Observations - Given a Postal Code
GET/history/daily?station={station}Returns Historical Observations - Given a station ID.
GET/history/energy?lat={lat}&lon={lon}Returns Energy API response - Given a single lat/lon.
GET/history/hourly?city={city}&country={country}Returns Historical Observations - Given City and/or State, Country.
GET/history/hourly?city_id={city_id}Returns Historical Observations - Given a City ID
GET/history/hourly?lat={lat}&lon={lon}Returns Historical Observations - Given a lat/lon.
GET/history/hourly?postal_code={postal_code}Returns Historical Observations - Given a Postal Code
GET/history/hourly?station={station}Returns Historical Observations - Given a station ID.
GET/history/subhourly?city={city}&country={country}Returns Historical Observations - Given City and/or State, Country.
GET/history/subhourly?city_id={city_id}Returns Historical Observations - Given a City ID
GET/history/subhourly?lat={lat}&lon={lon}Returns Historical Observations - Given a lat/lon.
GET/history/subhourly?postal_code={postal_code}Returns Historical Observations - Given a Postal Code
GET/history/subhourly?station={station}Returns Historical Observations - Given a station ID.

Questions

Does the Weatherbit API need an API key?

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

Does the Weatherbit API support HTTPS?

Yes, the Weatherbit API is served over HTTPS.

How many endpoints does the Weatherbit API have?

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

What are alternatives to the Weatherbit 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).