This section contains all the endpoints related to crops, including crop listings, details, and recommendations.
GET
/v1/crops/{id}
Rate Limit: 1000/min
Cost: ₦0.0020
Get Crop Details
Get detailed information about a specific crop.
Example API Call
curl -X GET "https://api.riwe.io/v1/crops/{id}" \
-H "X-API-KEY: your_api_key_here"
Example Response
{
"id": 1,
"name": "Maize",
"scientific_name": "Zea mays",
"category": "cereals",
"growing_season": "March to July",
"maturity_days": 90,
"water_requirements": "Medium",
"optimal_temperature": "20-30\u00b0C",
"soil_requirements": "Well-drained, fertile soil with pH 5.5-7.0",
"planting_depth": "3-5 cm",
"spacing": "75 cm between rows, 25 cm between plants",
"fertilizer_requirements": "NPK 15-15-15 at planting, Urea at 4-6 weeks",
"common_pests": [
"Fall armyworm",
"Stem borers",
"Aphids"
],
"common_diseases": [
"Maize streak virus",
"Leaf blight",
"Rust"
],
"harvesting_indicators": "Dry husks, black layer formation at kernel base",
"yield_potential": "2-5 tons per hectare",
"storage_conditions": "Dry, cool place with good ventilation",
"description": "Maize is a cereal grain first domesticated by indigenous peoples in southern Mexico.",
"image_url": "https://example.com/images/maize.jpg",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z"
}
GET
/v1/crops/recommendations
Rate Limit: 500/min
Cost: ₦0.0100
Get Crop Recommendations
Get crop recommendations based on location, soil type, and season.
Example API Call
curl -X GET "https://api.riwe.io/v1/crops/recommendations" \
-H "X-API-KEY: your_api_key_here"
Example Response
{
"location": {
"latitude": 9.0765,
"longitude": 7.3986,
"name": "Abuja, Nigeria"
},
"soil_type": "loam",
"season": "rainy",
"recommendations": [
{
"crop_id": 1,
"name": "Maize",
"suitability_score": 95,
"planting_window": "March to April",
"expected_yield": "4-5 tons per hectare",
"notes": "Highly suitable for this region during the rainy season."
},
{
"crop_id": 5,
"name": "Cassava",
"suitability_score": 90,
"planting_window": "March to May",
"expected_yield": "20-25 tons per hectare",
"notes": "Well-suited to the soil conditions in this area."
},
{
"crop_id": 8,
"name": "Yam",
"suitability_score": 85,
"planting_window": "February to March",
"expected_yield": "15-20 tons per hectare",
"notes": "Traditional crop for this region with good market value."
}
]
}
GET
/v1/crops
Rate Limit: 1000/min
Cost: ₦0.0020
List Crops
Get a list of all available crops with their details.
Example API Call
curl -X GET "https://api.riwe.io/v1/crops" \
-H "X-API-KEY: your_api_key_here"
Example Response
{
"data": [
{
"id": 1,
"name": "Maize",
"scientific_name": "Zea mays",
"category": "cereals",
"growing_season": "March to July",
"maturity_days": 90,
"water_requirements": "Medium",
"optimal_temperature": "20-30\u00b0C",
"description": "Maize is a cereal grain first domesticated by indigenous peoples in southern Mexico.",
"image_url": "https://example.com/images/maize.jpg"
},
{
"id": 2,
"name": "Rice",
"scientific_name": "Oryza sativa",
"category": "cereals",
"growing_season": "May to October",
"maturity_days": 120,
"water_requirements": "High",
"optimal_temperature": "20-35\u00b0C",
"description": "Rice is the seed of the grass species Oryza sativa or less commonly Oryza glaberrima.",
"image_url": "https://example.com/images/rice.jpg"
}
],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 20,
"total": 98
}
}