Crops & Reference Data API
Access crop information, categories, units of measurement, and other reference data
List Crops
GET
/api/v1/cropsPublic KeyGet a comprehensive list of agricultural crops
Query Parameters
Parameters
categorystringFilter by crop category (Cash Crops, Food Crops, Horticulture)
seasonstringFilter by growing season
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/crops?category=Cash%20Crops" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"id": 1,
"name": "Coffee",
"scientific_name": "Coffea arabica",
"category": "Cash Crops",
"sub_category": "Beverage Crops",
"varieties": ["Ruiru 11", "Batian", "SL28", "SL34"],
"growing_season": "Year-round with two main seasons",
"maturity_period": "3-4 years to first harvest",
"climate_requirements": {
"altitude": "1400-2100m above sea level",
"rainfall": "1000-2000mm per year",
"temperature": "15-24°C"
},
"major_growing_regions": ["Kiambu", "Nyeri", "Kirinyaga", "Murang'a"]
},
{
"id": 2,
"name": "Tea",
"scientific_name": "Camellia sinensis",
"category": "Cash Crops",
"sub_category": "Beverage Crops",
"varieties": ["TRFK 6/8", "TRFK 301", "TRFK 303"],
"growing_season": "Year-round",
"maturity_period": "18-24 months",
"climate_requirements": {
"altitude": "1500-2700m above sea level",
"rainfall": "1200-1400mm per year",
"temperature": "10-30°C"
},
"major_growing_regions": ["Kericho", "Nandi", "Bomet", "Nyamira"]
}
]
}Get Crop Categories
GET
/api/v1/crops/categoriesPublic KeyGet all crop categories and sub-categories
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/crops/categories" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"category": "Food Crops",
"sub_categories": [
{
"name": "Cereals",
"crops": ["Maize", "Wheat", "Rice", "Sorghum", "Millet"]
},
{
"name": "Legumes",
"crops": ["Beans", "Peas", "Lentils", "Green Grams", "Cowpeas"]
},
{
"name": "Tubers",
"crops": ["Potatoes", "Sweet Potatoes", "Cassava", "Yams"]
}
]
},
{
"category": "Cash Crops",
"sub_categories": [
{
"name": "Beverage Crops",
"crops": ["Coffee", "Tea"]
},
{
"name": "Industrial Crops",
"crops": ["Cotton", "Pyrethrum", "Sisal", "Sugar Cane"]
}
]
},
{
"category": "Horticulture",
"sub_categories": [
{
"name": "Vegetables",
"crops": ["Tomatoes", "Cabbages", "Kales", "Onions", "Carrots"]
},
{
"name": "Fruits",
"crops": ["Bananas", "Mangoes", "Avocados", "Oranges", "Passion Fruit"]
}
]
}
]
}Get Units of Measurement
GET
/api/v1/reference/unitsPublic KeyGet standard units of measurement used in the system
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/reference/units" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"category": "Weight",
"units": [
{
"name": "90kg bag",
"abbreviation": "90kg",
"base_unit": "kilogram",
"conversion_factor": 90
},
{
"name": "50kg bag",
"abbreviation": "50kg",
"base_unit": "kilogram",
"conversion_factor": 50
},
{
"name": "2kg tin",
"abbreviation": "2kg",
"base_unit": "kilogram",
"conversion_factor": 2
},
{
"name": "1kg",
"abbreviation": "kg",
"base_unit": "kilogram",
"conversion_factor": 1
}
]
},
{
"category": "Count",
"units": [
{
"name": "piece",
"abbreviation": "pc",
"base_unit": "piece",
"conversion_factor": 1
},
{
"name": "bunch",
"abbreviation": "bunch",
"base_unit": "bunch",
"conversion_factor": 1
},
{
"name": "crate",
"abbreviation": "crate",
"base_unit": "crate",
"conversion_factor": 1
}
]
},
{
"category": "Volume",
"units": [
{
"name": "litre",
"abbreviation": "L",
"base_unit": "litre",
"conversion_factor": 1
},
{
"name": "debe (20L)",
"abbreviation": "debe",
"base_unit": "litre",
"conversion_factor": 20
}
]
}
]
}Get Market Types
GET
/api/v1/reference/market-typesPublic KeyGet standard market type classifications
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/reference/market-types" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"type": "Wholesale",
"description": "Large-scale markets for bulk trading",
"characteristics": [
"Large volumes traded",
"Lower prices per unit",
"Primarily for traders and retailers"
]
},
{
"type": "Retail",
"description": "Consumer-facing markets",
"characteristics": [
"Smaller quantities",
"Higher prices per unit",
"Direct to consumer sales"
]
},
{
"type": "Rural",
"description": "Markets in rural agricultural areas",
"characteristics": [
"Close to production areas",
"Mix of farmers and traders",
"Seasonal variations"
]
},
{
"type": "Urban",
"description": "Markets in urban centers",
"characteristics": [
"Higher volume",
"More diverse products",
"Better infrastructure"
]
}
]
}Crop Object Schema
Response Schema
idintegerCrop ID
namestringCommon crop name
scientific_namestringnullableScientific/botanical name
categorystringMain category (Cash Crops, Food Crops, Horticulture)
sub_categorystringnullableSub-category classification
varietiesarray of stringsnullableCommon varieties grown in Kenya
growing_seasonstringnullableGrowing/planting season information
maturity_periodstringnullableTime from planting to harvest
climate_requirementsobjectnullableOptimal climate conditions (altitude, rainfall, temperature)
major_growing_regionsarray of stringsnullableMain production regions in Kenya