खरीदें / बेचें

📚 API Documentation

Integrate MKisan data into your applications

🔐 Authentication

All API requests require authentication using an API key. Include your API key in the request header:

HTTP Header
X-API-Key: your_api_key_here

Example Request

JavaScript
const response = await fetch('https://mkisan.net/wp-json/mkisan/v1/mandi-bhav', {
    headers: {
        'X-API-Key': 'mk_xxxxxxxxxxxx'
    }
});
const data = await response.json();
cURL
curl -X GET "https://mkisan.net/wp-json/mkisan/v1/mandi-bhav" \
  -H "X-API-Key: mk_xxxxxxxxxxxx"
Python
import requests

headers = {'X-API-Key': 'mk_xxxxxxxxxxxx'}
response = requests.get(
    'https://mkisan.net/wp-json/mkisan/v1/mandi-bhav',
    headers=headers
)
data = response.json()

⚡ Rate Limits

API rate limits vary by plan:

PlanDaily RequestsMonthly Requests
Free1001,000
Starter1,00025,000
Professional10,000250,000
EnterpriseUnlimitedUnlimited
⚠️ Rate Limit Headers Check response headers for rate limit info: X-RateLimit-Remaining, X-RateLimit-Reset

❌ Error Handling

API uses standard HTTP status codes:

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
429Too Many Requests - Rate limit exceeded
500Server Error
Error Response Example:
JSON
{
    "success": false,
    "code": "rate_limit_exceeded",
    "message": "Daily rate limit exceeded. Resets at midnight IST."
}

🌾 Mandi Bhav API

Get real-time commodity prices from agricultural markets across India.

GET /wp-json/mkisan/v1/mandi-bhav

Get mandi prices with optional filters

Query Parameters

ParameterTypeDescription
statestringFilter by state code (e.g., UP, MP)
commoditystringFilter by commodity name
datestringDate in YYYY-MM-DD format
limitintegerNumber of results (default: 50, max: 500)
Response Example:
JSON
{
    "success": true,
    "data": [
        {
            "state": "Uttar Pradesh",
            "district": "Agra",
            "market": "Agra",
            "commodity": "Wheat",
            "variety": "Lokwan",
            "min_price": 2100,
            "max_price": 2350,
            "modal_price": 2250,
            "date": "2025-12-01"
        }
    ],
    "meta": {
        "total": 150,
        "page": 1,
        "limit": 50
    }
}

🥚 Egg Rates API

Get daily NECC egg rates for cities across India.

GET /wp-json/mkisan/v1/egg-rates

Get egg rates by city or date

Query Parameters

ParameterTypeDescription
citystringCity name (e.g., delhi, mumbai)
datestringDate in YYYY-MM-DD format
Response Example:
JSON
{
    "success": true,
    "data": {
        "city": "Delhi",
        "rate": 5.85,
        "rate_per_100": 585,
        "rate_per_tray": 175.50,
        "change": 0.10,
        "date": "2025-12-01"
    }
}

🤝 Deals API

Access buy/sell deals posted by farmers and traders.

GET /wp-json/mkisan/v1/deals

Get active deals with filters

💡 Tip Deals API is available in Starter plan and above. Free plan has limited access.

📍 Locations API

Get states, districts, and mandi location data.

GET /wp-json/mkisan/v1/locations/states

Get all Indian states

GET /wp-json/mkisan/v1/locations/districts/{state_code}

Get districts by state