Weather Endpoints

About

Here we list all the available endpoints from Leaf's Weather API. For an easy way to call them, we recommend using Leaf's Postman collection.

All HTTP methods should be prepended by this service's endpoint:

https://api.withleaf.io/services/weather/api

This service has the following endpoints available:

DescriptionEndpoints
Get Daily ForecastGET /users/{leafUserId}/weather/forecast/field/{fieldId}/daily
Get Hourly ForecastGET /users/{leafUserId}/weather/forecast/field/{fieldId}/hourly
Get Daily Forecast for lat/longGET /weather/forecast/daily/{lat},{lon}
Get Hourly Forecast for lat/longGET /weather/forecast/hourly/{lat},{lon}
Get Daily HistoricalGET /users/{leafUserId}/weather/historical/field/{fieldId}/daily
Get Hourly HistoricalGET /users/{leafUserId}/weather/historical/field/{fieldId}/hourly
Get Daily Historical for lat/longGET /weather/historical/daily/{lat},{lon}
Get Hourly Historical for lat/longGET /weather/historical/hourly/{lat},{lon}
Note

Daily data endpoints are limited to a request of one year (366 days), so endTime - startTime <= 366. Hourly data endpoints are limited to an interval of 30 days per request, so endTime - startTime <= 30.

Endpoints

Get Daily Forecast

 GET /users/{leafUserId}/weather/forecast/field/{fieldId}/daily

Get daily forecasted weather data by leaf user and field. If dates are not set on the endpoint, the response will return forecast data for the next seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelWeather model data: icon, gfs, ifs, jma, gem or arpegeArome. The default is gfs
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/users/{leafUserId}/weather/forecast/field/{fieldId}/daily'

Response

{
"type": "Feature",
"properties": {
"maxTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.8
},
{
"time": "2023-07-22T00:00:00",
"value": 28.1
},
....
],
"unit": "ºC"
},
"meanSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 25.3
},
{
"time": "2023-07-22T00:00:00",
"value": 25.1
},
....
],
"unit": "°C"
},
"minSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 18.7
},
{
"time": "2023-07-22T00:00:00",
"value": 17.2
},
....
],
"unit": "°C"
},
"maxSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.9
},
{
"time": "2023-07-22T00:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"sunrise": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": "2023-07-21T10:52"
},
{
"time": "2023-07-22T00:00:00",
"value": "2023-07-22T10:53"
},
....
],
"unit": "iso8601"
},
"snowfallSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"precipitationSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"maxWindspeed": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 15.2
},
{
"time": "2023-07-22T00:00:00",
"value": 19.9
},
....
],
"unit": "km/h"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 3.76
},
{
"time": "2023-07-22T00:00:00",
"value": 4.93
},
....
],
"unit": "mm"
},
"processedTime": "2023-07-21T13:01:11.662397",
"rainSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"maxWindgusts": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 27.0
},
{
"time": "2023-07-22T00:00:00",
"value": 24.1
},
....
],
"unit": "km/h"
},
"meanTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 25.0
},
{
"time": "2023-07-22T00:00:00",
"value": 23.6
},
....
],
"unit": "ºC"
},
"minTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 21.1
},
{
"time": "2023-07-22T00:00:00",
"value": 18.9
},
....
],
"unit": "ºC"
},
"sunset": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": "2023-07-22T01:11"
},
{
"time": "2023-07-22T00:00:00",
"value": "2023-07-23T01:10"
},
....
],
"unit": "iso8601"
},
"windDirection": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 350.0
},
{
"time": "2023-07-22T00:00:00",
"value": 332.0
},
....
],
"unit": "°"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Hourly Forecast

 GET /users/{leafUserId}/weather/forecast/field/{fieldId}/hourly

Get hourly forecasted weather data by Leaf User and field. If dates are not set on the endpoint, the response will return forecast data for the next seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelWeather model data: icon, gfs, ifs, jma, gem or arpegeArome. The default is gfs
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/users/{leafUserId}/weather/forecast/field/{fieldId}/hourly'

