Skip to content

dhan historical

Read historical candles from Dhan. Requires a Dhan Data API subscription (the same data subscription as quote).

Subcommand Dhan endpoint Purpose Flags
dhan historical daily POST charts/historical Daily candles. --file or --security-id + --exchange-segment + --instrument + --from + --to
dhan historical intraday POST charts/intraday Intraday candles. Above plus --interval (1/5/15/30/60)
dhan historical rolling-options --file <json> POST charts/rollingoption Read expired rolling option data. --file (req)

Use --file <json> for the API-shaped request body, or the explicit flags. For daily and intraday, one of those two sources must be supplied; both modes are equivalent — the flags are conveniences that build the JSON body.

Terminal window
# Daily candles via explicit flags
dhan historical daily \
--security-id 1333 \
--exchange-segment NSE_EQ \
--instrument EQUITY \
--from 2026-01-01 \
--to 2026-01-02 \
--json --no-color
# Intraday candles — 5-minute interval
dhan historical intraday \
--security-id 1333 \
--exchange-segment NSE_EQ \
--instrument EQUITY \
--interval 5 \
--from 2026-01-01 \
--to 2026-01-02 \
--json --no-color
# Rolling option data
dhan historical rolling-options --file rolling.json --json --no-color