Can someone please guide to the exact process to start trading using Python language? I have a zerodha account. How do I get the API key and other stuff. What all is required on my part?
Few more questions : 1) What should I choose in the Type option while creating an App? 2) Redirect URL - What is this for and how do I create a https url for myself?
1) If you want to use the complete APIs, choose Kite Connect. Publisher is only for embedding buttons on webpages.
2) After the login prompt (like Facebook or Gmail logins), the API will redirect to this url you register. You'll have to have a domain name where you are running your Python web app.
"how do I create a https url for myself" -- I am afraid this question falls outside the scope of the API. Please look into Python web development and installing SSL certificates (https) on your apps.
Ah, if that's the case, you can set the redirect url to `https://127.0.0.1` (your localhost). When the login is done and the redirect happens, you can copy the request_token from the redirect url.
Then, you'll use the pykiteconnect library in your Python code to get the access token and place orders. Please refer to the documentation -- https://github.com/rainmattertech/pykiteconnect
Thanks for your quick replies Kailash. Appreciate. Is there a way to automate the copying of the request_token from the redirect url straight into the pykiteconnect? and can the trades be place automatically without any manual intervention? And how will my fund from the account be debited when I place the trades? will it be through the api_key and the access_token?
1) Yes. You can setup a standalone Python webserver on 127.0.0.1 to which the redirect happens. This app can capture token_request from the URL parameters and pass to your app.
2) Trades can be placed completely programmatically.
3) Funds are debited just as they would be if you were trading using the trading terminal at Zerodha. You login to the API using a Zerodha client id, and everything happens under this client it.
Use the Kite Connect Python client in your Python app -- https://github.com/rainmattertech/pykiteconnect
Read the Kite Connect documentation to get the complete picture -- https://kite.trade/docs/connect/v1/
2) After the login prompt (like Facebook or Gmail logins), the API will redirect to this url you register. You'll have to have a domain name where you are running your Python web app.
"how do I create a https url for myself" -- I am afraid this question falls outside the scope of the API. Please look into Python web development and installing SSL certificates (https) on your apps.
Then, you'll use the pykiteconnect library in your Python code to get the access token and place orders. Please refer to the documentation -- https://github.com/rainmattertech/pykiteconnect
2) Trades can be placed completely programmatically.
3) Funds are debited just as they would be if you were trading using the trading terminal at Zerodha. You login to the API using a Zerodha client id, and everything happens under this client it.