The climate endpoint returns two time series for a geographic location: a historical monthly record spanning the years you specify, and a CMIP6 climate projection under a chosen emissions scenario. Both series include temperature, precipitation, and soil moisture for each month. You can use this data to analyse long-term climate trends, calibrate crop models, or compare a baseline period against projected future conditions.
Endpoint
GET api.climatifai.com/agri/climate
Parameters
Latitude of the location in decimal degrees, WGS 84.
Longitude of the location in decimal degrees, WGS 84.
Start year (inclusive) for the historical data series. Combined with to, this defines the historical baseline period.
End year (inclusive) for the historical data series.
CMIP6 emissions scenario to use for the projected series. Example values: SSP1-2.6, SSP2-4.5, SSP3-7.0, SSP5-8.5.
Optional ISO 3166-1 alpha-2 country code for the location being queried. Must be a LATAM country code, excluding Brazil (BR). Examples: PE, MX, CO. Safe to omit for standard use.
Response
Latitude echoed from the request.
Longitude echoed from the request.
CMIP6 scenario used for the projected series, echoed from the request.
Monthly climate observations for the requested historical period. Each element is a ClimateMonth object. Show ClimateMonth properties
Calendar year of this record.
Calendar month (1–12) of this record.
Mean air temperature in degrees Celsius for this month.
Total precipitation in millimetres for this month.
Volumetric soil moisture in m³/m³. May be null if unavailable for the period.
Monthly climate values from the CMIP6 projection. Shares the same ClimateMonth structure as historical.
Cache freshness metadata for both the historical and projected datasets. Cache metadata for the historical series. Contains cached_at (ISO 8601 string) and stale (boolean).
Cache metadata for the projected series. Contains cached_at (ISO 8601 string) and stale (boolean).
true if either the historical or projected cache entry is stale.
Contains upstream error information if any part of the data could not be fetched live and a stale or fallback result was served instead. Show _upstream_hints properties
Error message from the Open-Meteo historical endpoint, if any. null when no error occurred.
Error message from the Open-Meteo projection endpoint, if any. null when no error occurred.
Error codes
Code Description 502Upstream error from Open-Meteo. The detail field contains the original message. 503Open-Meteo rate limit exceeded. Retry after a short back-off.
Example
curl "https://api.climatifai.com/agri/climate?lat=4.711&lon=-74.0721&from=1991&to=2020&scenario=SSP3-7.0&country_iso=CO"
{
"lat" : 4.711 ,
"lon" : -74.0721 ,
"scenario" : "SSP3-7.0" ,
"historical" : [
{
"year" : 1991 ,
"month" : 1 ,
"temp_c" : 13.8 ,
"precip_mm" : 42.1 ,
"soil_moisture" : 0.198
},
{
"year" : 1991 ,
"month" : 2 ,
"temp_c" : 14.2 ,
"precip_mm" : 58.4 ,
"soil_moisture" : 0.213
}
],
"projected" : [
{
"year" : 2041 ,
"month" : 1 ,
"temp_c" : 15.1 ,
"precip_mm" : 38.7 ,
"soil_moisture" : 0.181
},
{
"year" : 2041 ,
"month" : 2 ,
"temp_c" : 15.6 ,
"precip_mm" : 52.0 ,
"soil_moisture" : 0.195
}
],
"_cache" : {
"historical" : {
"cached_at" : "2026-05-18T08:30:00Z" ,
"stale" : false
},
"projected" : {
"cached_at" : "2026-05-18T08:30:00Z" ,
"stale" : false
},
"any_stale" : false
},
"_upstream_hints" : {
"historical" : null ,
"projected" : null
}
}