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.

Land surface and agricultural Soil Moisture data products.

Endpoints

MethodEndpointDescription
GET/soil-moisture/regionList regional soil moisture files
GET/soil-moisture/region/{file_id}Download regional file
GET/soil-moisture/pointGet soil moisture at a point
GET/soil-moisture/historical/pointHistorical point data
GET/soil-moisture/historical/regionHistorical regional data
GET/soil-moisture/historical/status/{job_uuid}Check historical job status
GET/soil-moisture/historical/download/{job_uuid}Download historical data

List Regional Files

GET /soil-moisture/region

Retrieve a list of available regional soil moisture files.

Example Request

Shell
Python
Node.js
curl -X GET \
  'https://api.wx.spire.com/soil-moisture/region' \
  -H 'spire-api-key: YOUR_API_KEY'

Response

{
  "meta": {
    "count": 10
  },
  "files": [
    "soil-moisture.20240115.global.nc",
    "soil-moisture.20240114.global.nc"
  ]
}

Download Regional File

GET /soil-moisture/region/{file_id}

Download a specific soil moisture regional file.

Path Parameters

ParameterTypeRequiredDescription
file_idstringYesFilename to download

Example Request

Shell
Python
Node.js
curl -OJL -X GET \
  'https://api.wx.spire.com/soil-moisture/region/soil-moisture.20240115.global.nc' \
  -H 'spire-api-key: YOUR_API_KEY'

Point Soil Moisture

GET /soil-moisture/point

Retrieve current soil moisture data for a specific location.

Parameters

ParameterTypeRequiredDescription
latnumberYesLatitude (-90 to 90)
lonnumberYesLongitude (-180 to 180)
timestringNoISO 8601 timestamp

Example Request

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

Response

{
  "data": [
    {
      "location": {
        "lat": 40.0,
        "lon": -95.0
      },
      "time": "2024-01-15T00:00:00Z",
      "values": {
        "soil_moisture_0_10cm": 0.35,
        "soil_moisture_10_40cm": 0.38,
        "soil_moisture_40_100cm": 0.42,
        "soil_temperature_0_10cm": 275.5
      }
    }
  ]
}

Historical Point Data

GET /soil-moisture/historical/point

Request historical soil moisture data for a point.

Parameters

ParameterTypeRequiredDescription
latnumberYesLatitude
lonnumberYesLongitude
start_timestringYesStart of time range (ISO 8601)
end_timestringYesEnd of time range (ISO 8601)

Example Request

Shell
Python
Node.js
curl -X GET \
  'https://api.wx.spire.com/soil-moisture/historical/point?lat=40.0&lon=-95.0&start_time=2023-06-01T00:00:00Z&end_time=2023-06-30T00:00:00Z' \
  -H 'spire-api-key: YOUR_API_KEY'

Historical Regional Data

GET /soil-moisture/historical/region

Request historical soil moisture data for a region.

Parameters

ParameterTypeRequiredDescription
regionstringYesRegion identifier
start_timestringYesStart of time range (ISO 8601)
end_timestringYesEnd of time range (ISO 8601)

Response

{
  "job_uuid": "abc123-def456-789xyz",
  "status": "pending"
}

Check Historical Job Status

GET /soil-moisture/historical/status/{job_uuid}

Check the status of a historical data retrieval job.

Path Parameters

ParameterTypeRequiredDescription
job_uuidstringYesJob identifier

Response

{
  "job_uuid": "abc123-def456-789xyz",
  "status": "complete"
}

Download Historical Data

GET /soil-moisture/historical/download/{job_uuid}

Download data from a completed historical job.

Path Parameters

ParameterTypeRequiredDescription
job_uuidstringYesJob identifier

Available Variables

VariableDescriptionUnits
soil_moisture_0_10cmSurface layer moisturem³/m³
soil_moisture_10_40cmShallow root zonem³/m³
soil_moisture_40_100cmDeep root zonem³/m³
soil_temperature_0_10cmSurface soil temperatureK

Use Cases

Agriculture

Monitor soil conditions for:

Hydrology

Assess soil saturation for:

Example: Time Series Analysis

import requests
import pandas as pd

headers = {'spire-api-key': 'YOUR_API_KEY'}

# Get historical data
params = {
    'lat': 40.0,
    'lon': -95.0,
    'start_time': '2023-06-01T00:00:00Z',
    'end_time': '2023-06-30T00:00:00Z'
}

response = requests.get(
    'https://api.wx.spire.com/soil-moisture/historical/point',
    headers=headers,
    params=params
)

data = response.json()['data']
df = pd.DataFrame([
    {
        'time': d['time'],
        **d['values']
    }
    for d in data
])

df['time'] = pd.to_datetime(df['time'])
print(df.describe())