MandiBhavAajKa REST API Reference (v1)
Programmatic access to Indian APMC mandi prices, commodity master taxonomy, arrivals, and historical time-series data. Responses are standard JSON with complete provenance declarations.
Live API Playground
Execute live requests directly against the production API.
Interactive API Playground
Test live endpoints directly in your browser.
Need a key? Generate a free key in 30 seconds.
// Press "Send Request" to test /api/v1/prices/latest // Example response will appear here formatted with metadata.
Authentication & Keys
All endpoints under /api/v1/* require an active API key.
Pass your key in the standard HTTP Authorization header:
Alternatively, you may pass the key via the custom header x-api-key: mb_live_.... Supplying conflicting keys in both headers will result in a 400 AMBIGUOUS_AUTHENTICATION error.
Rate Limits & Quotas
Limits are enforced using distributed Redis token-bucket counters with atomic PostgreSQL sync.
| Tier | Burst Limit (RPS) | Monthly Quota | Historical Range | Price |
|---|---|---|---|---|
| Free | 1 req / sec | 100 req / day (3,000/mo) | Up to 30 days | ₹0 |
| Pro | 10 req / sec | 50,000 req / month | Up to 365 days | ₹999 / mo |
| Enterprise | 50 req / sec | 500,000 req / month | Multi-year archive (1,825 days) | ₹4,999 / mo |
Standard Rate Limit Response Headers
X-RateLimit-Limit: Maximum allowed requests for current windowX-RateLimit-Remaining: Number of requests remaining in windowX-RateLimit-Reset: Epoch timestamp when the current window resetsRetry-After: Seconds to wait before retrying (sent on HTTP 429)
Standard Error Envelopes
All errors return consistent JSON envelopes with an institutional requestId.
Endpoints Reference
RESTful resources for prices, historical records, mandis, and commodities.
/api/v1/prices/latestRetrieves the latest available daily price records across APMC mandis.
Query Parameters:
state(optional): State slug or name (e.g.punjab,madhya-pradesh)district(optional): District slug or namemandi(optional): Mandi slug or name (e.g.indore,khanna)commodity(optional): Commodity slug or name (e.g.wheat,soyabean)limit(optional): Number of records (default 50, max 100 on Free, 250 on Enterprise)page(optional): Page number (default 1)
/api/v1/prices/historyRetrieves chronological historical price series for analysis, charting, and modeling.
Query Parameters:
commodityormandi(at least one required)days: Number of days (Free: max 30, Pro: max 365, Enterprise: max 1,825)from,to: Specific ISO date range (YYYY-MM-DD)
/api/v1/mandisMaster catalog of Indian APMC mandis including geo-coordinates, address, and status.
Query Parameters:
state(optional): Filter by statedistrict(optional): Filter by districtsearch(optional): Search across English, Hindi, and normalized aliases
/api/v1/commoditiesStandard agricultural commodity taxonomy categorized into Cereals, Pulses, Oilseeds, Spices, Vegetables, and Fruits.
Query Parameters:
category(optional): e.g.cereals,pulsessearch(optional): Search by English or Hindi name
Data Provenance & Freshness Standard
Honest data lineage and agricultural reporting cycle definitions.
In accordance with our platform transparency policy, MandiBhavAajKa never falsifies provenance claims.
We distinguish between upstream providers (e.g. CEDA Portal at Ashoka University) and statutory reporting bodies (e.g. Agmarknet / Directorate of Marketing & Inspection). Both are recorded in the provenance block.
APMC mandis conduct auctions primarily between 06:00 and 14:00 IST. Market reports for day $T$ are typically aggregated between 14:00 and 19:00 IST. The marketDate field represents the date of the auction, distinct from the retrievedAt synchronization timestamp.