WebSocket connection upgrade failed (429 - TooManyRequests)
You are exceeding the maximum limit for WebSocket connection(it's fixed to 3). So, make sure you are not creating multiple instances at the same time.
We just checked for instrument_token=382465(BURGER KING NSE), and can see that we have intraday and day candle data for 2015-02-02 to 2017-09-13 and then from 2020-12-14(IPO listing date) to present. Seems like token=382465 was assigned to some othe…
When can we expect this api?
You can place the orders in the loop for that. UI basket order is just wrapper over this.
Atleast placing an order by basket order api will save some time otherwise wasted in latency.
Kite Connect API is not a feasible s…
@anudeepsharma
Basket APIs is returning correct data at our end. We have used the same param as yours.
Input param:
[
{
"exchange": "NFO",
"tradingsymbol": "NIFTY21MAY15400PE",
"transaction_type": "SELL",
"variet…
1. I place an order, the order is executed partially and price moves away
2. I modify the same order and get the fill for the rest of the qty in the order
You can use tradebook as your requirement.
No, currently we have intraday historical data for a maximum of 5 years. You can get a day candle for 10 years or more. You can refer to historical data FAQs here.
F&O contracts have expiry associated with it. Just GOLD won't specify which month contract, you are looking for. You will have to specify the whole trading symbol to fetch Quote values.
We success to getQuote() and getOHLC and getLTP() but we want in same one funtion
You can just use getQuote or getOHLC, both has last_price as well as OHLC value.
$kite->getQuote(["MCX:GOLD21JUNFUT", "MCX:GOLDM21AUGFUT","MCX:SILVER21JULFUT","MCX…
Are you trying to build an application for retails clients?
The refresh token is meant for platforms like smallcase. These are exchange-approved platforms that serve retail clients on a large scale.
For consuming the APIs for personal use, you'll h…
I am placing SL-M order with stop loss, How can I know if stoploss is triggered? Will I get any postback or websocket update on onOrderUpdate?
Yes, you will get a postback update or an onOrderUpdate WebSocket update once an order is executed on exch…
We don't recommend high-frequency polling positions. Depending on your requirement, you can make use of Websocket streaming, post-back, order-book APIs, etc to work around instead of polling positions.
Also please let me know if there is any platform of Zerodha for checking our codes, where virtual money is involved as it will help to check the code without any monetary loss due to some error in code.
No, currently we don't have a sandbox environm…
Is there any api for fetching historical candle data for a list of stocks for a specific period.
No, you need to loop in the list of stocks and fetch historical data for the required period for instruments one by one.
Does Kite Connect offer historical Futures data?
Yes, historical data is available for NFO futures.
However, after extracting the instrument dump as shown in the documentation, I could not find the Instrument IDs corresponding to Futures
Did you ch…
Is there any api to get stock name with latest price in a single api
Didn't get you on this? Are you trying to fetch all exchange all segment contracts(i.e 20k+ contracts) symbol/name with LTP in a single API request?
Then no, we don't have a speci…
Other values are changing in quote function response, LTP, volume and bid, but OHLC doesn't seem reliable.
OHLC value won't change at every minute/second, as these are values for the day. We have to look for last_price, which determines current mark…
Any way I can access data for options contract that has expired ?
No, not using Kite connect APIs. But, you may consider getting it from any of the data vendors available outside.
against the closest expiry for calls and puts. How can I achieve this?
The instrument id for 13th expiry is not present( as it has expired)
Continuous data is available only for the futures contract, not for option contracts.
You have to use the same kite.place_order method to place counter order to square off the trade except for CO orders. Go through this thread to know more about this.
Is the method for generating access token for historical data different than regular API access token ?
No, it's the same.
Error: 'kiteconnect.exceptions.InputException: invalid token
You are using wrong instrument token used to fetch historical d…
LMT order is placed; once it is completed; post back page is not called.
We just checked for LIMIT Pending order to the completed scenario and have received postback for the same as well. You need to check your postback setup.
Both CDS and MCX instruments tick are streaming fine. You can even check their respective historical data as well, which is available since their respective market start today.
If i want VIX RSI value on 3 min time frame, do I need historical API?
No, historical data APIs don't provide any indicator-based value. It only provides OHLCV data. Rest all calculations, you will have to do at your end.
However, I get an error message saying that the token is invalid or expired.
How are you generating request_token?
Go through this documentation to understand the whole login flow.
I wanted to know what is the time frame for OHLC data ?
It represents a snapshot of tick data at the requested instance. OHLC or any quote APIs data don't have any time frame like historical data(which represents candle time frame). So, if you are l…
But once the order is COMPLETE post back page is not called
Have you placed an order for this on Kite web? Go through this thread to know more about this.
If using APIs, then have you set your postback set up properly. Let us know more about this f…
it gives me error - *** SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
Doesn't seem to be generated from the above gtt order placement. You need to check your variable assignment properly above eg. tradingsymbol=name,
t…
Please let me know to get live OI data.Why only 3 minutes once only OI data updating?
We have just verified this at our end. We are streaming the same, we are receiving from the respective exchange. So, above is the OI value we received from the exc…
orders={"SELL",trd_list[one_tick_token]['qty']}
orders param has to be list of orders i.e for both trigger orders. Here, you are sending only one order.
You can check the sample orders example here.
[
{
"exchange":"NSE",
"tradi…
As seen from the above screenshot at that given instance, the OI value is same on both Kite and NSE portal.
NSE OI in lots: 37429
NSE in Qty: 37429*75 = 2807175
OI showed on Kite = 2807175
Volume will differ as these are not real time.
You can go …
Can I holiday details through api like holidays of current year/month
No, currently we don't have any holiday calendar APIs as such. But, these holidays are easy to maintain at your end as it's fixed and is released at the start of the year on NSE p…
15:00:29 SELL SBIN MAY FUT NFO NRML 1500 / 1500 367.20 COMPLETE
You mean to say, the order placed at 15:00:29 was missing from your orderbook response, requested at 15:00:35?
If possible, can you add both 15:00:35 and 15:02:44 requested orderbook re…
You have to use same combination of exchange:tradingsymbol for exchange contract to fetch Quote data, same for Websocket streaming as well, use instrument token. You can get trading symbols and instrument token detail from the instrument list.
We want MCX live data like open,close,low,high,bid,ask,ltp etc., pl
You have to use Websocket streaming, to fetch these values in real time.
Guide how to implement on linux server with php
Our PHP lib doesn't support WebSocket streaming out of the …
In terms of data structure will it be dictionary or binary data? BTW I am using python Lib.
Dictionary. Same as shown in Sample payload for above link.
We don't have APIs to fetch historical order book detail. You can know, more detail about each of your holdings through this API.
If you are specifically looking for those order_id's you will have to store daily orders at your end.
kindly suggest how to delay the callback from the websocket
You can't delay the stream, it's a WebSocket stream. Didn't get you. Can you let us know, what are trying to do here?
How to retrieve weekly historical data?
Do you mean a single candle for a week interval?
If yes, then we don't have weekly specific candles. You can go through this thread to know more about this.
builtins.AttributeError: 'NoneType' object has no attribute 'append'
The above error occurs when handling another initiating error in your codebase.
helper_method_2
open_position = kite.positions()["net"]
File "/Library/Frameworks/Python.framework/…
There is no historical data for few days in February 2009 of NIFTY 50
Thanks for pointing it out. We will be backfilling this data during the maintenance period i.e over weekends.
whether market order can be placed for banknifty option through kite API
Yes, except for the illiquid index options contract. This article explains more about this.
File "C:\Users\xxxxxx\Anaconda3\lib\site-packages\twisted\internet\base.py", line 913, in runUntilCurrent
call.func(*call.args, **call.kw)
You can go through Websocket streaming FAQs for Anaconda setup here.
File "C:\Users\91701\anaconda3\lib\site-packages\twisted\internet\base.py", line 765, in startRunning
raise error.ReactorNotRestartable()
Looks like your local development environment issue i.e on your anaconda setup.
Refer to FAQs on anaconda setup…
If I want to fetch the order details of that positional order along with it's order_id in future, then how it could be done?
Currently, we don't have historical order book APIs. You will have to store(maybe dump in DB) these order details at your en…
Does the Instruments API returns CSV file or the csv data which we will have to further create a csv file.
Simple curl returns a CSV dump. And, in client libraries, these get converted to a list or dictionary.
So the OI data which we get from Kite API is also delayed ?
No, it's a real-time feed from the exchange.
when it comes to OI I am noticing the same values in both the NSE website and KITE API. So can you please clarify?
Yes, OI can be the same value…
kite.exit_order(variety=variety, order_id=order_id)
InputException: order cannot be cancelled as it is being processed. Try later.
You are using the wrong order_id here. When you place a CO order, you get 2 legs i.e order_id, 1st leg for limit/marke…
@ramatius
We just verified for NIFTY2150614700CE[instrument token-10817026] WebSocket streaming data. OI value is updating fine.
{'date': datetime.datetime(2021, 5, 6, 10, 31, tzinfo=tzoffset(None, 19800)), 'open': 19.55, 'high': 19.6, 'low': 17.95…
if any API provide Market Capital
No, we don't have APIs for stock fundamental data.
current % change for stocks
Yes, you can get %change w.r.t yesterday's close through Quote APIs or Websocket streaming.
The reason for the margin requirement is it's considering SELL as a short sell order rather than an exit order.
We can also see here that, you are trying to place an exit order within the next 2 seconds of the buy order. Can you verify from order_h…
Please provide some details on how this field is updated.
We stream tick data, as we receive it from the exchange as a quote packet.
This shouldn't happen though. Anyhow, we are logging ticks for the whole day for SBIN(779521) to investigate this.
kite.orders
This fetches complete order book. So, it doesn't take input param.
can you help with an example ?
To get required order_id average_price, you will have to iterate whole order book, filter required order_id(eg: 210504003918028 here) and …
If i use get quote of 100 stock then how will it take time to process that and show me same data?
It is difficult to derive at a fixed number, depends a lot on your hardware and network setup as well. You can go throught this thread to understand fe…
Do you update the field as soon as you get this data from exchange in real time and same will be reflected in Quote API and real time WebSockets will get the updates as well?
Yes, Websocket and Quote APIs broadcast data as received from the respecti…
However the margin of all live trades aren't summing upto the total used margin!
It is dynamic, so it keeps changing.
Yes, that's correct. You can use margin APIs to get an idea of the approx margin required(unless there is huge volatility in the ne…
I can see only 2 orders in order tab for a script, but when i make orders api call i see more than 12 orders for the same script.
I have attached the orders json. Check the orders for wipro
Check this link for orders
We are able to see only two orde…
which instrument dump should we look for NSE INDICES?
Yes, for NSE exchanges indices you can check for exchange as NSE and segment field as INDICES from the instrument dump.
One has suggested to implement two websocket connections, as this issue happens with load on the threading to process tick data; of the two websocket connections, one is to handle the data_fetch and order placement, other to monitor postback request…
@A_Ahuja
Didn't get you ?
x = kite.quote('NSE:20MICRONS','NSE:21STCENMGM','NSE:3IINFOTECH','NSE:3MINDIA','NSE:3PLAND') #For testing if the API allows for 5 instruments
pprint(x)
So, you are getting empty pprint output for this?
Code looks fine.
I'm using instrumental data from the api but the price is always coming to be 0 rs nothing changing
Are you trying to fetch the last price data from the complete instrument list?
If yes, then a complete instrument list is used to get instrument tok…
Is it safe to give away API secret and token? Since option chain is not specific to account, may be this looks like an overhead.
Didn't get you?
It's an open package specifically installed in your system, no one logs anything. Also, you can always c…
@maheshsolanke
We just tried reproducing the same scenario at our end. Place SBIN MIS and CNC MARKET order with different quantities added a few seconds delay and fetched positions. It's correctly showing the recently generated position of SBIN. Y…
@sriraj1122
On some weekends I am NOT able to retrieve the prices
Are you looking for an expired contract or a running/live contract?
On non-trading days, you will receive only the cache last tick of the previous trade date.
You are getting confused between weekly and monthly NIFTY contracts.
in the below image if we look at NIFTY2152013550CE
This is a Weekly Nifty contract.
NIFTY21APR12150CE
And this is monthly contract.
You can refer to this thread to know about the…
2021-01-01 08:45:00+05:30,15800.0,15848.0,15760.0,15813.65,623 2021-01-01
We are not able to reproduce this at our end, tried couple of ways including sending interval params starting before 8:45 for the day mentioned. But still, we are getting cand…
public struct Historical
{
TimeStamp , Open ,High, Low, Close, Volume, OI
}
Volume comprises of 1 Qty volume = 1 buy + 1 sell. You can go through this thread to understand more about volume.
How can i get how many buyers and sellers insider this V…
@akshay_thakker
it logs me out when I GENERATE the access token for the first time during the day.
Can you let us know the timings of your access_token generation?
You can go through this thread to know more about session timings.