Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Spire Weather API provides programmatic access to global weather data products. This guide covers authentication, the Base URL, and core concepts.

Base URL

All API endpoints are relative to:

https://api.wx.spire.com

Authentication

An API Key is required for all requests. Include your key in the spire-api-key header:

Shell
Python
Node.js
curl -X GET 'https://api.wx.spire.com/forecast/point?lat=40.0&lon=-105.0' \
  -H 'spire-api-key: YOUR_API_KEY'

Response Format

All API responses are returned as JSON (except file downloads). A typical response includes:

{
  "meta": {
    "unit_system": "si",
    "forecast": "Spire Operational Forecast"
  },
  "data": [...]
}

Available Endpoints

The API is organized into the following categories:

CategoryDescriptionBase Path
Current WeatherReal-time weather observations/current/weather/
ForecastsPoint, file, and route forecasts/forecast/
Archive DataHistorical weather data/archive/
Soil MoistureLand surface data products/soil-moisture/
Storm TracksTropical cyclone data/storm/
TidesTidal predictions/tides/
LightningLightning data products/lightning/
WMSOGC Web Map Service layers/ows/wms
Maritime InsightsRoute optimization data/insights/maritime/
Custom ProductsCustom data products/custom/

Common Parameters

Many endpoints share common query parameters:

ParameterDescriptionExample
latLatitude (-90 to 90)40.0
lonLongitude (-180 to 180)-105.0
bundlesBundle selectionbasic,maritime
unit_systemUnit system (SI Units or US Units)si
issuanceIssuance Time2024-01-15T00:00:00Z

Rate Limits

API requests are subject to rate limiting based on your subscription tier. If you exceed your rate limit, you’ll receive a 429 Too Many Requests response.

Error Handling

The API uses standard HTTP status codes:

CodeDescription
200Success
302Redirect (follow for file downloads)
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Server Error

Error responses include details:

{
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "Latitude must be between -90 and 90"
  }
}

Next Steps