Do I need to learn programming/coding to use Breeze API?
A basic level of programming knowledge is required to create strategies and use Breeze API.
What is Trading APIs?
APIs (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.
Why use Trading APIs?
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. Trading APIs allow you to get live market prices, execute orders in real time, and help manage your orders and positions. 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.
What is Breeze API? What are the benefits of Breeze API for me?
The Breeze API is a powerful Indian stock market API through which you can fetch live/historical stock market data, real-time OHLC and Options Chain data, order status over Websockets, automate your trading strategies and monitor your portfolio in real-time.
What is the rate limit for Breeze API?
The rate limit is 100 calls per minute and 5,000 calls per day.
How many SDKs does Breeze API have?
SDK stands for software development kit. Also known as a devkit, the SDK is a set of software-building tools for a specific platform, including the building blocks, debuggers, and, often, a framework or group of code libraries such as a set of routines specific to an operating system (OS). You can find three SDKs in Breeze API:
Can you use Options Chain on Breeze API platform?
Option Chain API allows you to get option chain data for equities or indices within a given maturity period. To access the data, simply specify the instrument, the month the option expires, and whether you are interested in calls, puts, or both. Yes, Breeze allows you to use Options Chain API, where in a single API call you can get the entire chain with OHLC prices, Open Interest, Volume, and much more, and lets you filter the chain by the expiry date, right or strike price
What is the cost or fees for using Breeze API?
There is no cost or fees which customer needs to pay to access Breeze API or the data which we provide. All ICICIdirect customers can use Breeze API and create Apps free of all charges.
How can I use the API credentials and keys generated with Breeze API?
After successfully registering your App on Breeze login page, the API key and Secret Key should be available in the view Apps section in the homepage. Generate a session token for the respective App. Plug all 3 App credentials (API key, Secret Key and Session Token) in the Breeze API endpoint and start using the API. Please refer to our articles to see the step wise process
Which segments can I use Breeze API for? What kind of orders be placed?
At present, we have made available Stocks and Derivatives (F&O) trading through Breeze API. All the order types for the two segments are allowed. Futures and options are financial derivatives that allow traders to speculate on the price movements of an underlying asset without actually owning it.
What is the rate limit on order placements?
Currently, the rate limit for API is 75 per minute and 5000 calls in a day per user
Is Breeze API available for all customer segments?
At present, Breeze API is only available for Resident Indians and not for NRI customers.
What kind of an API is Breeze and what languages does it support?
Breeze is a Rest API and it supports various languages such as Javascript, Python, Csharp, Java etc
Is there availability of F&O historical data with Breeze API?
One of the main benefits of using a Trading API to formulate your trading strategies is that it provides a way to test your strategy on historical data. Historical data helps traders do a scenario analysis for their strategies and backtest them, which is one of the most important steps in creating an automated trading system. Backtesting gives the traders a chance to optimise their portfolio and also indicate how their strategy might perform in the future, assuming market conditions do not change a lot. Breeze API has historical data for Futures and Options trading and at present support 3 years of data which can be used free of cost.
Can we use live streaming of prices with Breeze API?
Yes, you may. We have websockets available for live data feed of markets. Please refer to our SDK page to know more.
Is an SDK available for Breeze API?
Yes, it is available. Please click on https://pypi.org/project/breeze-connect/ to see the complete list of Python SDK methods available and how to use them
How do I connect my trading platform to the live prices Breeze?
You will have to use websockets to subscribe to live feeds of markets. Please click on
to see the complete list of Python SDK methods available, including websockets and how to use them.
How does Breeze API keep my personal data secure?
Breeze has SSL + (App Key, Secret Key) encryption + Checksum encryption of the whole data package so no amount of sniffing or hacking can reveal client data to the wannabe hacker.
What is the process to use to the live streaming OHLC with Breeze API?
Please refer to our SDK page which lists all the SDK methods including websockets for usage. Please click on https://pypi.org/project/breeze-connect/ to see the complete list of Python SDK methods available and how to use them. OHLC stands for Open, High, Low, and Close. It is a commonly used concept in trading and investing, especially in technical analysis. These four points of data, recorded for each trading period, form the foundation of many trading strategies and help investors assess market sentiment.
Can you provide a step-by-step process to create and connect an App?
Please refer to our article
What is a session key and why is it important?
A session key is a temporary key that is only used once, during one stretch of time, for encrypting and decrypting data. This is similar to One Time Passwords (OTP) that have to be generated once in the morning to login, and help in encrypting a communication session for each app separately. This key or token expires in 24 hours after generation or at midnight
Do I have to generate a session key everyday?
Yes, it is required as per SEBI regulations
How can I create and deploy strategies with Breeze API?
You will have to create a strategy by writing a programming code using Breeze API endpoints and open source libraries. You can then deploy them in your personal laptop/desktop in a IDE (like Jupyter, Spyder). Where can I deploy strategies I have created? Strategies should be deployed in your personal desktop/laptop in an IDE (like Jupyter, Spyder, VS) using Breeze API endpoint.
Can we use existing positions through Breeze API?
Yes, you can check the live positions through get_postions() function of Breeze.
How can I get access to Breeze API? What are the steps involved?
In order to connect to Breeze API, you need to have an account with ICICIdirect. Create your account here:
https://isecuat1.icicidirect.com/open-account/mobile
After this, visithttps://api.icicidirect.com/apiuser/home and login with your ICICIdirect credentials. Now, you can create your Apps and use all the features of Breeze API
Does Breeze API allows fetching of 1sec data?
Yes, with Breeze API users can easily fetch 1sec, 1min data for historical backtesting purposes.
Code:
breeze.get_historical_data_v2(interval="1second", from_date= "2023-01-02T07:00:00.000Z", to_date= "2023-01-03T07:00:15.000Z", stock_code="ITC", exchange_code="NSE", product_type="cash")
Is TOTP option available in ICICI Direct API?
The TOTP option is live in ICICIdirect API login page. Users can enable it by visiting the settings option at homepage:
https://www.icicidirect.com
Is there any way to automate Session key generation?
No, Session key needs to be generated everyday manually according to SEBI guidelines. It is valid for 24 hours or until midnight.
Is there any go-to document to find python codes for beginners for Breeze API?
How to fetch Option chain of any stock code using Breeze API?
With Breeze API, get a snapshot of the entire Option Chain of any stock code by just customizing the code below:
breeze.get_option_chain_quotes(stock_code="NIFTY", exchange_code="NFO", product_type="options", expiry_date="2022-12-25T06:00:00.000Z", right="call", strike_price="")
Are there any charges for accessing historical data and using other features of Breeze API?
No, with Breeze API you get access to all the features like backtesting historical data, fetching live data via websockets etc absolutely free of cost
What is best way to call breeze.unsubscribe_feeds() function?
On subscribing to feeds, the callback is supposed to listen to any incoming data packets until the websocket is disconnected.
If we wish to stop feeds after a certain time , we can use time.sleep and then call unsubscribe_feeds .
#Connect to websocket
api.ws_connect()
# Callback to receive ticks. def on_ticks(ticks): print("Ticks: {}".format(ticks))
api.on_ticks = on_ticks
api.subscribe_feeds(stock_token="13.1!1050")
time.sleep(500)
api.unsubscribe_feeds(stock_token="13.1!1050")
How to get quotes of mentioned stock-code?
To get the quotes of the mentioned stock code the following code can be customized:
breeze.get_quotes(stock_code="ICIBAN",
exchange_code="NFO",
expiry_date="2022-08-25T06:00:00.000Z",
product_type="futures",
right="others",
strike_price="0") Note: Please change exchange_code=“NFO” to get details about F&O
How to get trade list of your account?
To get trade list of your account use the below code:
breeze.get_trade_list(from_date="2022-08-01T06:00:00.000Z",
to_date="2022-08-19T06:00:00.000Z",
exchange_code="NSE",
product_type="",
action="",
stock_code="")
Note: Please change exchange_code=“NFO” to get details about F&O
How to use web sockets for fetching live data?
Sample code for using websockets:
from breeze_connect import BreezeConnect
# Initialize SDK breeze = BreezeConnect(api_key="your_api_key")
# Generate Session breeze.generate_session(api_secret="your_secret_key", session_token="your_api_session")
# Connect to websocket (it will connect to rate refresh server) breeze.ws_connect()
# Callback to receive ticks. def on_ticks(ticks): print("Ticks: {}".format(ticks))
# Assign the callbacks. breeze.on_ticks = on_ticks
# subscribe stocksfeeds breeze.subscribe_feeds(exchange_code="NFO", stock_code="ZEEENT", product_type="options", expiry_date="31-Mar-2022", strike_price="350", right="Call", get_exchange_quotes=True, get_market_depth=False
How to modify an order using Breeze API?
Sample code for modifying order:
breeze.modify_order(order_id="202208191100000001", exchange_code="NFO", order_type="limit", stoploss="0", quantity="250", price="290100", validity="day", disclosed_quantity="0", validity_date="2022-08-22T06:00:00.000Z")
How to square off an order?
Sample code for Squaring of Order:
breeze.square_off(exchange_code="NSE",
product="margin", stock_code="NIFTY", quantity="10", price="0", action="sell", order_type="market", validity="day", stoploss="0", disclosed_quantity="0", protection_percentage="", settlement_id="", cover_quantity="", open_quantity="", margin_amount="")
Sample code for fetching portfolio details: breeze.get_portfolio_holdings(exchange_code="NFO", from_date="2022-08-01T06:00:00.000Z", to_date="2022-08-19T06:00:00.000Z", stock_code="", portfolio_type="")
How can we allocate funds and know about the status while trading via Breeze API?
For setting funds:
breeze.set_funds(transaction_type="debit", amount="200", segment="Equity")
For getting funds: breeze.get_funds()