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.

Real-time weather observations and conditions.

Endpoints

MethodEndpointDescription
GET/current/weather/fileList current weather files
GET/current/weather/file/{file_id}Download a current weather file
GET/current/weather/pointGet current weather at a point

List Current Weather Files

GET /current/weather/file

Retrieve a list of available current weather condition files.

Parameters

ParameterTypeRequiredDescription
timestringNoISO 8601 timestamp or time range
regionsstringNoComma-separated list of regions

Example Request

Shell
Python
Node.js
curl -X GET \
  'https://api.wx.spire.com/current/weather/file' \
  -H 'spire-api-key: YOUR_API_KEY'

Example Response

{
  "meta": {
    "count": 5
  },
  "files": [
    "cwc.20240115.t16z.0p027.basic.global.grib2",
    "cwc.20240115.t15z.0p027.basic.global.grib2"
  ]
}

Download Current Weather File

GET /current/weather/file/{file_id}

Download a specific current weather file.

Path Parameters

ParameterTypeRequiredDescription
file_idstringYesThe filename to download

Example Request

Shell
Python
Node.js
curl -OJL -X GET \
  'https://api.wx.spire.com/current/weather/file/cwc.20240115.t16z.0p027.basic.global.grib2' \
  -H 'spire-api-key: YOUR_API_KEY'

Get Current Weather at Point

GET /current/weather/point

Retrieve current weather conditions for a specific location.

Parameters

ParameterTypeRequiredDescription
latnumberYesLatitude (-90 to 90)
lonnumberYesLongitude (-180 to 180)
timestringNoISO 8601 timestamp or time range
unit_systemstringNosi (default) or us
tzstringNoTimezone identifier

Headers

HeaderDescription
X-FieldsField Mask for response filtering

Example Request

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'

Example Response

{
  "meta": {
    "unit_system": "si"
  },
  "data": [
    {
      "location": {
        "coordinates": {
          "lat": 40.0,
          "lon": -105.0
        }
      },
      "times": {
        "observation_time": "2024-01-15T16:00:00Z"
      },
      "values": {
        "air_temperature": 275.5,
        "relative_humidity": 65.2,
        "wind_speed": 5.3,
        "wind_direction": 225.0
      }
    }
  ]
}

Field Filtering

Use the X-Fields header to request specific fields:

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' \
  -H 'X-Fields: {data{values{air_temperature,wind_speed}}}'