I am developing a Java Desktop Program(No UI). I have few questions: 1. Whenever I run my app, I manually go to https://kite.trade/connect/login?api_key=xyz and get the request token everytime. I don't think I am doing it correctly, because its a tedious task to fetch it everytime I run it. How to reuse the tokens or is there any better way of doing it? 2. I want to reuse the token so that I watch an FnO instrument ticker at an interval of 5 sec. 3. How frequently the instrument Id changes?
Hi @sashiks1009, All Kite Connect API calls are authenticated using access_token. The access_token is valid for one whole day whereas request token is valid for one time and valid for a couple of minutes. Once you get the access token, store it in preference or database and reuse it in next run. Just don't call requestAccessToken mentioned here in subsequent runs. Instrument dump is updated every day. It is better to sync it with the server every day once. Instrument token for an instrument will change rarely for equity instruments but the dump is updated every day.
All Kite Connect API calls are authenticated using access_token.
The access_token is valid for one whole day whereas request token is valid for one time and valid for a couple of minutes. Once you get the access token, store it in preference or database and reuse it in next run.
Just don't call
requestAccessToken
mentioned here in subsequent runs.Instrument dump is updated every day. It is better to sync it with the server every day once.
Instrument token for an instrument will change rarely for equity instruments but the dump is updated every day.