Food inflation — CPI subindex
tip
Status: LIVE — Real-time data from the upstream regulator. Updated on the regulator's publication cadence.
What it does
MoSPI's CPI release includes a food & beverages subindex with a long item taxonomy. Our API normalizes the monthly release into structured JSON with consistent item codes, weights, and YoY/MoM change. Useful for restaurant chains, agritech procurement, and commodity-trading desks pricing inflation risk.
Base URL
https://food-inflation.sahayakonline.co.in/v1/
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /health | Liveness probe |
GET | /v1/inflation/food/latest | Latest month with full item breakdown |
GET | /v1/inflation/food/series/{item_code} | 5-year time-series for a single CPI food item |
GET | /v1/inflation/food/aggregates | Headline food + cereals + vegetables + protein subindexes |
Sample request
- cURL
- Python
- Node.js
curl -sS https://food-inflation.sahayakonline.co.in/v1/inflation/food/latest \
-H "Authorization: Bearer $SAHAYAK_KEY" \
-H "Accept: application/json"
import os, requests
resp = requests.get(
"https://food-inflation.sahayakonline.co.in/v1/inflation/food/latest",
headers={"Authorization": f"Bearer {os.environ['SAHAYAK_KEY']}", "Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
const fetch = (await import('node-fetch')).default;
const resp = await fetch('https://food-inflation.sahayakonline.co.in/v1/inflation/food/latest', {
headers: {
'Authorization': `Bearer ${process.env.SAHAYAK_KEY}`,
'Accept': 'application/json',
},
});
console.log(await resp.json());
Sample response
{
"spec_ref": "spec_39_Food_Inflation_Index_API",
"endpoint": "/v1/inflation/food/latest",
"method": "GET",
"results": [
{ "item": "Headline food", "yoy_pct": 7.42, "mom_pct": 0.31, "weight": 39.06, "as_of": "2026-04" },
{ "item": "Cereals & products", "yoy_pct": 5.18, "mom_pct": -0.12, "weight": 9.67, "as_of": "2026-04" },
{ "item": "Vegetables", "yoy_pct": 23.16, "mom_pct": 4.81, "weight": 6.04, "as_of": "2026-04" }
],
"meta": { "fixture_mode": false, "url": "https://food-inflation.sahayakonline.co.in/v1/" }
}
Error codes
| Code | Meaning | Recommended action |
|---|---|---|
400 | Malformed request (missing required param, invalid format) | Fix request shape. Response body includes error.field pinpointing the issue. |
401 | Missing or invalid Authorization header | Verify key prefix matches your tier and that the header is Authorization: Bearer …. |
403 | Key valid but not entitled to this endpoint | Sandbox keys cannot call live-tier endpoints. Upgrade or request entitlement. |
404 | Resource not found | Check identifier format. Some endpoints return 200 with empty results[] instead of 404 — verify the endpoint convention. |
429 | Rate limit exceeded | Honor Retry-After header. Sandbox 30 r/m, Starter 300 r/m, Growth 1500 r/m. |
503 | Upstream regulator unreachable after retries | Live-tier only. Sahayak retries 3× with backoff before surfacing. Implement circuit-breaker on caller side. |
Rate limits
| Tier | Rate limit | Monthly cap |
|---|---|---|
| Sandbox | 30 r/min | 1,000 live calls (shared across 3 LIVE endpoints) |
| Starter | 300 r/min | 10,000 live calls |
| Growth | 1,500 r/min | 100,000 live calls |
| Scale | custom | 500,000+ |
SLA reference
See Status & SLA for uptime targets, latency targets, and incident communication. MoSPI publishes around the 12th of each month for the prior month; we land within 6 hours.