What is "exchange_segment" code while fetching live market data?

Hello,
I was trying to add instruments to get Live Market Data. After reading the README on DhanHQ-py - GitHub, I came across instruments and “exchange_segment”.

# Structure for subscribing is ("exchange_segment","security_id")

I do not understand how NSE/BSE (or other) are mapped to 1,0 etc.

Please suggest how can I get a mapping of “exchange_segment”. Thanks in advance!

Hello @lalitnmudgal

Welcome to Dhan Community!

Sure, you can refer to values of exchange_segment in the documentation here: Annexure - DhanHQ Ver 1.0 / API Document

1 Like