Query on instrument_token

mld
Hi Team,

I am using pykiteconnect 3.7.0.b6

instruments = kite.instruments() returns a list of dictionaries with the following fields:
`instrument_type`,`tick_size`,`name`,`exchange`,`last_price`,`expiry`,`tradingsymbol`,`lot_size`,`instrument_token`,`strike`,`segment`,`exchange_token`

Now my question is: whether the `instrument_token` is unique in kiteconnect database (zerodha server) for lifetime or (for example on expiry) is assigned to a new ticker?
in case if the `instrument_token` is never assigned to a new ticker then I will use it as the primary key.

  • sujith
    It will be unique but the instrument token can change next day or next month or next year or anytime. The instrument token is available in instrument dump and it is generated once in a day.
    I would suggest using a combination of exchange:tradingsymbol as the key.
  • mld
    @sujith: Thanks for the quick reply.
This discussion has been closed.