Response

{
"type": "Feature",
"properties": {
"rain": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.2
},
{
"time": "2023-07-21T01:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"soilMoisture 0-1": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.1
},
{
"time": "2023-07-21T01:00:00",
"value": 0.1
},
....
],
"unit": "m³/m³"
},
"soilMoisture 1-3": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.2
},
{
"time": "2023-07-21T01:00:00",
"value": 0.2
},
....
],
"unit": "m³/m³"
},
"soilMoisture 3-9": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.3
},
{
"time": "2023-07-21T01:00:00",
"value": 0.3
},
....
],
"unit": "m³/m³"
},
"soilMoisture 9-27": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.4
},
{
"time": "2023-07-21T01:00:00",
"value": 0.4
},
....
],
"unit": "m³/m³"
},
"soilMoisture 27-81": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.5
},
{
"time": "2023-07-21T01:00:00",
"value": 0.5
},
....
],
"unit": "m³/m³"
},
"longwaveRadiation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 563.8
},
{
"time": "2023-07-21T01:00:00",
"value": 642.3
},
....
],
"unit": "W/m²"
},
"dewpoint": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 22.6
},
{
"time": "2023-07-21T01:00:00",
"value": 22.6
},
....
],
"unit": "ºC"
},
"windgusts": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 9.4
},
{
"time": "2023-07-21T01:00:00",
"value": 5.8
},
....
],
"unit": "km/h"
},
"snowfall": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.11
},
{
"time": "2023-07-21T01:00:00",
"value": 0.04
},
....
],
"unit": "mm"
},
"shortwaveRadiation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 146.0
},
{
"time": "2023-07-21T01:00:00",
"value": 2.0
},
....
],
"unit": "W/m²"
},
"processedTime": "str",
"cloudcover": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 51.0
},
{
"time": "2023-07-21T01:00:00",
"value": 100.0
},
....
],
"unit": "%"
},
"precipitation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"relativeHumidity": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 75.0
},
{
"time": "2023-07-21T01:00:00",
"value": 80.0
},
....
],
"unit": "%"
},
"temperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 27.4
},
{
"time": "2023-07-21T01:00:00",
"value": 26.3
},
....
],
"unit": "ºC"
},
"windspeed": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 3.1
},
{
"time": "2023-07-21T01:00:00",
"value": 5.7
},
....
],
"unit": "km/h"
},
"windDirection": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 234.0
},
{
"time": "2023-07-21T01:00:00",
"value": 72.0
},
....
],
"unit": "km/h"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Daily Forecast for lat/lon

 GET /weather/forecast/daily/{lat},{lon}

Get daily forecasted weather data for lat/lon by leaf user and field. If dates are not set on the endpoint, the response will return forecast data for the next seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelWeather model data: icon, gfs, ifs, jma, gem or arpegeArome. The default is gfs
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/weather/forecast/daily/{lat},{lon}'

Response

