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:
This service has the following endpoints available:
Description | Endpoints |
---|---|
Get Daily Forecast | GET /users/{leafUserId}/weather/forecast/field/{fieldId}/daily |
Get Hourly Forecast | GET /users/{leafUserId}/weather/forecast/field/{fieldId}/hourly |
Get Daily Forecast for lat/long | GET /weather/forecast/daily/{lat},{lon} |
Get Hourly Forecast for lat/long | GET /weather/forecast/hourly/{lat},{lon} |
Get Daily Historical | GET /users/{leafUserId}/weather/historical/field/{fieldId}/daily |
Get Hourly Historical | GET /users/{leafUserId}/weather/historical/field/{fieldId}/hourly |
Get Daily Historical for lat/long | GET /weather/historical/daily/{lat},{lon} |
Get Hourly Historical for lat/long | GET /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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Weather model data: icon , gfs , ifs , jma , gem or arpegeArome . The default is gfs |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Weather model data: icon , gfs , ifs , jma , gem or arpegeArome . The default is gfs |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Weather model data: icon , gfs , ifs , jma , gem or arpegeArome . The default is gfs |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Weather model data: icon , gfs , ifs , jma , gem or arpegeArome . The default is gfs |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Historical model data: era5 or era5Land . The default is era5 |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Historical model data: era5 or era5Land . The default is era5 |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Historical model data: era5 or era5Land . The default is era5 |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
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 |
---|---|
endTime | Local date. Returns operations until the endTime |
startTime | Local date. Returns operations from the startTime onward |
model | Historical model data: era5 or era5Land . The default is era5 |
units | System of units: imperial or metric . The default is metric |
Request examples
- cURL
- Python
- JavaScript
Response
Warning
If there is no data available at that time/day, the property will be returned as null.