Mutual fund portfolio holdings by API
Every fund house publishes its portfolio each month. The holdings endpoint returns those disclosures as JSON: stock, sector, weight and quantity. This guide pulls two months for one fund and answers three questions: top holdings, sector mix, and what changed.
You need an API key: request a free beta key. Keep it in an environment variable, never in code you publish.
The request
GET /api/mf/holdings-history/scheme-code/{code}?startMonth=08-2026&endMonth=09-2026startMonth and endMonth are optional and use MM-YYYY. Months come newest first. Weights, quantities and market values are strings with fixed decimals so no precision is lost; convert them with float() for maths. See the reference.
Script
import os
import requests
import pandas as pd
BASE = os.environ.get("EJI_BASE", "https://fin.ejiapi.com")
HEADERS = {"x-api-key": os.environ.get("EJI_KEY", "YOUR_KEY")}
r = requests.get(f"{BASE}/api/mf/holdings-history/scheme-code/122639",
params={"startMonth": "08-2026", "endMonth": "09-2026"},
headers=HEADERS, timeout=60)
r.raise_for_status()
months = r.json()["data"]["holdingsHistory"] # newest month first
rows = []
for m in months:
for h in m["holdings"]:
rows.append({"asOf": m["holdingsAsOf"], "name": h["name"], "sector": h["sector"],
"category": h["category"], "weight": float(h["weightage"]), "nse": h["nseSymbol"]})
df = pd.DataFrame(rows)
latest = df[df["asOf"] == df["asOf"].max()]
print(latest.sort_values("weight", ascending=False).head(5)[["name", "sector", "weight"]].to_string(index=False))
print(latest.groupby("sector")["weight"].sum().sort_values(ascending=False).head(5).round(2))
# What changed between the two months
wide = df.pivot_table(index="name", columns="asOf", values="weight")
a, b = sorted(wide.columns)
wide["change"] = wide[b] - wide[a]
print(wide.sort_values("change").dropna(subset=["change"]).iloc[[0, -1]].round(2))Output
name sector weight
HDFC Bank Limited Banks 7.75
Power Grid Corporation of India Limited Power 5.60
ITC Limited Diversified FMCG 5.49
Coal India Limited Consumable Fuels 5.39
ICICI Bank Limited Banks 5.24
sector
Banks 20.48
IT - Software 9.39
Realty 8.72
Computer Software: Programming, Data Processing ## 7.12
Automobiles 6.35
Name: weight, dtype: float64
asOf 2026-08-31 2026-09-30 change
name
ICICI Bank Limited 5.67 5.24 -0.43
DLF Limited 0.64 2.45 1.81Reading it: the five biggest holdings, then the sector totals, then the biggest fall and biggest rise in weight between the two months. The last table shows only those two rows to keep it short.
Things to know
- Sector names come from each fund house's disclosure. Note "IT - Software" and "Computer Software: Programming, Data Processing ##" above: the same real-world sector under two labels. If you group by sector, normalise the labels first.
- Weights are percent of net assets, and the sector total only covers the holdings listed.
- Coverage grows over time. A fund without a loaded disclosure returns 404 "No holdings disclosure for this scheme", which is different from a wrong scheme code. The status page shows which fund houses and months are loaded.
nseSymbolis looked up from the holding's ISIN and is"-"for bonds and unlisted holdings.
Data comes from public disclosures and is for information, not investment advice. Sample outputs were produced on 2026-11-08 and change as new data is published.