{
"type": "Feature",
"properties": {
"maxTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.8
},
{
"time": "2023-07-22T00:00:00",
"value": 28.1
},
....
],
"unit": "ºC"
},
"meanSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 25.3
},
{
"time": "2023-07-22T00:00:00",
"value": 25.1
},
....
],
"unit": "°C"
},
"minSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 18.7
},
{
"time": "2023-07-22T00:00:00",
"value": 17.2
},
....
],
"unit": "°C"
},
"maxSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.9
},
{
"time": "2023-07-22T00:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"sunrise": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": "2023-07-21T10:52"
},
{
"time": "2023-07-22T00:00:00",
"value": "2023-07-22T10:53"
},
....
],
"unit": "iso8601"
},
"snowfallSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"precipitationSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"maxWindspeed": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 15.2
},
{
"time": "2023-07-22T00:00:00",
"value": 19.9
},
....
],
"unit": "km/h"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 3.76
},
{
"time": "2023-07-22T00:00:00",
"value": 4.93
},
....
],
"unit": "mm"
},
"processedTime": "2023-07-21T13:01:11.662397",
"rainSum": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-22T00:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"maxWindgusts": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 27.0
},
{
"time": "2023-07-22T00:00:00",
"value": 24.1
},
....
],
"unit": "km/h"
},
"meanTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 25.0
},
{
"time": "2023-07-22T00:00:00",
"value": 23.6
},
....
],
"unit": "ºC"
},
"minTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 21.1
},
{
"time": "2023-07-22T00:00:00",
"value": 18.9
},
....
],
"unit": "ºC"
},
"sunset": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": "2023-07-22T01:11"
},
{
"time": "2023-07-22T00:00:00",
"value": "2023-07-23T01:10"
},
....
],
"unit": "iso8601"
},
"windDirection": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 350.0
},
{
"time": "2023-07-22T00:00:00",
"value": 332.0
},
....
],
"unit": "°"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Hourly Forecast for lat/lon

 GET /weather/forecast/hourly/{lat},{lon}

Get hourly forecasted weather data for lat/lon by Leaf User and field. If dates are not set on the endpoint, the response will return forecast data for the next seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelWeather model data: icon, gfs, ifs, jma, gem or arpegeArome. The default is gfs
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/weather/forecast/hourly/{lat},{lon}'

Response

{
"type": "Feature",
"properties": {
"rain": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.7
},
{
"time": "2023-07-21T01:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"soilMoisture 0-1": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.1
},
{
"time": "2023-07-21T01:00:00",
"value": 0.1
},
....
],
"unit": "m³/m³"
},
"soilMoisture 1-3": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.2
},
{
"time": "2023-07-21T01:00:00",
"value": 0.2
},
....
],
"unit": "m³/m³"
},
"soilMoisture 3-9": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.3
},
{
"time": "2023-07-21T01:00:00",
"value": 0.3
},
....
],
"unit": "m³/m³"
},
"soilMoisture 9-27": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.4
},
{
"time": "2023-07-21T01:00:00",
"value": 0.4
},
....
],
"unit": "m³/m³"
},
"soilMoisture 27-81": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.5
},
{
"time": "2023-07-21T01:00:00",
"value": 0.5
},
....
],
"unit": "m³/m³"
},
"longwaveRadiation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 563.8
},
{
"time": "2023-07-21T01:00:00",
"value": 642.3
},
....
],
"unit": "W/m²"
},
"dewpoint": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 22.6
},
{
"time": "2023-07-21T01:00:00",
"value": 22.6
},
....
],
"unit": "ºC"
},
"windgusts": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 9.4
},
{
"time": "2023-07-21T01:00:00",
"value": 5.8
},
....
],
"unit": "km/h"
},
"snowfall": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.11
},
{
"time": "2023-07-21T01:00:00",
"value": 0.04
},
....
],
"unit": "mm"
},
"shortwaveRadiation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 146.0
},
{
"time": "2023-07-21T01:00:00",
"value": 2.0
},
....
],
"unit": "W/m²"
},
"processedTime": "str",
"cloudcover": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 51.0
},
{
"time": "2023-07-21T01:00:00",
"value": 100.0
},
....
],
"unit": "%"
},
"precipitation": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 0.0
},
{
"time": "2023-07-21T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"relativeHumidity": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 75.0
},
{
"time": "2023-07-21T01:00:00",
"value": 80.0
},
....
],
"unit": "%"
},
"temperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 27.4
},
{
"time": "2023-07-21T01:00:00",
"value": 26.3
},
....
],
"unit": "ºC"
},
"windspeed": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 3.1
},
{
"time": "2023-07-21T01:00:00",
"value": 5.7
},
....
],
"unit": "km/h"
},
"windDirection": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 234.0
},
{
"time": "2023-07-21T01:00:00",
"value": 72.0
},
....
],
"unit": "km/h"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Daily Historical

 GET /users/{leafUserId}/weather/historical/field/{fieldId}/daily

