Ecosystem · Free data All ecosystem services mfapi.in ↗
mfapi.in — free MF NAV history
The unsung free REST endpoint for AMFI mutual fund NAVs. We use it ourselves.
What it's great at. mfapi.in mirrors AMFI's daily NAV file as a clean REST endpoint — one URL per scheme,
no key, no quota. The data is the same canonical AMFI NAV that every Indian MF distributor uses. We seeded our 20y NAV
history from mfapi ourselves before adding daily AMFI ingest of our own. For NAV-only workloads, this is the right answer.
Compose with Genka when you need risk metrics (Sharpe / Sortino / max-DD), the SEBI category taxonomy, a
screener across 4,700 funds, holdings, or backtester — data mfapi doesn't compute.
Decision matrix
| If you need | Pick |
|---|---|
| Daily NAV history for one fund (by scheme code) | mfapi.in |
| Free, no-key access for a script or hobby project | mfapi.in |
| Bulk NAV seed for your own pipeline | mfapi.in |
| Filter 4,700 funds by Sharpe / Sortino / max-DD across rolling windows | Genka |
| SEBI category taxonomy + theme/factor facets | Genka |
| Multi-fund portfolio backtester with survivorship transparency | Genka |
| Holdings + holdings overlap between two funds | Genka |
Time-travel via as_of for a specific past date | Genka |
| MCP-native tool catalog for an agent | Genka |
What mfapi.in is great at
- Single-purpose, well-done. One job: surface AMFI NAVs as JSON. Does it cleanly.
- Free + no auth. Hit it from a script, a notebook, a serverless function. No key management.
- Canonical NAV. Same daily AMFI NAV file every Indian distributor uses — the legal source of record for fund NAV.
- Stable URL pattern.
https://api.mfapi.in/mf/{scheme_code}returns the full history;/{scheme_code}/latestreturns the latest row. - What to be aware of. NAV-only. No metrics, no screener, no portfolio analytics, no MCP. Best as a building block.
Where Genka complements mfapi
- Risk metrics, computed. Sharpe, Sortino, CAGR, max DD, alpha, beta, tail risk — absolute + rolling distributions, per fund per period. mfapi gives you NAV; Genka turns it into decisions.
- Screener with grammar.
mf_screener?period=3y&sharpe_absolute_gte=0.9&sort=-sharpe_absolute. Filter on any metric × any window. - SEBI taxonomy + facets. Filter by SEBI category, theme, factor, AMC. Each fund carries a benchmark mapping.
- Backtester + SIP simulator. Multi-fund portfolio, monthly/quarterly/annual rebalance, survivorship-handling.
- MCP-native. Self-describing tool catalog (
mf_screener,mf_backtest,mf_compare...) so an agent can discover capabilities at runtime.
Compose them
mfapi for ad-hoc NAV pulls; Genka for the screener / backtester / agent loop:
# Quick NAV check via mfapi (no key): import requests nav = requests.get("https://api.mfapi.in/mf/122639/latest").json() # → {"meta": {...}, "data": [{"date":"...","nav":"..."}]} # Screen 4,700 funds by 3y Sharpe via Genka MCP: # (in Claude Code) "Find flexi-cap funds with 3y Sharpe over 0.9" # → mf_screener returns ranked list with metric breakdowns # Backtest a two-fund portfolio with monthly rebalance: # mf_backtest({ from, to, allocation: [...], rebalance: "monthly" })
Relevant Genka endpoints
GET /v1/mf/{slug}— one fund: AMC, SEBI category, TER, AUM, benchmarkGET /v1/mf/{slug}/nav— daily NAV series (Direct Growth canonical)GET /v1/mf/{slug}/metrics?period=3y— risk metrics by periodGET /v1/mf/screener— filter on any metric columnPOST /v1/mf/backtest— multi-fund portfolio backtestPOST /v1/mf/{slug}/sip— monthly SIP simulation with XIRR
Full catalog: /llms.txt
Working with mfapi.in — gotchas
- Scheme codes from AMFI. Each fund is keyed by AMFI scheme code (5-6 digit integer). The Direct and Regular plans of the same fund have different scheme codes; pick the right one or your NAV history will be off.
- NAV is already adjusted. AMFI publishes NAVs net of expenses; you don't need to apply your own expense ratio. But corporate-action equivalents (dividend payouts inside IDCW plans) reset NAV — switch to Growth-plan codes for clean compounding.
- Be polite with the rate. It's a free public service. Cache aggressively, don't hammer; backoff on errors. If you need bulk pulls, do them off-peak (Indian midnight).
- Date range is from inception.
/mf/{code}returns the full history since fund inception. For long-running funds that's 20+ years of daily NAVs — the response can be a few hundred KB. Use/latestfor just today's NAV.
Other ecosystem services