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.

[Open in ChatGPT (opens in a new tab)](https://chatgpt.com/plugins/plugin_asdk_app_6aded6de90f081918717da5227322e16) [Open in Claude (opens in a new tab)](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=DalalOS&connectorUrl=https%3A%2F%2Fmcp.dalalos.in%2Fmcp) [Other AI apps](https://dalalos.in/connect)

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

| Route | Best for | Limits |
| --- | --- | --- |
| Exchange website download | One stock, one time | One stock at a time; raw prices; check the date-range limit on the site |
| Excel Power Query on an API | A sheet that refreshes | Your key sits in the workbook, so do not share the file |
| Python script to CSV | Many symbols, repeat runs | Up 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](https://www.nseindia.com/) and [BSE](https://www.bseindia.com/) sites. For every stock on one day, use the daily bhavcopy file; see [NSE bhavcopy in Python](https://dalalos.in/guides/nse-bhavcopy-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](https://dalalos.in/docs/display-rights). We did not test other Excel versions.

## Route 3: Python to CSV

Create a key at [/dashboard/keys](https://dalalos.in/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](https://dalalos.in/docs/python-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).

| Series | Close | Adjustment |
| --- | --- | --- |
| Raw (adjusted=false) | 2,018.2 | None |
| Adjusted (adjusted=true) | 1,009.1 | Bonus, 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.

| Provider and plan | Price a month | Calls included | Price per call | Per 1,000 calls | Notes |
| --- | --- | --- | --- | --- | --- |
| DalalOS Plus | ₹199 | 500 REST credits | **₹0.398** | ₹398 | REST and MCP. Yearly billing lowers the price further. |
| DalalOS Pro | ₹699 | 20,000 REST credits | **₹0.0350** | ₹34.95 | REST and MCP. Yearly billing lowers the price further. |
| DalalOS Business | ₹2,499 | 1,50,000 REST credits | **₹0.0167** | ₹16.66 | REST and MCP, named contact. Yearly billing lowers the price further. |
| DalalOS Business+ | ₹4,999 | 4,00,000 REST credits | **₹0.0125** | ₹12.50 | REST and MCP, named contact. Yearly billing lowers the price further. |

DalalOS prices are read from our live plan catalog and include taxes; see [pricing](https://dalalos.in/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+

| Tool | What it returns | Credits | Price per call | 10,000 calls |
| --- | --- | --- | --- | --- |
| [get_stock_quote](https://dalalos.in/tools/get-stock-quote) | Latest end-of-day quote for one company | 1 | ₹0.0125 | ₹125 |
| [get_financials](https://dalalos.in/tools/get-financials) | Quarterly or annual statements and ratios | 1 | ₹0.0125 | ₹125 |
| [get_shareholding](https://dalalos.in/tools/get-shareholding) | Shareholding pattern by quarter | 1 | ₹0.0125 | ₹125 |
| [get_price_history](https://dalalos.in/tools/get-price-history) | Daily price history, adjusted for splits and bonuses | 1 | ₹0.0125 | ₹125 |
| [screen_stocks](https://dalalos.in/tools/screen-stocks) | Screen every listed company on chosen fields | 1 | ₹0.0125 | ₹125 |
| [get_stock_events](https://dalalos.in/tools/get-stock-events) | A company's BSE announcements | 1 | ₹0.0125 | ₹125 |
| [get_filing_extract](https://dalalos.in/tools/get-filing-extract) | Facts read from one filing (beta) | 1 | ₹0.0125 | ₹125 |
| [get_market_fii_dii_flow](https://dalalos.in/tools/get-market-fii-dii-flow) | Daily FII and DII flows | 1 | ₹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](https://dalalos.in/data-api/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: 6 December 2026. 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.

[Open in ChatGPT (opens in a new tab)](https://chatgpt.com/plugins/plugin_asdk_app_6aded6de90f081918717da5227322e16) [Open in Claude (opens in a new tab)](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=DalalOS&connectorUrl=https%3A%2F%2Fmcp.dalalos.in%2Fmcp) [Other AI apps](https://dalalos.in/connect)

[Already connected? Open your dashboard](https://dalalos.in/dashboard)

KEEP EXPLORING

- [Clean, adjusted NSE and BSE data](https://dalalos.in/data-api/clean-adjusted-data)
- [Stock price data API](https://dalalos.in/data-api/stock-price-data)
- [Python REST quickstart](https://dalalos.in/docs/python-quickstart)
- [NSE bhavcopy in Python](https://dalalos.in/guides/nse-bhavcopy-python)
- [What you can display](https://dalalos.in/docs/display-rights)
- [Free Indian stock market API](https://dalalos.in/guides/free-indian-stock-market-api)
- [Back to home](https://dalalos.in/)