To generate the access token, you need to copy the request token from the redirect URL and use it to generate the session. Please note that the access token is valid for one day, and you can use it for all API requests throughout that day. A request token, however, is valid for only a few minutes and can be used just once. Ensure that you do not request a new access token for every run. Once you have generated the access token, store it in a file or app preferences for reuse.
We recommend following the login flow as outlined in the Kite Connect API documentation. Additionally, you can refer to this webinar for a detailed walkthrough.
Additionally, you may explore our QuantInsti course on Algorithmic Trading with Zerodha Kite Connect API and Python.
@DM2290, The api_key in the login URL must correspond to the same Kite Connect app whose credentials are being used by the algo. If the API key in the URL differs from the one configured in the algo, the resulting authentication/session can belong to a different app.
We recommend following the login flow as outlined in the Kite Connect API documentation. Additionally, you can refer to this webinar for a detailed walkthrough.
Additionally, you may explore our QuantInsti course on Algorithmic Trading with Zerodha Kite Connect API and Python.
api_keyin the login URL must correspond to the same Kite Connect app whose credentials are being used by the algo. If the API key in the URL differs from the one configured in the algo, the resulting authentication/session can belong to a different app.