Introduction to Trading APIs and How to start using Breeze API
Suppose you have worked out a trading strategy which you believe should make good profits in the market. But before you run it in real time, wouldn’t you like to see all the unusual scenarios wherein your strategy might act up? This is typical of any critical product/process, which is tested under multiple scenarios to check the robustness of the system. Same applies to the universe of algorithmic trading.
What is a Trading API?
API i.e. Application Programming interface, is a software intermediary that allows two applications to talk to each other. In the case of a typical Trading API, on one end would be an application of your market broker (ICICI Securities for example) and on the other end would be your code or application.
Trading APIs allow you to get live market prices, execute orders in real time, and help manage your orders and positions. There are numerous ways a Trading API can help you better your trading experience in not just stock markets, but other markets like commodities or forex as well.
Who is it for?
Built especially for market participants with technical knowledge looking for personalised trading experience using innovative logic, Trading APIs can help one build a complete investment and trading platform in no time.
Start using Breeze API
Following are the steps you can follow to start using Breeze API:
- Click on the link https://api.icicidirect.com/apiuser/home which will direct you to the login page of Breeze API.
- Login using your ICICIdirect account credentials.
Note: while www.icicidirect.com allows you to enter case-insensitive username (i.e. “Ramesh” can also be spelled “RAMESH” or “ramesh"), on this login you must use case sensitive username (i.e. “RAMESH” and “ramesh" will give an “Invalid username or password” error.)
- After you have successfully logged in, click on the tab ‘Register an App’. You should see the following page:
- Write the name you want to give your App (for example: my_breeze) and create a Redirect URL (for most clients https://127.0.0.1 will be enough). Then click “Submit”.
Note : Redirect URL should be in the format https://. You can put any number here. Also referred to as URL Forwarding, Redirect URL is a technique which is used to redirect your domain's visitors to a different URL.
- Your App is created now. You can view the list of Apps, along with their App Key and Secret Key, in the view apps section on the homepage. Note: Registering an App is a one-time activity. An App can contain multiple strategies and can be used daily to modify strategies without the need to create afresh. Consider creating a new App when you need to create a new strategy / project.
- Make sure you activate the app before you create/edit your trading strategies. In the below image you can see that the App Status of 1st app (Tradetron) is inactive while the other two are active.
- Finally generate a session key and use the key in your Python code to start trading. Please note that the session key needs to be generated every day for using Breeze API. This is a SEBI mandated requirement.
Please check our article on “What is a Session key and how to generate it for using Breeze API”, to know the steps of session key creation.
How To Get Started With Breeze API Step By Step Process Of Breeze API ICICI Direct
To start creating your trading strategies with Breeze API, you only need a platform / environment (IDE) to write your code on. There are many development environments out there you can use. Some of the most popular ones are: Jupyter, Anaconda, Spyder, Microsoft Visual Studio, PyCharm and others. You can download Anaconda - a popular data science application which provides python IDE like Jupyter and Spyder by clicking on the following link : https://www.anaconda.com.
Disclaimer:- ICICI Securities Ltd.( I-Sec). Registered office of I-Sec is at ICICI Securities Ltd. - ICICI Venture House, Appasaheb Marathe Marg, Prabhadevi, Mumbai - 400025, India, Tel No:- 022 - 2288 2460, 022 - 2288 2470. I-Sec is a Member of National Stock Exchange of India Ltd (Member Code:-07730) and BSE Ltd (Member Code :103) and having SEBI registration no. INZ000183631. Name of the Compliance officer (broking): Mr. Anoop Goyal, Contact number: 022-40701000, E-mail address: email@example.com. Investment in securities market are subject to market risks, read all the related documents carefully before investing. The contents herein above shall not be considered as an invitation or persuasion to trade or invest. I-Sec and affiliates accept no liabilities for any loss or damage of any kind arising out of any actions taken in reliance thereon.