Market Data & Web Scraping
Beginner
Fetch Daily Indian Mutual Fund NAVs from AMFI Portal to CSV in Python
Download and parse the official AMFI India daily Mutual Fund NAV text feed into a clean Pandas DataFrame and CSV file in Python.
#requests#pandas
Problem Statement
Wealth managers and SIP trackers need daily updated Net Asset Values (NAVs) across all Direct and Regular mutual fund schemes in India without scraping complex websites.
Formula / Core Logic
Parses the semicolon-delimited official AMFI endpoint `https://www.amfiindia.com/spages/NAVAll.txt`.
Installation
pip install requests pandas
amfi-india-mutual-fund-nav-historical-fetcher-python.py
import pandas as pd
def fetch_amfi_all_nav(output_csv='amfi_nav_latest.csv'):
url = 'https://www.amfiindia.com/spages/NAVAll.txt'
df = pd.read_csv(url, sep=';', on_bad_lines='skip')
df = df.dropna(subset=['Scheme Code', 'Net Asset Value'])
df['Net Asset Value'] = pd.to_numeric(df['Net Asset Value'], errors='coerce')
df = df.dropna(subset=['Net Asset Value'])
df.to_csv(output_csv, index=False)
return df[['Scheme Code', 'ISIN Div Payout/ ISIN Growth', 'Scheme Name', 'Net Asset Value', 'Date']]
Get the Complete 100+ Python Quant & Automation Bundle
Instant lifetime access to all production-ready scripts, valuation models, and trading bots ($19).
Buy Full Bundle on Gumroad ($19) →Frequently Asked Questions
Q: What time does AMFI update the NAVAll.txt file daily?
AMFI updates equity and debt mutual fund NAVs between 9:00 PM and 11:00 PM IST on every business day.