Skip to content

dhan quote

Read live market quotes. Requires a separately-subscribed Dhan Data API — without it the underlying endpoints return a permission error.

Uses numeric security IDs (from dhan instruments search), not exchange-prefixed symbols. The internal body shape is {"<segment>": [<id>, ...]}.

Each subcommand supports --file <json> (overrides args), --segment (default NSE_EQ), and zero-or-more positional security-id integers.

Subcommand Dhan endpoint Purpose
dhan quote ltp --segment <seg> <id>... POST marketfeed/ltp Last traded prices.
dhan quote ohlc --segment <seg> <id>... POST marketfeed/ohlc LTP and OHLC.
dhan quote full --segment <seg> <id>... POST marketfeed/quote Full quote and market depth.
Terminal window
# By positional IDs
dhan quote ltp --segment NSE_EQ 1333 --json --no-color
dhan quote full --segment NSE_FNO 49081 1333 --json --no-color
# By file (overrides the positional IDs)
dhan quote ohlc --file quote.json --json --no-color

The --file <json> shape:

{
"NSE_EQ": [1333, 11536],
"NSE_FNO": [49081]
}