CropSense

Search documentation

Search for a command to run...

API Reference

Field Weather Data

Current, forecast, and historical weather data per field.

get/weathers/field/{field_id}

Get all weather data by field id

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired
aggregate_bystringquery

Response 200

currentWeatherDatarequired
forecastWeatherData[]required
historicalWeatherHistoricalData[]required
GET /weathers/field/{field_id}
curl -X GET "https://api.cropsense.africa/weathers/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42?aggregate_by=daily" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "current": {
    "weather_id": "weather_id",
    "farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
    "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
    "weather_type": "current",
    "weather_date": "2026-06-15T09:30:00Z",
    "weather_description": "weather_description",
    "city": "city",
    "country": "Kenya",
    "temp": 1.5,
    "temp_min": 1.5,
    "temp_max": 1.5,
    "feels_like": 1.5,
    "pressure": 1.5,
    "humidity": 1.5,
    "precipitation": 1.5,
    "wind_speed": 1.5,
    "solar_radiation": 1.5,
    "data_source": "open_weather_map",
    "is_active": true,
    "created_at": "2026-06-15T09:30:00Z",
    "updated_at": "2026-06-15T09:30:00Z"
  },
  "forecast": [
    {
      "weather_id": "weather_id",
      "farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
      "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
      "weather_type": "current",
      "weather_date": "2026-06-15T09:30:00Z",
      "weather_description": "weather_description",
      "city": "city",
      "country": "Kenya",
      "temp": 1.5,
      "temp_min": 1.5,
      "temp_max": 1.5,
      "feels_like": 1.5,
      "pressure": 1.5,
      "humidity": 1.5,
      "precipitation": 1.5,
      "wind_speed": 1.5,
      "solar_radiation": 1.5,
      "data_source": "open_weather_map",
      "is_active": true,
      "created_at": "2026-06-15T09:30:00Z",
      "updated_at": "2026-06-15T09:30:00Z"
    }
  ],
  "historical": [
    {
      "date": "date",
      "temp_avg": 1.5,
      "temp_min": 1.5,
      "temp_max": 1.5,
      "humidity_avg": 1.5,
      "precipitation_avg": 1.5,
      "wind_speed_avg": 1.5
    }
  ]
}
get/weathers/field/{field_id}/current

Get current field weather by field id

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired

Response 200

weather_idstringrequired
farm_idstringrequired
field_idstringrequired
weather_typeenum<string>required
weather_datestring<date-time>required
weather_descriptionstringrequired
citystringoptional
countrystringoptional
tempnumberrequired
temp_minnumberoptional
temp_maxnumberoptional
feels_likenumberoptional
pressurenumberoptional
humiditynumberrequired
precipitationnumberrequired
wind_speednumberoptional
solar_radiationnumberoptional
data_sourceenum<string>required
is_activebooleanrequired
created_atstring<date-time>required
updated_atstring<date-time>required
GET /weathers/field/{field_id}/current
curl -X GET "https://api.cropsense.africa/weathers/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/current" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "weather_id": "weather_id",
  "farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
  "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
  "weather_type": "current",
  "weather_date": "2026-06-15T09:30:00Z",
  "weather_description": "weather_description",
  "city": "city",
  "country": "Kenya",
  "temp": 1.5,
  "temp_min": 1.5,
  "temp_max": 1.5,
  "feels_like": 1.5,
  "pressure": 1.5,
  "humidity": 1.5,
  "precipitation": 1.5,
  "wind_speed": 1.5,
  "solar_radiation": 1.5,
  "data_source": "open_weather_map",
  "is_active": true,
  "created_at": "2026-06-15T09:30:00Z",
  "updated_at": "2026-06-15T09:30:00Z"
}
get/weathers/field/{field_id}/forecast

Get forecast weather data by field id

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired

Response 200

weathersWeatherData[]required
totalintegerrequired
GET /weathers/field/{field_id}/forecast
curl -X GET "https://api.cropsense.africa/weathers/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/forecast" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "weathers": [
    {
      "weather_id": "weather_id",
      "farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
      "field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
      "weather_type": "current",
      "weather_date": "2026-06-15T09:30:00Z",
      "weather_description": "weather_description",
      "city": "city",
      "country": "Kenya",
      "temp": 1.5,
      "temp_min": 1.5,
      "temp_max": 1.5,
      "feels_like": 1.5,
      "pressure": 1.5,
      "humidity": 1.5,
      "precipitation": 1.5,
      "wind_speed": 1.5,
      "solar_radiation": 1.5,
      "data_source": "open_weather_map",
      "is_active": true,
      "created_at": "2026-06-15T09:30:00Z",
      "updated_at": "2026-06-15T09:30:00Z"
    }
  ],
  "total": 1
}
get/weathers/field/{field_id}/historical

Get historical weather data by field id

Requires an Authorization: Bearer header.

Parameters

field_idstringpathrequired
aggregate_bystringquery

Response 200

weathersWeatherHistoricalData[]required
totalintegerrequired
GET /weathers/field/{field_id}/historical
curl -X GET "https://api.cropsense.africa/weathers/field/8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42/historical?aggregate_by=daily" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response · 200
{
  "weathers": [
    {
      "date": "date",
      "temp_avg": 1.5,
      "temp_min": 1.5,
      "temp_max": 1.5,
      "humidity_avg": 1.5,
      "precipitation_avg": 1.5,
      "wind_speed_avg": 1.5
    }
  ],
  "total": 1
}