Skip to content

dhan option-chain

Fetch option-chain data. Requires a separately-subscribed Dhan Data API. Both subcommands auto-inject dhanClientId into the request body if it isn’t already present.

Subcommand Dhan endpoint Purpose Flags
dhan option-chain expiry-list --file <json> POST optionchain/expirylist Fetch available expiry dates. --file (req)
dhan option-chain get --file <json> POST optionchain Fetch an option chain. --file (req)
Terminal window
dhan option-chain expiry-list --file params.json --json --no-color
dhan option-chain get --file params.json --json --no-color

The --file <json> payload shape matches DhanHQ v2 optionchain — see Dhan’s API docs for the field set.