CropSense

Search documentation

Search for a command to run...

API Reference

Planting Advisories

When to plant, from each field's rainy-season history and climatology.

get/planting-advisories/field/{field_id}/latest

Get the latest planting advisory for each of a field's rainy seasons

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired

Response 200

advisoriesPlantingAdvisory[]required
totalintegerrequired
GET /planting-advisories/field/{field_id}/latest
curl -X GET "https://api.cropsense.africa/planting-advisories/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/latest" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "advisories": [
    {
      "advisory_id": "advisory_id",
      "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
      "season_number": 1,
      "season_label": "season_label",
      "season_year": 1,
      "advisory_type": "pre_season",
      "window_start": "2026-06-15",
      "window_end": "2026-06-15",
      "confidence": "confidence",
      "definition_version": "definition_version",
      "details": {},
      "created_at": "2026-06-15T09:30:00Z"
    }
  ],
  "total": 1
}
get/planting-advisories/field/{field_id}

List a field's planting advisories, newest first

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired
season_yearintegerquery
advisory_typeenum<string>query

pre_seasonplant_nowwait_false_startwindow_closing

Response 200

advisoriesPlantingAdvisory[]required
totalintegerrequired
GET /planting-advisories/field/{field_id}
curl -X GET "https://api.cropsense.africa/planting-advisories/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42?season_year=1&advisory_type=pre_season" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "advisories": [
    {
      "advisory_id": "advisory_id",
      "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
      "season_number": 1,
      "season_label": "season_label",
      "season_year": 1,
      "advisory_type": "pre_season",
      "window_start": "2026-06-15",
      "window_end": "2026-06-15",
      "confidence": "confidence",
      "definition_version": "definition_version",
      "details": {},
      "created_at": "2026-06-15T09:30:00Z"
    }
  ],
  "total": 1
}
get/planting-advisories/field/{field_id}/seasons

Get the year-by-year rainy-season history for a field's location

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired
from_yearintegerquery

Response 200

field_idstringrequired
region_iso2stringrequired
cell_idintegerrequired
definition_versionstringrequired
seasonsSeasonYear[]required
GET /planting-advisories/field/{field_id}/seasons
curl -X GET "https://api.cropsense.africa/planting-advisories/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/seasons?from_year=1" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
  "region_iso2": "region_iso2",
  "cell_id": 1,
  "definition_version": "definition_version",
  "seasons": [
    {
      "season_number": 1,
      "season_label": "season_label",
      "season_year": 1,
      "onset_date": "2026-06-15",
      "false_start_date": "2026-06-15",
      "cessation_date": "2026-06-15",
      "lgp_days": 1,
      "season_total_mm": 1.5,
      "max_dry_spell_days": 1
    }
  ]
}
get/planting-advisories/field/{field_id}/climatology

Get the rainy-season statistics for a field's location

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired

Response 200

field_idstringrequired
region_iso2stringrequired
cell_idintegerrequired
definition_versionstringrequired
computed_atstring<date-time>optional
seasonsSeasonClimatology[]required
GET /planting-advisories/field/{field_id}/climatology
curl -X GET "https://api.cropsense.africa/planting-advisories/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/climatology" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
  "region_iso2": "region_iso2",
  "cell_id": 1,
  "definition_version": "definition_version",
  "computed_at": "2026-06-15T09:30:00Z",
  "seasons": [
    {
      "season_number": 1,
      "season_label": "season_label",
      "regime": "regime",
      "season_year": 1,
      "climatological_onset": "2026-06-15",
      "climatological_cessation": "2026-06-15",
      "onset_p20": "2026-06-15",
      "onset_p50": "2026-06-15",
      "onset_p80": "2026-06-15",
      "cessation_p20": "2026-06-15",
      "cessation_p50": "2026-06-15",
      "cessation_p80": "2026-06-15",
      "lgp_p20_days": 1,
      "lgp_p50_days": 1,
      "false_start_rate": 1.5,
      "failed_season_rate": 1.5,
      "mean_season_total_mm": 1.5,
      "dry_spell_prob": {},
      "cumulative_rain_pctl": {},
      "rain_curve_start": "2026-06-15",
      "observed_rain": {
        "through_date": "2026-06-15",
        "cumulative_mm": [
          1.5
        ]
      },
      "n_years": 1,
      "baseline_start_year": 1,
      "baseline_end_year": 1
    }
  ]
}