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.comAuthentication¶
An API Key is required for all requests. Include your key in the spire-api-key header:
curl -X GET 'https://api.wx.spire.com/forecast/point?lat=40.0&lon=-105.0' \
-H 'spire-api-key: YOUR_API_KEY'import requests
response = requests.get(
"https://api.wx.spire.com/forecast/point",
params={"lat": 40.0, "lon": -105.0},
headers={"spire-api-key": "YOUR_API_KEY"},
)
data = response.json()const response = await fetch(
"https://api.wx.spire.com/forecast/point?lat=40.0&lon=-105.0",
{ headers: { "spire-api-key": "YOUR_API_KEY" } }
);
const data = await response.json();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:
| Category | Description | Base Path |
|---|---|---|
| Current Weather | Real-time weather observations | /current/weather/ |
| Forecasts | Point, file, and route forecasts | /forecast/ |
| Archive Data | Historical weather data | /archive/ |
| Soil Moisture | Land surface data products | /soil-moisture/ |
| Storm Tracks | Tropical cyclone data | /storm/ |
| Tides | Tidal predictions | /tides/ |
| Lightning | Lightning data products | /lightning/ |
| WMS | OGC Web Map Service layers | /ows/wms |
| Maritime Insights | Route optimization data | /insights/maritime/ |
| Custom Products | Custom data products | /custom/ |
Common Parameters¶
Many endpoints share common query parameters:
| Parameter | Description | Example |
|---|---|---|
lat | Latitude (-90 to 90) | 40.0 |
lon | Longitude (-180 to 180) | -105.0 |
bundles | Bundle selection | basic,maritime |
unit_system | Unit system (SI Units or US Units) | si |
issuance | Issuance Time | 2024-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:
| Code | Description |
|---|---|
200 | Success |
302 | Redirect (follow for file downloads) |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error |
Error responses include details:
{
"error": {
"code": "INVALID_PARAMETER",
"message": "Latitude must be between -90 and 90"
}
}Next Steps¶
Quick Start Guide - Make your first API call
File Products Guide - Download forecast files
API Reference - Complete endpoint documentation