So I am writing a script to get financial data and I am using a broker's API. The flow goes like this. the user has to login and then it is redirected to the redirect_url where it also contains the request_token in the redirect_url. I want to extract this token from the redirect_url but the URL from requests.get is not the same as the redirect URL.
Any suggestions would be welcome.
import requests
r = requests.get(kite.login_url())
print(r.url)
This is the current code that I am using. kite is the broker's API object. Eventually I want to create a dashboard using plotly dash so if there is any solution using that also would be great.
I am using the Zerodha Kite Connect API and I have set the redirect URL to https://127.0.0.1
When I try to get r.url I get the following response:
https://kite.zerodha.com/connect/login?api_key={myapikey}&sess_id={somesessionid}
and not
https://127.0.0.1/?request_token={request_toke}&action=login&status=success
which I get when I click on the above link