ShambaRecords API Documentation

Welcome to the ShambaRecords API. Get real-time agricultural market data, price analytics, and crop information across Kenya.

Quick Start

1

Sign Up

Create a free account to get your API credentials

Create account
2

Get API Key

Generate your API keys from the dashboard

Go to dashboard
3

Make Request

Start fetching agricultural market data

View endpoints

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:

PlanRate LimitMonthly Quota
Free10 req/min1,000 requests
Basic60 req/min50,000 requests
Pro300 req/min500,000 requests
EnterpriseCustomUnlimited

Next Steps