How to Use

Everything you need to download Dhan historical market data with this portal.

1. Getting Started

This portal is a free tool that lets you download historical market data from Dhan brokerage in CSV format: expired NIFTY/SENSEX options (with OI, IV, volume), NIFTY index futures with automatic contract rollover, and equity historical data in bulk.

Prerequisites: an active Dhan trading account (free), Dhan API access enabled, and your Dhan access token. Don't have an account? Open a free Dhan account.

2. How to Get Your Dhan Access Token

  1. Log in to your Dhan account at web.dhan.co.
  2. Navigate to the API section in your profile menu.
  3. Generate a new access token (typically expires daily).
  4. Copy the token and paste it into the "Access Token" field in this portal.
  5. Keep your token secure — never share it publicly.

3. Tab 1 — Expired Options Tutorial

Note: Option data is available for ATM ± 10 strikes only. This API gives you expired options contract data. We have pre-processed data for you to get it on a rolling basis — you can fetch last 5 years of strike-wise data based on ATM and up to 10 strikes above and below. In addition to that, the data values are open, high, low, close, implied volatility, volume, open interest and spot information as well.

  1. Choose Index: NIFTY or SENSEX.
  2. Enter Credentials: paste your access token.
  3. Date Range: from/to dates. The portal splits into 29-day chunks automatically.
  4. Interval: 1/5/15/25/60 min.
  5. Expiry Type: WEEK or MONTH.
  6. Option Type: CALL, PUT, or BOTH.
  7. Start Download and watch the progress panel.

Output: one CSV per trading date with all selected strikes and option types combined. Columns: datetime, strike_label, option_type, open, high, low, close, volume, oi, iv, strike_price, spot.

4. Tab 2 — Index Futures Tutorial

  1. Download Scrip Master: get api-scrip-master-detailed.csv from Dhan API docs.
  2. Upload the CSV. The portal auto-detects NIFTY futures contracts.
  3. Date Range + Time Frame (Daily for EOD, or intraday).
  4. Start Download.

Rollover logic: for each calendar date, the portal picks the contract with the earliest expiry on or after that date (front-month rolling). Output CSVs include contract_expiry, contract_name, and security_idso you can audit which contract each row came from.

5. Tab 3 — Equity Bulk Tutorial

Prepare a CSV with at least a SECURITY_ID column. Example:

SECURITY_ID,UNDERLYING_SYMBOL
2885,RELIANCE
1333,HDFCBANK
11536,TCS

Upload the CSV, set date range and time frame, then click Start. One CSV is written per symbol — filename like RELIANCE_2885_5m.csv.

6. Understanding Dhan API Limits

  • Intraday calls: max 90 days per request (handled automatically).
  • Daily calls: up to 365 days per request.
  • Rate limits apply — the portal makes sequential calls to stay safe.
  • Access tokens expire daily — regenerate each trading day.

7. Troubleshooting

  • "Access token is required": paste your token; it's case-sensitive.
  • HTTP 401 / unauthorized: token expired or invalid — regenerate.
  • HTTP 429 / rate limit: wait 30 seconds and try again.
  • "No contract covers these dates" (futures): your scrip master is too old — download a fresh one.
  • Empty CSVs: check the date range falls on trading days and the expiry/strike actually traded.

8. API Reference Links

9. Privacy and Security

  • Your access token is forwarded only to the Dhan API; never stored.
  • CSVs are generated client-side and downloaded as a ZIP.
  • Tokens are masked in the UI and not logged.
Questions or feedback? Contact us at tradewithkiru@gmail.com