Zerodha KiteConnect Utilize Free of Cost API to Automate Trades in Python

Zerodha KiteConnect Utilize Free of Cost API to Automate Trades:

Kite Connect is a set of REST-like HTTP APIs that expose many capabilities required to build a complete stock market investment and trading platform. It lets you execute orders in real time (equities, commodities, mutual funds), manage user portfolios, stream live market data over WebSockets, and more.

This module provides an easy to use abstraction over the HTTP APIs. The HTTP calls have been converted to methods and their JSON responses are returned as native Python structures, for example, dicts, lists, bools etc.

The login flow starts by navigating to the public Kite login endpoint.

https://kite.zerodha.com/connect/login?v=3&api_key=xxx

Follow the Above Video for Instructions then go for the Code Input:


from kiteconnect import KiteConnect

api_key=open('api_key.txt','r').read().strip()
api_secret=open('api_secret.txt','r').read().strip()

kite = KiteConnect(api_key=api_key)

access_token=kite.generate_session("your_request_token_here", api_secret=api_secret)

print(access_token['access_token'])