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-2026

startMonth 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.81

Reading 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

Get a free API key All guides

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.