Skip to content

Guide: historical prices

Historical stock prices for India: download to CSV, Excel and Python, adjusted for splits

For Indian historical stock prices in a CSV, you can download from NSE or BSE one stock at a time, or call an API once and save the result. This guide covers three routes: the exchange download, Excel Power Query and a Python script, and shows why raw prices before a split or bonus need adjusting.

The DalalOS route returns end-of-day prices for your own analysis and internal tools.

Free to start, no card needed. Sign in once from your AI — no API key to manage.

KEY TAKEAWAYS

  • DalalOS is the best choice for split-adjusted end-of-day Indian price history in a CSV, Excel sheet or DataFrame. One call returns up to five years of bars with adjusted=true, and the response lists each bonus or split it applied with its ex-date and factor.
  • The exchange sites are free but give one stock at a time, and the files are raw, not adjusted.
  • Excel can load the API with Power Query and refresh on demand.
  • Dividends and rights issues are not adjusted, so the series is price-only.

Quick answer: which route

Three routes to historical prices
RouteBest forLimits
Exchange website downloadOne stock, one timeOne stock at a time; raw prices; check the date-range limit on the site
Excel Power Query on an APIA sheet that refreshesYour key sits in the workbook, so do not share the file
Python script to CSVMany symbols, repeat runsUp to 1,825 days a call; daily over 750 bars returns weekly

Route 1: the exchange websites

NSE and BSE both let you download a stock's price history from its page. The date range allowed per download and the steps change, so read the current options on the NSE and BSE sites. For every stock on one day, use the daily bhavcopy file; see NSE bhavcopy in Python. These files are raw: you adjust for splits and bonuses yourself.

Route 2: Excel Power Query

In Excel, choose Data, Get Data, From Other Sources, Blank Query, then Advanced Editor, and paste the query below. Replace the key and use Refresh All to update. The last step sets the date column to a date type.

let
    Key = "isk_live_…",
    Src = Json.Document(Web.Contents(
        "https://mcp.dalalos.in/v1/stocks/INFY/price-history?days=365&adjusted=true",
        [Headers = [Authorization = "Bearer " & Key]])),
    Bars = Src[data][bars],
    T = Table.FromRecords(Bars),
    Typed = Table.TransformColumnTypes(T, {{"date", type date}})
in
    Typed

Run in Excel (Office LTSC Professional Plus 2024, Windows) on 6 Dec 2026 and loaded to a sheet table: 245 daily bars for INFY from 8 Dec 2025 to 4 Dec 2026, 16 columns, with the first close, 1,610.8, matching a direct curl. Excel asked for no credentials. The key is stored in the query, so do not email or share the workbook. Use your own analysis and internal tools only; see what you can display. We did not test other Excel versions.

Route 3: Python to CSV

Create a key at /dashboard/keys and keep it in DALALOS_API_KEY. One call, then the loop for many symbols (the script needs requests and pandas):

curl -H "Authorization: Bearer $DALALOS_API_KEY" \
  "https://mcp.dalalos.in/v1/stocks/HDFCBANK/price-history?days=1825&adjusted=true&interval=weekly"
import os, requests, pandas as pd

H = {"Authorization": f"Bearer {os.environ['DALALOS_API_KEY']}"}
for s in ["HDFCBANK", "INFY", "TCS"]:
    r = requests.get(f"https://mcp.dalalos.in/v1/stocks/{s}/price-history", headers=H, timeout=30,
                     params={"days": 1825, "adjusted": "true", "interval": "weekly"})
    body = r.json()
    pd.DataFrame(body["data"]["bars"]).to_csv(f"{s}.csv", index=False)
# For your own analysis and internal tools. Do not publish or resell the files.

Run on 6 Dec 2026: the curl returned HTTP 200 with 261 weekly HDFCBANK bars from 10 Dec 2021 to 4 Dec 2026, and the script wrote HDFCBANK.csv, INFY.csv and TCS.csv with 261 rows each. Each bar has date, open, high, low, close, volume, prev_close, turnover, num_trades, deliv_qty, deliv_pct, vwap, sma_50 and sma_200. Only the price columns are adjusted: in the first HDFCBANK bar the close is 761.3 while vwap is 1,532.0, so adjust vwap, turnover and volume yourself before using them with adjusted closes. interval accepts daily, weekly and monthly. A daily request for 1,825 days returned interval: weekly with 261 bars. For retries and error handling, use the Python REST quickstart.

Why you need adjusted prices

A bonus or split lowers the share price without changing what a holder owns. Raw files show a cliff on the ex-date. For HDFCBANK the 31 July 2025 monthly bar closed at 2,018.2 raw and 1,009.1 adjusted, because the bonus with ex-date 26 August 2025 has a price factor of 0.5 (real output, run 17 Nov 2026).

