DEV Community

Shariq Mirza
Shariq Mirza

Posted on

I built a real-time Indian Mandi Price API — here's how

What I built

A REST API that gives real-time daily agricultural commodity
prices from Indian mandis — filtered by state, crop, and district.

Data is sourced directly from Government of India (data.gov.in)
and updates daily.

Why I built it

India has 7000+ mandis but no clean API to access price data.
Agri-tech startups, commodity trading apps, and farmer apps
all need this data — but there was no easy way to get it.

So I built one.

Tech Stack

  • Node.js + Express
  • Deployed on Railway
  • Data from data.gov.in
  • Listed on RapidAPI

Endpoints

  • GET /api/mandi/prices — all prices
  • GET /api/mandi/prices/state/Kerala — filter by state
  • GET /api/mandi/prices/crop/Wheat — filter by crop
  • GET /api/mandi/prices/district/Alappuzha — filter by district

Live Example

Try it yourself — no signup needed:

Get all prices:

curl -X GET "https://mandi-api-production.up.railway.app/api/mandi/prices"
Enter fullscreen mode Exit fullscreen mode

Filter by state:

curl -X GET "https://mandi-api-production.up.railway.app/api/mandi/prices/state/Kerala"
Enter fullscreen mode Exit fullscreen mode

Filter by crop:

curl -X GET "https://mandi-api-production.up.railway.app/api/mandi/prices/crop/Wheat"
Enter fullscreen mode Exit fullscreen mode

Sample Response:

{
  "state": "Kerala",
  "district": "Alappuzha", 
  "market": "Cherthala APMC",
  "commodity": "Cabbage",
  "min_price": 4000,
  "max_price": 4300,
  "modal_price": 4200,
  "arrival_date": "11/05/2026"
}
Enter fullscreen mode Exit fullscreen mode

Free plan available — no credit card needed.

Feedback welcome!

Top comments (0)