Documentation · v1.0.0

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 formatapplication/json; charset=utf-8
MethodsGET, HEAD, OPTIONS
Compressiongzip when the client sends Accept-Encoding: gzip
CORSOpen 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.

If you expose this API publicly, keep the default rate limit enabled and put it behind a CDN or reverse proxy for production traffic.

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 HTTP 429.
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:

  1. Downloads NAVAll.txt (latest NAVs for every scheme).
  2. Downloads historical reports for the recent window, filling gaps and corrections.
  3. Upserts rows into SQLite, refreshes latest-NAV columns and dataset stats.
  4. 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

GET/api/v1/mf

Returns the scheme master list. Without limit every scheme is returned (roughly 14,000 rows).

ParameterTypeDescription
limitintegerPage size, 1–50,000. Omit for all rows.
offsetintegerRows to skip. Default 0.
qstringOptional case-insensitive name filter.
fund_housestringExact fund house name, e.g. SBI Mutual Fund.
categorystringExact 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" }
]

NAV history

GET/api/v1/mf/{scheme_code}

Returns metadata plus every stored NAV for the scheme, newest first.

ParameterTypeDescription
scheme_codeinteger (path)AMFI scheme code, e.g. 125497.
startDatestringInclusive start date. Accepts YYYY-MM-DD or DD-MM-YYYY.
endDatestringInclusive 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"
}
A valid scheme with no observations in the requested window returns "data": [] and "status": "SUCCESS". An unknown scheme code returns HTTP 404 with "status": "NOT_FOUND".

Latest NAV

GET/api/v1/mf/{scheme_code}/latest

Same 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

GET/api/v1/mf/latest

One 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

GET/api/v1/mf/{scheme_code}/meta

Returns 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

GET/api/v1/fund-houses

Lists 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 }
]
GET/api/v1/fund-houses/{fund_house}/schemes

Lists schemes for one fund house. URL-encode spaces as %20.

curl "https://api.example.com/api/v1/fund-houses/SBI%20Mutual%20Fund/schemes"

Categories

GET/api/v1/categories

Lists 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
  }
]

NAVs by date

GET/api/v1/nav/{date}

Returns NAVs published on a single date. Paginate with limit (default 100, max 5,000) and offset.

curl "https://api.example.com/api/v1/nav/20-11-2026?limit=2"
{
  "date": "20-11-2026",
  "data": [
    { "schemeCode": 100119, "schemeName": "Aditya Birla Sun Life Liquid Fund-Discipline Plan-Growth", "nav": "392.41800", "date": "20-11-2026" }
  ]
}
This endpoint requires the live API. Static JSON deployments do not include a per-date index; use the per-scheme files instead.

Dataset statistics

GET/api/v1/stats

Freshness 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

GET/api/v1/health

Returns 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

HTTPStatusWhen
400BAD_REQUESTInvalid date or date range.
404NOT_FOUNDUnknown scheme or fund house.
422ERRORMissing or malformed query parameter.
429RATE_LIMITEDClient exceeded the rate limit.
503UNAVAILABLEDatabase 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 APIStatic 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

VariableDefaultPurpose
MFDATA_DATA_DIR./dataDatabase and raw snapshot directory.
MFDATA_DBdata/mfdata.dbExplicit SQLite path.
MFDATA_BOOTSTRAP_DAYS1095History depth for a fresh database.
MFDATA_INCREMENTAL_DAYS7Correction window on incremental runs.
MFDATA_RATE_LIMIT120Requests per window; 0 disables limiting.
MFDATA_RATE_WINDOW60Window length in seconds.
MFDATA_CORS_ORIGINS*Comma-separated allowed origins.
MFDATA_AUTO_SYNC1Docker: 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.

A full backfill downloads several hundred megabytes from AMFI and can take a while. The workflow caches the database between runs; only the recent window is downloaded on subsequent runs.

Data sources

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.