Get daily historical weather data by Leaf User and field. If the dates are not defined in the endpoint, the response will return data from the last seven days by default.

Please note, historical weather data from less than 5 days ago is unavailable. If you’re wanting historical weather data within the last 5 days, you can use the forecast service to get this information.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelHistorical model data: era5 or era5Land. The default is era5
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/users/{leafUserId}/weather/historical/field/{fieldId}/daily'

Response

{
"type": "Feature",
"properties": {
"maxTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 31.9
},
{
"time": "2023-07-15T00:00:00",
"value": 32.0
},
....
],
"unit": "ºC"
},
"meanSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 25.3
},
{
"time": "2023-07-22T00:00:00",
"value": 25.1
},
....
],
"unit": "°C"
},
"minSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 18.7
},
{
"time": "2023-07-22T00:00:00",
"value": 17.2
},
....
],
"unit": "°C"
},
"maxSoilTemperature": {
"values": [
{
"time": "2023-07-21T00:00:00",
"value": 28.9
},
{
"time": "2023-07-22T00:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"sunrise": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": "2023-07-14T10:47"
},
{
"time": "2023-07-15T00:00:00",
"value": "2023-07-15T10:48"
},
....
],
"unit": "iso8601"
},
"snowfallSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-15T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"precipitationSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-15T00:00:00",
"value": 0.2
},
....
],
"unit": "mm"
},
"maxWindspeed": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 14.1
},
{
"time": "2023-07-15T00:00:00",
"value": 13.5
},
....
],
"unit": "km/h"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 4.51
},
{
"time": "2023-07-15T00:00:00",
"value": 3.62
},
....
],
"unit": "mm"
},
"processedTime": "2023-07-21T16:50:17.965109",
"rainSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-15T00:00:00",
"value": 0.2
},
....
],
"unit": "mm"
},
"maxWindgusts": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 26.3
},
{
"time": "2023-07-15T00:00:00",
"value": 25.8
},
....
],
"unit": "km/h"
},
"meanTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 28.1
},
{
"time": "2023-07-15T00:00:00",
"value": 26.8
},
....
],
"unit": "ºC"
},
"minTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 26.1
},
{
"time": "2023-07-15T00:00:00",
"value": 23.2
},
....
],
"unit": "ºC"
},
"sunset": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": "2023-07-15T01:15"
},
{
"time": "2023-07-15T00:00:00",
"value": "2023-07-16T01:14"
},
....
],
"unit": "iso8601"
},
"windDirection": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 206.0
},
{
"time": "2023-07-15T00:00:00",
"value": 209.0
},
....
],
"unit": "°"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Hourly Historical

 GET /users/{leafUserId}/weather/historical/field/{fieldId}/hourly

Get hourly historical weather data by Leaf User and field. If the dates are not defined in the endpoint, the response will return data from the last seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelHistorical model data: era5 or era5Land. The default is era5
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/users/{leafUserId}/weather/historical/field/{fieldId}/hourly'

Response

