Data-Driven Farming Decisions: Frost Risk, Irrigation and Harvest Window APIs

So many farming decisions come down to the weather. Will there be frost tonight? How much water will the field need this week? Which hours are good for spraying? When is harvest getting close? You can answer these with weather data and well-established methods, but collecting the data and running the calculations takes effort in every app. APIKodu's agriculture APIs turn those calculations into a single call based on location and crop. This guide covers the four you'll reach for most often and how they work together.

One important note: these APIs are decision support. They are not a prescription, agronomic advice or an application instruction. The final call always belongs to the person who knows the field.

Working with location and crop

Most agriculture APIs work from a coordinate (latitude, longitude). Weather data is resolved on 0.1° grid cells. The documented data sources are Copernicus ERA5 / ERA5-Land, Open-Meteo, OpenWeather and MET Norway. Some APIs also let you send your own temperatures (dailyTemps) or hourly readings (hourly) instead of location data.

APIs that take a crop code support: wheat, barley, maize, sunflower, cotton, potato, tomato, rapeseed, oats, rye, sugarbeet, grape, apple, chickpea and lentil.

Frost risk

The Frost Risk API counts the nights when the daily minimum temperature is at or below your threshold.

curl "https://api.apikodu.com/api/v1/agriculture/frostrisk?latitude=39.93&longitude=32.86" \
  -H "x-api-key: YOUR_API_KEY"
  • threshold: frost threshold in °C. Default 0, range -20 to 5.
  • fromDate, toDate: date range. Leave them out to look ahead horizonDays from today (default 10, maximum 10).
  • includeBreakdown: a night-by-night breakdown.

For sensitive crops, setting the threshold to match the crop's tolerance makes the warning more meaningful.

Irrigation need and evapotranspiration

The Irrigation Need API uses the FAO-56 formula ETc = ET0 × Kc to estimate crop water use and returns the irrigation need in both mm and m³.

  • area (required) and areaUnit: the area and its unit, such as decare (da), donum, hectare, are or m². One decare equals one donum, or 1,000 m².
  • crop and stage: the crop and growth stage (initial, mid, late). Kc is looked up from these, or you can pass your own kc.
  • et0Mm: pass ET0 directly if you have it; otherwise it's calculated from location and date range.

If you only need reference evapotranspiration, the Evapotranspiration (ET0/ETc) API returns FAO-56 ET0 for a date range, plus ETc when you give a crop or Kc.

Spray window and harvest window

Spray window

The Spray Window API finds the upcoming hours that suit spraying, based on wind, rain over the previous six hours, humidity and temperature. It looks 48 hours ahead by default (up to 168). You can tune every threshold. The defaults are 3–15 km/h wind, at most 0.2 mm of rain in the last six hours, humidity up to 90% and 10–25 °C. Alongside it, the Delta-T Spray Suitability API calculates Delta-T from temperature and relative humidity and flags hours as ideal, caution or unsuitable.

Harvest window

The Harvest Window API accumulates the crop's growing degree days (GDD) from a start date and estimates the harvest date against the crop's harvest threshold.

curl "https://api.apikodu.com/api/v1/agriculture/harvestwindow?crop=wheat&fromDate=2026-03-01&latitude=39.93&longitude=32.86" \
  -H "x-api-key: YOUR_API_KEY"

crop and fromDate are required. If toDate is empty, it looks a year ahead from the start date. With stageCode you can ask for the emergence or flowering threshold instead of harvest. To see cumulative GDD on its own, use the Growing Degree Days (GDD) API.

Putting them together, plus FAQ

These APIs work best side by side. A field screen in a farm app could show the frost warning for the coming days, this week's irrigation need, suitable spraying hours and the estimated harvest date together. All of them use the same API key; see getting started with one API key for the basics.

Are these results advice?

No. As the documentation states, they're decision support, not a prescription or agronomic advice.

Can I use my own weather station data?

For some APIs, yes. In a POST request body, Frost Risk, GDD and Harvest Window accept dailyTemps, and Spray Window accepts hourly; that data replaces the location-based weather.

I need the forecast itself.

The Weather Forecast API returns up to 10 days of daily and up to 96 hours of hourly forecasts for a point. To use any of these from an AI tool, see our MCP server guide.

APIKodu Team

APIKodu Team

Similar Articles