Mutual fund API reference
Everything you need to query Indian mutual fund schemes and NAV history. The API is read-only, requires no authentication, and is available as a live FastAPI service or as a tree of static JSON files.
Current mode: live FastAPI service ·
Base URL: /api/v1
Quick start
Fetch the latest NAV for a scheme with a single request. Scheme codes are the official AMFI scheme codes.
curl "https://api.example.com/api/v1/mf/125497/latest"
Or fetch the complete NAV history for that scheme:
curl "https://api.example.com/api/v1/mf/125497"
Replace https://api.example.com with your deployment origin.
Locally that is usually http://localhost:8000. The same
endpoints also work without the /api/v1 prefix, for example
/mf/125497/latest.
Python
import httpx
response = httpx.get("https://api.example.com/api/v1/mf/125497/latest", timeout=30)
payload = response.json()
print(payload["meta"]["scheme_name"])
print(payload["data"][0]) # {'date': '20-11-2026', 'nav': '210.02130'}
JavaScript
const res = await fetch("https://api.example.com/api/v1/mf/125497");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { meta, data, status } = await res.json();
console.log(meta.scheme_name, data[0]);
Google Sheets / Excel
Use IMPORTDATA("https://api.example.com/api/v1/mf/125497") for
a quick import, or WEBSERVICE with a JSON parser add-on for
structured access. For production use, prefer a small script that caches
the response.
Base URL & formats
| Live API base | /api/v1 |
|---|---|
| Compatibility base | / (same routes without the prefix) |
| OpenAPI schema | /api/openapi.json |
| Swagger UI | /api/docs (live service only) |
| Response format | application/json; charset=utf-8 |
| Methods | GET, HEAD, OPTIONS |
| Compression | gzip when the client sends Accept-Encoding: gzip |
| CORS | Open to all origins by default |
Dates
Dates in responses always use DD-MM-YYYY (for example
20-11-2026). Date inputs accept YYYY-MM-DD,
DD-MM-YYYY or DD-Mon-YYYY.
NAV values
NAV is returned as a fixed-point string with five decimal
places, exactly as published by AMFI (for example "210.02130").
Keeping it as a string avoids floating-point rounding in consumers that
need exact values. Parse it only when you need arithmetic.
Authentication
There is none. No API keys, tokens, cookies or registration. Every endpoint is public and read-only. Please be considerate: cache responses where possible and avoid polling in tight loops.
Rate limits
The live service allows 120 requests per minute per client IP
by default (configurable with MFDATA_RATE_LIMIT and
MFDATA_RATE_WINDOW). Every response includes:
X-RateLimit-Limit— requests allowed in the window.X-RateLimit-Remaining— requests left in the current window.Retry-After— seconds to wait, on HTTP429.
HTTP/1.1 429 Too Many Requests
Retry-After: 23
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
{
"status": "RATE_LIMITED",
"message": "Rate limit exceeded (120 requests per 60s). Please retry in 23s."
}
Static JSON deployments have no rate limit of their own; your CDN or GitHub Pages applies its own fair-use policy.
Data updates
AMFI publishes NAVs for the previous trading day in the evening. The GitHub Actions workflow runs twice a day — around 10:15 IST and 22:15 IST — and can also be triggered manually from the Actions tab.
Each run:
- Downloads
NAVAll.txt(latest NAVs for every scheme). - Downloads historical reports for the recent window, filling gaps and corrections.
- Upserts rows into SQLite, refreshes latest-NAV columns and dataset stats.
- Exports the static JSON tree and deploys the documentation site.
The freshest date available is exposed by /stats and /health. Check Status for the current dataset date.
Endpoints
All endpoints below are available under both /api/v1 and the site root.
List schemes
/api/v1/mfReturns the scheme master list. Without limit every scheme is returned (roughly 14,000 rows).
| Parameter | Type | Description |
|---|---|---|
limit | integer | Page size, 1–50,000. Omit for all rows. |
offset | integer | Rows to skip. Default 0. |
q | string | Optional case-insensitive name filter. |
fund_house | string | Exact fund house name, e.g. SBI Mutual Fund. |
category | string | Exact category, e.g. Equity Scheme - Small Cap Fund. |
curl "https://api.example.com/api/v1/mf?limit=2&offset=0"
[
{ "schemeCode": 100119, "schemeName": "Aditya Birla Sun Life Liquid Fund-Discipline Plan-Growth" },
{ "schemeCode": 100121, "schemeName": "HDFC Balanced Fund - Dividend Option" }
]
Search schemes
/api/v1/mf/search?q=Case-insensitive search across scheme names. An exact scheme code is also matched, and prefix matches rank first.
| Parameter | Type | Description |
|---|---|---|
q | string (required) | Search text, 1–100 characters. |
limit | integer | 1–1,000. Default 100. |
offset | integer | Rows to skip. Default 0. |
curl "https://api.example.com/api/v1/mf/search?q=hdfc&limit=5"
[
{ "schemeCode": 100121, "schemeName": "HDFC Balanced Fund - Dividend Option" },
{ "schemeCode": 100122, "schemeName": "HDFC Balanced Fund - Growth Option" }
]
NAV history
/api/v1/mf/{scheme_code}Returns metadata plus every stored NAV for the scheme, newest first.
| Parameter | Type | Description |
|---|---|---|
scheme_code | integer (path) | AMFI scheme code, e.g. 125497. |
startDate | string | Inclusive start date. Accepts YYYY-MM-DD or DD-MM-YYYY. |
endDate | string | Inclusive end date. |
curl "https://api.example.com/api/v1/mf/125497?startDate=2026-11-01&endDate=2026-11-20"
{
"meta": {
"fund_house": "SBI Mutual Fund",
"scheme_type": "Open Ended Schemes",
"scheme_category": "Equity Scheme - Small Cap Fund",
"scheme_code": 125497,
"scheme_name": "SBI Small Cap Fund - Direct Plan - Growth",
"isin_growth": "INF200K01T51",
"isin_div_reinvestment": null
},
"data": [
{ "date": "20-11-2026", "nav": "210.02130" },
{ "date": "19-11-2026", "nav": "209.92400" }
],
"status": "SUCCESS"
}
"data": [] and "status": "SUCCESS". An unknown
scheme code returns HTTP 404 with "status": "NOT_FOUND".
Latest NAV
/api/v1/mf/{scheme_code}/latestSame envelope as the history endpoint, but data contains exactly one observation.
curl "https://api.example.com/api/v1/mf/125497/latest"
{
"meta": {
"fund_house": "SBI Mutual Fund",
"scheme_type": "Open Ended Schemes",
"scheme_category": "Equity Scheme - Small Cap Fund",
"scheme_code": 125497,
"scheme_name": "SBI Small Cap Fund - Direct Plan - Growth",
"isin_growth": "INF200K01T51",
"isin_div_reinvestment": null
},
"data": [{ "date": "20-11-2026", "nav": "210.02130" }],
"status": "SUCCESS"
}
All latest NAVs
/api/v1/mf/latestOne row per scheme with the most recent stored NAV. Supports limit and offset; without a limit all schemes are returned.
curl "https://api.example.com/api/v1/mf/latest?limit=2"
[
{ "schemeCode": 100119, "schemeName": "Aditya Birla Sun Life Liquid Fund-Discipline Plan-Growth", "nav": "392.41800", "date": "20-11-2026" },
{ "schemeCode": 100121, "schemeName": "HDFC Balanced Fund - Dividend Option", "nav": "68.21400", "date": "20-11-2026" }
]
Scheme metadata
/api/v1/mf/{scheme_code}/metaReturns only the meta object for a scheme.
curl "https://api.example.com/api/v1/mf/125497/meta"
{
"fund_house": "SBI Mutual Fund",
"scheme_type": "Open Ended Schemes",
"scheme_category": "Equity Scheme - Small Cap Fund",
"scheme_code": 125497,
"scheme_name": "SBI Small Cap Fund - Direct Plan - Growth",
"isin_growth": "INF200K01T51",
"isin_div_reinvestment": null
}
Fund houses
/api/v1/fund-housesLists every AMC in the dataset with its scheme count.
curl "https://api.example.com/api/v1/fund-houses"
[
{ "fundHouse": "Aditya Birla Sun Life Mutual Fund", "schemeCount": 412 },
{ "fundHouse": "Axis Mutual Fund", "schemeCount": 388 }
]
/api/v1/fund-houses/{fund_house}/schemesLists schemes for one fund house. URL-encode spaces as %20.
curl "https://api.example.com/api/v1/fund-houses/SBI%20Mutual%20Fund/schemes"
Categories
/api/v1/categoriesLists scheme types and categories with scheme counts.
curl "https://api.example.com/api/v1/categories"
[
{
"schemeType": "Open Ended Schemes",
"schemeCategory": "Equity Scheme - Small Cap Fund",
"schemeCount": 42
}
]
Dataset statistics
/api/v1/statsFreshness and size information for the dataset.
curl "https://api.example.com/api/v1/stats"
{
"generated_at": "2026-11-21T09:50:21+00:00",
"latest_nav_date": "20-11-2026",
"earliest_nav_date": "2023-11-22",
"scheme_count": 14240,
"nav_rows": 7342190,
"fund_house_count": 55,
"category_count": 112,
"source": "AMFI India",
"source_url": "https://www.amfiindia.com/net-asset-value/nav-download",
"database_bytes": 412356608
}
Health
/api/v1/healthReturns HTTP 200 when the database is readable and contains NAV rows; HTTP 503 otherwise. Use it for uptime checks.
{
"status": "ok",
"database": "ok",
"latest_nav_date": "20-11-2026",
"last_sync": "2026-11-21T09:50:21+00:00",
"scheme_count": 14240
}
Response format
History responses always use the same envelope:
{
"meta": {
"fund_house": "string",
"scheme_type": "string",
"scheme_category": "string",
"scheme_code": 0,
"scheme_name": "string",
"isin_growth": "string | null",
"isin_div_reinvestment": "string | null"
},
"data": [
{ "date": "DD-MM-YYYY", "nav": "0.00000" }
],
"status": "SUCCESS"
}
List endpoints return a bare JSON array. All responses are UTF-8. Unknown fields should be ignored by clients to stay forward compatible.
Errors
| HTTP | Status | When |
|---|---|---|
| 400 | BAD_REQUEST | Invalid date or date range. |
| 404 | NOT_FOUND | Unknown scheme or fund house. |
| 422 | ERROR | Missing or malformed query parameter. |
| 429 | RATE_LIMITED | Client exceeded the rate limit. |
| 503 | UNAVAILABLE | Database is missing or still being built. |
{
"status": "NOT_FOUND",
"message": "Scheme 999999 not found"
}
Static JSON mode
The GitHub Actions workflow can publish the entire dataset as static JSON,
which works on GitHub Pages, S3, Netlify or any file host — no server
required. In this mode paths gain a .json suffix:
| Live API | Static file |
|---|---|
/api/v1/mf | /api/v1/mf.json |
/api/v1/mf/search?q= | Filter /api/v1/mf.json client-side |
/api/v1/mf/{code} | /api/v1/mf/{code}.json |
/api/v1/mf/{code}/latest | /api/v1/mf/{code}/latest.json |
/api/v1/mf/latest | /api/v1/mf/latest.json |
/api/v1/fund-houses | /api/v1/fund-houses.json |
/api/v1/categories | /api/v1/categories.json |
/api/v1/stats | /api/v1/stats.json |
/api/v1/nav/{date} | Not available (use per-scheme files) |
Static responses have the same shapes as the live API. The site detects static mode automatically and the explorer adapts its requests.
Self-hosting
Docker (recommended)
docker compose up -d --build
# API: http://localhost:8000/api/v1/mf
# Docs: http://localhost:8000/docs
# Swagger: http://localhost:8000/api/docs
On first start the container downloads the latest NAV file and a
configurable history window (default 365 days). The SQLite database lives
in the mfdata volume, so restarts are cheap.
Manual
python -m venv .venv
# Windows: .venv\Scripts\activate
source .venv/bin/activate
pip install -r requirements.txt
python -m pipeline sync --bootstrap-days 1095 # first run: ~3 years
python -m pipeline export --out public # optional static tree
python -m pipeline serve --port 8000
Configuration
| Variable | Default | Purpose |
|---|---|---|
MFDATA_DATA_DIR | ./data | Database and raw snapshot directory. |
MFDATA_DB | data/mfdata.db | Explicit SQLite path. |
MFDATA_BOOTSTRAP_DAYS | 1095 | History depth for a fresh database. |
MFDATA_INCREMENTAL_DAYS | 7 | Correction window on incremental runs. |
MFDATA_RATE_LIMIT | 120 | Requests per window; 0 disables limiting. |
MFDATA_RATE_WINDOW | 60 | Window length in seconds. |
MFDATA_CORS_ORIGINS | * | Comma-separated allowed origins. |
MFDATA_AUTO_SYNC | 1 | Docker: sync automatically when the DB is missing. |
Daily updates
The included .github/workflows/update-data.yml runs on a
schedule, restores the SQLite database from the Actions cache, syncs AMFI
data, exports static JSON and deploys GitHub Pages. Enable Pages with
Source: GitHub Actions in repository settings.
Data sources
- Latest NAVs: NAVAll.txt from AMFI India — one row per scheme for the latest published date.
- History: DownloadNAVHistoryReport_Po.aspx — historical NAV report, fetched in 30-day chunks.
- Reference: AMFI NAV download page.
AMFI is the official source for Indian mutual fund NAVs. Scheme names, categories, ISINs and NAVs are reproduced as published. The project is not affiliated with AMFI, SEBI or any asset management company.
FAQ
Is the API really free?
Yes. No key, no payment, no registration. The code is MIT licensed.
How fresh is the data?
The workflow runs twice daily and picks up the latest AMFI file. AMFI
normally publishes the previous trading day's NAV in the evening. Use
/stats or Status to see the exact
dataset date.
Why are some schemes missing NAVs for a date?
AMFI only publishes a NAV when the AMC reports one. Close-ended and interval schemes may not have daily NAVs. The history simply contains what AMFI published.
Can I use this commercially?
The API code is MIT licensed and free to use. NAV data remains subject to AMFI's and the AMCs' terms; verify redistribution requirements for your use case.
How deep is the history?
The default bootstrap is 1,095 days (three years), configurable with
--bootstrap-days. The store keeps every row it has seen, so
history grows over time.
Can I get data as CSV?
The API returns JSON. Converting a response to CSV is trivial in Python, pandas, Excel or Google Sheets. The raw AMFI feeds are semicolon-separated text if you prefer CSV.
What is the difference from mfapi.in?
MF Data API is an independent, self-hostable implementation with the same familiar URL shape, plus static JSON export, scheme metadata endpoints and a transparent ingestion pipeline you can run yourself.
License & attribution
The application code is released under the MIT License. NAV data is sourced from AMFI India and ultimately belongs to the respective asset management companies. Include a visible attribution to AMFI when redistributing the data.
Provided “as is”, without warranty of any kind. Verify NAVs against the official AMFI source before using them for financial decisions.
Changelog
1.0.0
- Initial release: scheme list, search, history, latest NAV and metadata endpoints.
- Reference endpoints for fund houses, categories and by-date NAVs.
- Daily AMFI ingestion pipeline with SQLite storage and static JSON export.
- GitHub Actions workflow, Docker image, documentation site and API explorer.