{
"type": "Feature",
"properties": {
"rain": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilMoisture 0-7": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.1
},
{
"time": "2023-07-14T01:00:00",
"value": 0.1
},
....
],
"unit": "m³/m³"
},
"soilMoisture 7-28": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.2
},
{
"time": "2023-07-14T01:00:00",
"value": 0.2
},
....
],
"unit": "m³/m³"
},
"soilMoisture 28-100": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-14T01:00:00",
"value": 0.3
},
....
],
"unit": "m³/m³"
},
"soilMoisture 100-255": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.4
},
{
"time": "2023-07-14T01:00:00",
"value": 0.4
},
....
],
"unit": "m³/m³"
},
"longwaveRadiation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 563.8
},
{
"time": "2023-07-14T01:00:00",
"value": 642.3
},
....
],
"unit": "W/m²"
},
"dewpoint": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 23.4
},
{
"time": "2023-07-14T01:00:00",
"value": 23.3
},
....
],
"unit": "ºC"
},
"windgusts": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 17.6
},
{
"time": "2023-07-14T01:00:00",
"value": 19.1
},
....
],
"unit": "km/h"
},
"snowfall": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.18
},
{
"time": "2023-07-14T01:00:00",
"value": 0.08
},
....
],
"unit": "mm"
},
"shortwaveRadiation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 176.0
},
{
"time": "2023-07-14T01:00:00",
"value": 40.0
},
....
],
"unit": "W/m²"
},
"processedTime": "str",
"cloudcover": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 9.0
},
{
"time": "2023-07-14T01:00:00",
"value": 5.0
},
....
],
"unit": "%"
},
"precipitation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 30.2
},
{
"time": "2023-07-14T01:00:00",
"value": 29.8
},
....
],
"unit": "ºC"
},
"relativeHumidity": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 61.0
},
{
"time": "2023-07-14T01:00:00",
"value": 62.0
},
....
],
"unit": "%"
},
"temperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 31.9
},
{
"time": "2023-07-14T01:00:00",
"value": 31.4
},
....
],
"unit": "ºC"
},
"windspeed": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 7.7
},
{
"time": "2023-07-14T01:00:00",
"value": 6.4
},
....
],
"unit": "km/h"
},
"windDirection": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 233.0
},
{
"time": "2023-07-14T01:00:00",
"value": 223.0
},
....
],
"unit": "km/h"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Daily Historical for lat/lon

 GET /weather/historical/daily/{lat},{lon}

Get daily historical weather data for lat/lon by Leaf User and field. If the dates are not defined in the endpoint, the response will return data from the last seven days by default.

Please note, historical weather data from less than 5 days ago is unavailable. If you’re wanting historical weather data within the last 5 days, you can use the forecast service to get this information.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelHistorical model data: era5 or era5Land. The default is era5
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/weather/historical/daily/{lat},{lon}'

Response

{
"type": "Feature",
"properties": {
"maxTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 31.9
},
{
"time": "2023-07-15T00:00:00",
"value": 32.0
},
....
],
"unit": "ºC"
},
"meanSoilTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 25.3
},
{
"time": "2023-07-15T00:00:00",
"value": 25.1
},
....
],
"unit": "°C"
},
"minSoilTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 18.7
},
{
"time": "2023-07-15T00:00:00",
"value": 17.2
},
....
],
"unit": "°C"
},
"maxSoilTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 28.6
},
{
"time": "2023-07-15T00:00:00",
"value": 27.9
},
....
],
"unit": "°C"
},
"sunrise": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": "2023-07-14T10:47"
},
{
"time": "2023-07-15T00:00:00",
"value": "2023-07-15T10:48"
},
....
],
"unit": "iso8601"
},
"snowfallSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-15T00:00:00",
"value": 0.0
},
....
],
"unit": "cm"
},
"precipitationSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-15T00:00:00",
"value": 0.2
},
....
],
"unit": "mm"
},
"maxWindspeed": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 14.1
},
{
"time": "2023-07-15T00:00:00",
"value": 13.5
},
....
],
"unit": "km/h"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 4.51
},
{
"time": "2023-07-15T00:00:00",
"value": 3.62
},
....
],
"unit": "mm"
},
"processedTime": "2023-07-21T16:50:17.965109",
"rainSum": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-15T00:00:00",
"value": 0.2
},
....
],
"unit": "mm"
},
"maxWindgusts": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 26.3
},
{
"time": "2023-07-15T00:00:00",
"value": 25.8
},
....
],
"unit": "km/h"
},
"meanTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 28.1
},
{
"time": "2023-07-15T00:00:00",
"value": 26.8
},
....
],
"unit": "ºC"
},
"minTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 26.1
},
{
"time": "2023-07-15T00:00:00",
"value": 23.2
},
....
],
"unit": "ºC"
},
"sunset": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": "2023-07-15T01:15"
},
{
"time": "2023-07-15T00:00:00",
"value": "2023-07-16T01:14"
},
....
],
"unit": "iso8601"
},
"windDirection": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 206.0
},
{
"time": "2023-07-15T00:00:00",
"value": 209.0
},
....
],
"unit": "°"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}

