Breeze API: Checksum Computation & Login
1. App Registration (OAuth 2.0)
Authentication follows the OAuth 2.0 protocol to ensure all request fields are protected from tampering.
To register an app on the Breeze API portal, provide the following:
- App Name
- Redirect URL:
https://127.0.0.1
After successful registration, you will receive a unique pair of keys:
- App Key: The unique identity of your application within the API system.
- Secret Key: Used to encrypt messages sent from your client to the API.
2. Required Request Parameters
Every API request must include the following components:
- App Key
- Secret Key
- Session Token
3. Login Flow
Initiate the login process by navigating to the login URL with your URL-encoded App Key:
https://api.icicidirect.com/apiuser/login?api_key=Your_AppKey
- Upon successful login, retrieve the
API_Sessionvalue displayed in your browser's address bar. - Pass this
API_Sessionvalue under the keySessionTokenin the CustomerDetails API. - The API will respond with a
session_token. - Use this
session_tokenas theSessionTokento authenticate all subsequent API requests.
Setup and Installation
Open your terminal or command prompt.
Type pip install breeze-connect to get the official Python SDK.
Open your Python editor or Jupyter Notebook
Get the token from the redirect url as this https://www.profitaddaweb.com/?apisession=your_session_token then paste that token in the given below code with api key, secret and generating session token then go with order placement and queries you prefer.
Video Tutorial
For a visual walkthrough of the process, refer to the official YouTube tutorial:
from breeze_connect import BreezeConnect
import dbm
db=dbm.open('config','r')
api_key=db['api_key'].decode()
api_secret=db['api_secret'].decode()
breeze=BreezeConnect(api_key=api_key)
breeze.generate_session(api_secret=api_secret,session_token='your_session_token')
print(breeze.get_demat_holdings())