Skip to main content
Leaf’s Weather API provides historical and forecasted weather data tied to field boundaries or arbitrary lat/lon coordinates. Data is available in daily or hourly granularity, sourced from multiple weather models worldwide.

Forecast data

The forecast service covers 5 days in the past through 10 days into the future. If you don’t specify dates, Leaf returns the next 7 days by default.

Forecast models

ModelProviderCountryResolutionForecast LengthUpdate Frequency
GFSNOAAUnited States3–25 km16 daysEvery hour
ICONDeutscher WetterdienstGermany2–11 km7.5 daysEvery 3 hours
IFSECMWFEuropean Union44 km7 daysEvery 6 hours
JMAJMAJapan5–55 km11 daysEvery 3 hours
GEMCanadian Weather ServiceCanada2.5 km10 daysEvery 6 hours
Arpege & AromeMétéo-FranceFrance1–40 km4 daysEvery 6 hours
The default model is gfs. Leaf selects the best model for any given location when using the default, so you generally don’t need to specify one unless you want data from a particular source.

Forecast variables

Variables available across most models (some models omit soil temperature or soil moisture): Daily: temperature (mean/min/max), soil temperature (mean/min/max), sunrise, sunset, max wind speed, max wind gusts, wind direction, evapotranspiration, rain sum, snowfall sum, precipitation sum. Hourly (additional): dew point, longwave radiation, shortwave radiation, cloud cover, relative humidity, soil moisture at multiple depths.
Sunrise and sunset are daily-only. Dew point, radiation, cloud cover, and relative humidity are hourly-only. All other variables appear in both daily and hourly responses.

Historical data

Historical weather data is sourced from ERA5 reanalysis products and goes back to 1940 (ERA5) or 1950 (ERA5-Land). There is a 5-day delay on historical data availability. For weather data within the last 5 days, use the forecast endpoints instead.

Historical models

ModelCoverageResolutionTemporal ResolutionData Availability
ERA5Global~25 kmHourly1940–present
ERA5-LandGlobal~11 kmHourly1950–present
The default is era5. ERA5-Land offers higher spatial resolution but starts a decade later.

Historical variables

The same variable set as forecast data, with soil moisture measured at different depth intervals: 0–7 cm, 7–28 cm, 28–100 cm, and 100–255 cm (vs. 0–1 cm, 1–3 cm, 3–9 cm, 9–27 cm, 27–81 cm for forecast models).

Query options

You can fetch weather data in two ways: By field — Requires a Leaf user ID and field ID. Leaf uses the centroid of the field boundary.
GET /services/weather/api/users/{leafUserId}/weather/forecast/field/{fieldId}/daily
GET /services/weather/api/users/{leafUserId}/weather/historical/field/{fieldId}/hourly
By lat/lon — No Leaf user or field required. Pass coordinates directly.
GET /services/weather/api/weather/forecast/daily/{lat},{lon}
GET /services/weather/api/weather/historical/hourly/{lat},{lon}
All endpoints accept these parameters:
ParameterDescription
startTimeStart date (YYYY-MM-DD).
endTimeEnd date (YYYY-MM-DD).
modelWeather model to use. Defaults to gfs (forecast) or era5 (historical).
unitsmetric (default) or imperial.

Request limits

  • Daily endpoints: maximum span of 366 days per request.
  • Hourly endpoints: maximum span of 30 days per request.

Units

All numeric values respect the units parameter:
MeasurementMetricImperial
Temperature°C°F
Precipitation / Rain / ETmminch
Snowfallcminch
Wind speed / gustskm/hmph
RadiationW/m²W/m²
Soil moisturem³/m³m³/m³
Cloud cover / Humidity%%
Wind direction°°

Response format

All weather endpoints return GeoJSON Features. The geometry is a Point (field centroid or the lat/lon you specified). The properties object contains each weather variable as a named key with values (time series array) and unit.
{
  "type": "Feature",
  "properties": {
    "maxTemperature": {
      "values": [
        { "time": "2024-07-21T00:00:00", "value": 28.8 },
        { "time": "2024-07-22T00:00:00", "value": 28.1 }
      ],
      "unit": "ºC"
    }
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-89.643, 39.802]
  }
}
If no data is available for a given time/day, the value is returned as null.

What to do next

Last modified on March 24, 2026