Get Hourly Historical for lat/lon

 GET /weather/historical/hourly/{lat},{lon}

Get hourly historical weather data for lat/lon by Leaf User and field. If the dates are not defined in the endpoint, the response will return data from the last seven days by default.

Parameter (to filter by)values
endTimeLocal date. Returns operations until the endTime
startTimeLocal date. Returns operations from the startTime onward
modelHistorical model data: era5 or era5Land. The default is era5
unitsSystem of units: imperial or metric. The default is metric

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/weather/api/weather/historical/hourly/{lat},{lon}'

Response

{
"type": "Feature",
"properties": {
"rain": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilMoisture 0-7": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.1
},
{
"time": "2023-07-14T01:00:00",
"value": 0.1
},
....
],
"unit": "m³/m³"
},
"soilMoisture 7-28": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.2
},
{
"time": "2023-07-14T01:00:00",
"value": 0.2
},
....
],
"unit": "m³/m³"
},
"soilMoisture 28-100": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.3
},
{
"time": "2023-07-14T01:00:00",
"value": 0.3
},
....
],
"unit": "m³/m³"
},
"soilMoisture 100-255": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.4
},
{
"time": "2023-07-14T01:00:00",
"value": 0.4
},
....
],
"unit": "m³/m³"
},
"longwaveRadiation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 563.8
},
{
"time": "2023-07-14T01:00:00",
"value": 642.3
},
....
],
"unit": "W/m²"
},
"dewpoint": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 23.4
},
{
"time": "2023-07-14T01:00:00",
"value": 23.3
},
....
],
"unit": "ºC"
},
"windgusts": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 17.6
},
{
"time": "2023-07-14T01:00:00",
"value": 19.1
},
....
],
"unit": "km/h"
},
"snowfall": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"evapotranspiration": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.18
},
{
"time": "2023-07-14T01:00:00",
"value": 0.08
},
....
],
"unit": "mm"
},
"shortwaveRadiation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 176.0
},
{
"time": "2023-07-14T01:00:00",
"value": 40.0
},
....
],
"unit": "W/m²"
},
"processedTime": "str",
"cloudcover": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 9.0
},
{
"time": "2023-07-14T01:00:00",
"value": 5.0
},
....
],
"unit": "%"
},
"precipitation": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 0.0
},
{
"time": "2023-07-14T01:00:00",
"value": 0.0
},
....
],
"unit": "mm"
},
"soilTemperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 30.2
},
{
"time": "2023-07-14T01:00:00",
"value": 29.8
},
....
],
"unit": "ºC"
},
"relativeHumidity": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 61.0
},
{
"time": "2023-07-14T01:00:00",
"value": 62.0
},
....
],
"unit": "%"
},
"temperature": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 31.9
},
{
"time": "2023-07-14T01:00:00",
"value": 31.4
},
....
],
"unit": "ºC"
},
"windspeed": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 7.7
},
{
"time": "2023-07-14T01:00:00",
"value": 6.4
},
....
],
"unit": "km/h"
},
"windDirection": {
"values": [
{
"time": "2023-07-14T00:00:00",
"value": 233.0
},
{
"time": "2023-07-14T01:00:00",
"value": 223.0
},
....
],
"unit": "km/h"
}
},
"geometry": {
"type": "Point",
"coordinates": [
-89.64355775454169,
39.802794365611476
]
}
}
Warning

If there is no data available at that time/day, the property will be returned as null.