ShambaRecords API Documentation
Welcome to the ShambaRecords API. Get real-time agricultural market data, price analytics, and crop information across Kenya.
Quick Start
Your First Request
Here's a simple example to get the latest prices. Public endpoints require only your public API key in the X-API-Key header.
# Make your first API request
curl -X GET "https://api.shambarecords.com/api/v1/prices/latest" \
-H "X-API-Key: sr_pub_your_api_key_here"Authentication
ShambaRecords uses API keys with different security levels. Choose the right authentication method based on your use case:
Public Key
sr_pub_...For read-only operations. Can be safely used in client-side applications.
View public price data
Search markets and products
Access reference data
Secret Key
sr_sec_...For server-side operations with HMAC signature. Keep this secure.
Advanced price queries
Historical data access
Analytics and statistics
Secret key requests require HMAC-SHA256 signature verification:
curl -X POST "https://api.shambarecords.com/api/v1/prices/search" \
-H "X-API-Key: sr_sec_your_secret_key" \
-H "X-Signature: your_hmac_signature" \
-H "X-Signature-Timestamp: 1234567890" \
-H "Content-Type: application/json" \
-d '{
"product_uuid": "550e8400-e29b-41d4-a716-446655440000",
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}'Rate Limiting
All API requests are subject to rate limiting based on your subscription plan:
| Plan | Rate Limit | Monthly Quota |
|---|---|---|
| Free | 10 req/min | 1,000 requests |
| Basic | 60 req/min | 50,000 requests |
| Pro | 300 req/min | 500,000 requests |
| Enterprise | Custom | Unlimited |