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.

This guide will help you make your first API calls to retrieve weather data.

Prerequisites

Your First Request

Let’s retrieve a Point Forecast for Boulder, Colorado:

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

Example Response

{
  "meta": {
    "unit_system": "si",
    "forecast": "Spire Operational Forecast"
  },
  "data": [
    {
      "location": {
        "coordinates": {
          "lat": 40.018672,
          "lon": -105.250537
        }
      },
      "times": {
        "issuance_time": "2024-01-15T00:00:00",
        "valid_time": "2024-01-15T00:00:00"
      },
      "values": {
        "relative_humidity": 75.67,
        "air_temperature": 258.00,
        "dew_point_temperature": 257.25,
        "northward_wind": 1.55,
        "eastward_wind": -1.97
      }
    }
  ]
}

Common Use Cases

Get Current Weather

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

List Available Forecast Files

Shell
Python
Node.js
curl -X GET \
  'https://api.wx.spire.com/forecast/file?bundles=basic&regions=global' \
  -H 'spire-api-key: YOUR_API_KEY'

Get Latest Forecast

Use the /forecast/latest/point endpoint to get the most recent forecast without specifying an Issuance Time:

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

Selecting Data Bundles

Data is organized into bundles based on use case. Specify bundles in your request:

BundleDescription
basicStandard meteorological variables
maritimeMarine-specific parameters
agriculturalAgriculture-focused variables
aviationAviation weather parameters
solarSolar radiation data
windWind power parameters

Request multiple bundles by comma-separating:

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

Unit Systems

By default, responses use SI Units. Request US Units with the unit_system parameter:

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

See Units Reference for complete unit details.

Next Steps