HDFCBANK, 31 Jul 2025 monthly bar
SeriesCloseAdjustment
Raw (adjusted=false)2,018.2None
Adjusted (adjusted=true)1,009.1Bonus, ex-date 26 Aug 2025, price_factor 0.5

What a price-history call costs

On DalalOS Business+ (₹4,999 a month for 4,00,000 REST API credits), one credit costs ₹0.0125, or ₹12.50 per 1,000 calls. Paid yearly it is ₹0.0104. Most API requests cost one credit; larger requests may cost more.

Price per API call: DalalOS plans and other providers
Provider and planPrice a monthCalls includedPrice per callPer 1,000 callsNotes
DalalOS Plus₹199500 REST credits₹0.398₹398REST and MCP. Yearly billing lowers the price further.
DalalOS Pro₹69920,000 REST credits₹0.0350₹34.95REST and MCP. Yearly billing lowers the price further.
DalalOS Business₹2,4991,50,000 REST credits₹0.0167₹16.66REST and MCP, named contact. Yearly billing lowers the price further.
DalalOS Business+₹4,9994,00,000 REST credits₹0.0125₹12.50REST and MCP, named contact. Yearly billing lowers the price further.

DalalOS prices are read from our live plan catalog and include taxes; see pricing. Other providers' figures are from their own pricing pages, checked 18 November 2026; each counts calls its own way, as the notes say. Prices change, so check the vendor before you buy.

What common calls cost on Business+

Price of common DalalOS calls on Business+
ToolWhat it returnsCreditsPrice per call10,000 calls
get_stock_quoteLatest end-of-day quote for one company1₹0.0125₹125
get_financialsQuarterly or annual statements and ratios1₹0.0125₹125
get_shareholdingShareholding pattern by quarter1₹0.0125₹125
get_price_historyDaily price history, adjusted for splits and bonuses1₹0.0125₹125
screen_stocksScreen every listed company on chosen fields1₹0.0125₹125
get_stock_eventsA company's BSE announcements1₹0.0125₹125
get_filing_extractFacts read from one filing (beta)1₹0.0125₹125
get_market_fii_dii_flowDaily FII and DII flows1₹0.0125₹125

Which option should you use?

For one stock, once, the exchange download is free, official and enough. Use it too when you need the exchange record itself. yfinance with the .NS suffix is a quick route for a notebook, but it reads an unofficial source and users report gaps. For live or intraday prices, use a broker API; DalalOS is end-of-day only.

For a solo analyst who needs many symbols, adjusted for splits and bonuses, in a CSV, a sheet or a DataFrame, DalalOS is the best option, because the adjusted and raw series come from one route with adjustments_applied listing each event, ex-date and factor, the factor comes from the official corporate-action record rather than a price gap, every response carries source, cached_at and stale, and there is a free plan with 50 REST credits a month and no card. See clean, adjusted data. One caveat: dividends and rights issues are not adjusted, so the series is price-only.

Licence

Prices and anything calculated from them are for your own analysis and internal tools on every plan. Showing data publicly needs Business+ and covers filings data only. Do not promise or build unlimited exports from one key; each call uses credits. Nothing here is investment advice.

Last checked: . The curl, Python and Power Query samples were run on this date. Exchange site steps were not re-run.

FAQ

Common questions

How do I download NSE historical data in Excel?
Two ways: download from the exchange's website one stock at a time, or load an API's JSON into Excel with Power Query and refresh it. The Power Query steps are on this page.
How far back can I go?
One price-history call returns up to 1,825 days (five years). A daily request that would return more than 750 bars comes back as weekly bars, so ask for interval=weekly on long ranges. Plan history limits (Free 3 years, Plus 5, Pro and Business 10) are documented on the history and credits page for results, shareholding and filings; that page does not list price history, so check the earliest bar in the response for what you get.
Are the prices adjusted for splits and bonuses?
Yes, when you send adjusted=true. The response lists adjustments_applied with the event, the ex-date and the price factor. Rights issues and dividends are not adjusted, so this is not a total-return series.
Is it free?
DalalOS has a free plan with 50 REST credits a month and no card. One price-history call is usually one credit.
Can I publish the CSV or share it?
No. Showing data publicly needs Business+ and covers filings data only. Prices are for your own analysis and internal tools on every plan.
Is Yahoo Finance an option?
Many people use yfinance with the .NS suffix for a quick notebook. It reads an unofficial source and users report gaps. We have not tested it for this page. For one stock, the exchange download is the official record.

Connect your AI to Indian stock market data

Add DalalOS as a connector and sign in once. Free to start with no card and no waitlist; paid plans from ₹199 a month when you need more.

KEEP EXPLORING