Open agricultural data

ShambaIQ Open Soil & Crop API

Unlock 30m precision satellite-derived soil data and dynamic fertilizer recommendations. We provide a public, free REST API for developers, researchers, and agronomists to build sustainable tech solutions for Kenyan farmers.

Hyper-local soil metrics

Get instant pH, Total Nitrogen, Extractable Phosphorus, Potassium, and Organic Carbon values for all 47 counties.

Crop suitability scoring

Calculate suitability indices for 25 major crops based on regional soil chemistry models and pH tolerances.

No API key required

Free tier requires no complex onboarding. Start building immediately with zero rate-limit friction for public use.

API base endpoint URL

https://api.shambaiq.com/api/v1

All requests must use HTTPS and return standard JSON payloads.

GET

/county/{county_slug}/soil

Retrieve county soil profile

Returns the aggregated 30m resolution satellite soil metrics for a given county. Replace {county_slug} with the lowercase county slug (e.g. kakamega).

Request headers

Content-Type: application/json

JSON response body

{
  "status": "success",
  "county": "Kakamega",
  "soil_metrics": {
    "pH": 5.63,
    "nitrogen_g_kg": 1.01,
    "phosphorus_mg_kg": 14.0,
    "potassium_mg_kg": 147.0,
    "organic_carbon_g_kg": 21.5
  },
  "agroecological_zone": "Western"
}
POST

/recommend

Generate fertilizer recommendation

Provides precision fertilizer requirements (basal, top-dressing bag quantities) and soil health assessments tailored dynamically to the crop and soil parameters.

JSON request body

{
  "county": "Kakamega",
  "crop": "Maize",
  "current_fertilizer": "DAP",
  "farm_size_acres": 1.0,
  "lang": "English",
  "price_mode": "Subsidized"
}

JSON response body

{
  "county_data": {
    "County": "Kakamega",
    "pH": 5.63,
    "Total Nitrogen (g/kg)": 1.01,
    "Extractable Phosphorus (mg/kg)": 14.0,
    "Extractable Potassium (mg/kg)": 147.0
  },
  "crop": "Maize",
  "advice": [
    "pH is Healthy (5.6).",
    "Recommended: 0.5 to 0.9 bags of NPK 17:17:17.",
    "Top-dress: Urea at Week 4-6."
  ],
  "budget": {
    "breakdown": [
      "Stage 1 (Basal): 0.71 x bags NPK 17:17:17",
      "Stage 2 (Top Dress): 1.00 x bags Urea"
    ],
    "total_budget": 4264
  },
  "health_score": 79
}

Quick integration code

cURL / Shell
curl -X GET \
  https://api.shambaiq.com/api/v1/county/kakamega/soil \
  -H "Content-Type: application/json"
JavaScript / Fetch
fetch('https://api.shambaiq.com/api/v1/county/kakamega/soil')
  .then(res => res.json())
  .then(data => console.log(data));
Python / Requests
import requests

url = "https://api.shambaiq.com/api/v1/county/kakamega/soil"
response = requests.get(url)
print(response.json())

Want to browse reports manually?

Explore individual county pages to see aggregated details compiled on top of our dataset.

Browse soil reports