TheDocumentation Index
Fetch the complete documentation index at: https://docs.climatifai.com/llms.txt
Use this file to discover all available pages before exploring further.
/agri/climate endpoint gives you two time series for any coordinate in LATAM: a historical monthly record going back as far as 1991, and a forward-looking projection generated from CMIP6 climate models. Both series share the same data shape, so you can hand them directly to a charting library or pass them into your own analysis pipeline.
Historical data
Historical records are sourced from the Open-Meteo ERA5 reanalysis archive. Each data point represents a single calendar month at the requested location and contains three variables:| Field | Type | Description |
|---|---|---|
year | integer | Calendar year |
month | integer | Calendar month (1–12) |
temp_c | float | null | Mean 2 m air temperature (°C) |
precip_mm | float | null | Total precipitation (mm) |
soil_moisture | float | null | Volumetric soil water content (m³/m³) |
from and to query parameters (both are calendar years). The default window is 1991–2020, matching the standard WMO climate normal period.
Projection data
Projected data is sourced from Open-Meteo’s CMIP6 ensemble. The same three fields (temp_c, precip_mm, soil_moisture) are returned for each projected month. Projections typically extend from the current year to 2050 or beyond depending on the scenario.
Available scenarios
Pass any of the following values in thescenario parameter:
| Scenario | Emissions pathway |
|---|---|
SSP1-2.6 | Low emissions — aggressive mitigation |
SSP2-4.5 | Intermediate emissions — current policies trajectory |
SSP3-7.0 | High emissions — regional rivalry (default) |
SSP5-8.5 | Very high emissions — fossil-fuel-intensive development |
The default scenario is
SSP3-7.0. If you are building an advisory tool, consider offering at least SSP1-2.6 alongside SSP3-7.0 so users can see the range of possible futures for their location.Read-through caching
When a Postgres database is configured, the API uses a read-through cache to avoid redundant upstream calls to Open-Meteo. The first time you request a coordinate, the API fetches from Open-Meteo and stores the result. Subsequent requests for the same coordinate are served from the cache until the data is considered stale. The_cache field in every response tells you what happened:
| Field | Meaning |
|---|---|
hit: true | Data was served from the local cache |
hit: false | Data was fetched from Open-Meteo and written to cache |
stale: true | Cached data exists but is beyond its TTL; upstream was called to refresh |
Coordinate rounding
Coordinates are rounded to four decimal places before being used as cache keys and stored in the database. This means that requests forlat=20.50001 and lat=20.5000 resolve to the same cached entry. Pass precise but consistent coordinates to maximise cache hit rates and avoid creating duplicate entries.
Sample response
The following is a representative response fromGET api.climatifai.com/agri/climate?lat=20.5&lon=-101.0&from=2020&to=2022&scenario=SSP3-7.0:
The
_upstream_hints field carries any error message returned by Open-Meteo during a fetch. A non-null value means the upstream call succeeded partially or returned a warning. A null value means the request completed cleanly.