API Documentation (v1)
Complete reference for endpoints, query parameters, response envelopes, and rate limits.
Base URL & Authentication
All requests are keyless and free to use. Prefix all routes with /v1. Rate limited to 100 requests per 15 minutes per IP address.
Base URL: https://mandi-api.onrender.com/v1Build With AI (ChatGPT, Claude, Gemini)
Feed this complete API Markdown Spec to any AI coding assistant to generate integration code instantly.
/v1/statesReturns a list of the 5 supported Indian states for Mandi prices.
curl -X GET "https://mandi-api.onrender.com/v1/states" \
-H "Accept: application/json"/v1/commoditiesReturns a list of distinct commodities/crops. Optionally scoped to a specific state or market.
| Parameter | Type | Required | Description |
|---|---|---|---|
| state | String | Optional | Filter commodities by state name (e.g. Maharashtra) |
| market | String | Optional | Filter commodities by specific APMC market (e.g. Katol APMC) |
curl -X GET "https://mandi-api.onrender.com/v1/commodities?state=Maharashtra" \
-H "Accept: application/json"/v1/marketsReturns list of all active mandis/markets in a state.
| Parameter | Type | Required | Description |
|---|---|---|---|
| state | String | Yes | Required state name (e.g. Uttar Pradesh) |
curl -X GET "https://mandi-api.onrender.com/v1/markets?state=Uttar Pradesh" \
-H "Accept: application/json"/v1/pricesQuery daily mandi prices. Requires either state OR commodity.
curl -X GET "https://mandi-api.onrender.com/v1/prices?state=Maharashtra&commodity=Onion" \
-H "Accept: application/json"/v1/prices/historyRetrieve price history trends over date ranges. If market is omitted, returns average state-wide modal prices per date.
curl -X GET "https://mandi-api.onrender.com/v1/prices/history?state=Maharashtra&commodity=Onion" \
-H "Accept: application/json"Errors & Rate Limits
The API uses standard HTTP response codes and a uniform error envelope format.
{
"success": false,
"error": {
"code": "MISSING_PARAM",
"message": "At least one of query parameters 'state' or 'commodity' is required."
}
}