It's a raw binary tick packets. The documentation explains more about this.
PHPkiteconnect client don't have Websocket streaming implementation by default. You can take reference from this PHP ticker implementation package.
Is this error coming only on the place order API? Or on all requests. Go through the Orders FAQs here: https://kite.trade/forum/discussion/4732/frequently-asked-questions-faqs#login
However, once the password was successfully reset, and TOTP 2FA also reset, still I got the capcha on a fresh login when I tried to login.
Yes, the captcha will come till you have made successful login once with the correct userID, password, and 2FA…
I just checked $kite->getInstruments("NFO") and it's rendering fine including both exchange-wise and all. Make sure, you are using the latest PHP kiteconnect version.
[9766] => stdClass Object
(
[instrument_token] => 171…
I am getting forbidden (403).
You need to check if you are using the correct authentication values (access token, API key, etc.), and also ensure that your historical data subscription has not expired.
Hi @JeetKumar
We have not added any image captcha on the login flow. The image captcha only occurs if you enter the wrong userID or password more than 4 times. In such cases, you will need to enter the correct userID, password, and captcha for a su…
https://kite.trade/docs/connect/v3/websocket/#quote-packet-structure
But in this url quote structure of websocket respose is given different.
The quote packet structure mentions the exchange broadcasted binary packet message structure.
When receivin…
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
You need to handle timeout here.
I have almost waited for more than 30 sec and even is_connected() returns true but no new ticks receiving
Is it possible, to check the same contract ticks from another source? Maybe check kite web marketwatch depth during the same time, just to veri…
My query is data stops receiving after some time in ticker.
If the contract is active (with ticks) and there is no disconnection, this scenario won't occur. However, there might be disconnections due to errors, which would be displayed in the on_err…
undefined reference to `uS::Node::run()'
undefined reference to `uWS::WebSocket::close(int, char const*, unsigned long)'
These errors occurs, if your code is not complied properly or if compiled with different C++ standards.
So will both the instances receive order postback update? Or only one which was subscribed first?
Both, if you have added order update callbacks in both.
I would like to inquire if Zerodha provides historical data
Continuous data can be fetched for the day interval from the 2011 start for FUTs. For OPTs and intra-day intervals, you may contact these exchange-authorized data vendors.
Does it mean terminating kws connections explicitly is pointless, as it will die anyway as main exits ?
In any case, if i have some post process to do and I want to close connections, closing any one kws will close all other connections ? (all kws a…
So it appears to me that, closing 1 WS closes rest all connections ? is this true ?
Yes, if you close the main thread connection, all daemon threads created using threaded instances would be self-closed.
As this is a large file stream, there could be possible network-related issues such as network congestion or connection dropouts, which could lead to a disruption in the data transmission. So, it's recommended to request it once a day (ideally at ar…
logging.basicConfig(level=logging.DEBUG)
You will need to enable/set debug level logging as you are logging ticks here logging.debug("Ticks: {}".format(ticks)). You won't need to, if you direct print the ticks, print(ticks).
kite.set_access_token('m…
What are the use cases of on_message callback while using websocket?
You mean on_order_update?
It's for receiving order updates, the same as postback. For a multi-user public platform, postback is designed to be used and you can find more details o…
Clarify the difference between 'unfilled_quantity' and 'pending_quantity which we get on order update.
There is no difference, both represent the pending quantity. unfilled_quantity, is an legacy field, and will be removed in the next release.
Is there a time limit to retrieving orders and trades executed yesterday ?
Yes, you can fetch orderbook only for the current day, not for the historical orderbook.
If so, how does one get orders executed yesterday?
Currently, this is not available i…
how to fetch order id of the iceberg order instead of individual legs?
You need to check for order with variety:iceberg and quantity:total_quantity.
how to modify quantity in iceberg orders
You can modify iceberg quantity, only if the main leg is pe…
'RMS:Margin Exceeds,Required:2608519.58,
This is the margin requirement for fresh short SELL order of BANKNIFTY2350443400CE, so the possibility can be that a different product type, then the open position, so it was considered as a new order.
Is there a way to capture the trade taken in Kite Terminal using Web Socket?
Yes, you can use the order update callback. Go through the java client websocket usage example here.
To determine the number of legs for iceberg orders with a value between 2 and 10, you may use the rounded-off integer as 'iceberg_legs', and use quantity as total(here 2025), the last legs will be placed with the left-out quantity.
Are you still getting error evening after all request body as form-encoded (application/x-www-form-urlencoded)?
Can you DM your complete request structure?
can I connect a websocket only for receiving order updates, ie without subscribing with any instruments for receiving ticks?
Yeah, just have callbacks for order update.
we should use https://kite.trade/docs/connect/v3/margins/#basket-margins API to fetch brokerage charges.
Yes, you will need to use order margin API for this, as the charge is a nested element on the order margin API response, which requires one's o…
Can I call my Zerodha api from two machines , simultaneously ( within the API usage limits) ?
Yeah, yes you can. Just make sure, you are not exceeding the rate limits prescribed.
3) a combination of both.
This would be recommended depending on your use case. If you are looking for the status of Non-API orders placed as well. This thread explains all possible scenarios for order updates via WebSocket.
1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Go through the python websocket FAQs here.
so for long bank nifty option the transaction type will be "TRANSACTION_TYPE_BUY" and for stop loss order as per your answer it will be "TRANSACTION_TYPE_SELL"
Yes
Will order type be "ORDER_TYPE_LIMIT" or "ORDER_TYPE_SL"
SL order type, with trigger_…
ImportError: cannot import name 'DelayedCall' from 'twisted.internet.base'
Are you trying to restart the twisted instance, once it's stopped?
Can you paste here the complete error stack trace?
while fetching order details - couldnt get the order id
You need to handle this with retry. This thread explains more.
while fetching bank historical data - too many requests
Rate limits are defined here. Exceeding them throws this error. Maybe hand…
@KartikShah
I have deleted your above post because it contained API-related secret credentials. Avoid posting such information on a public forum, as it may compromise your account's security.
DEBUG:urllib3.connectionpool:
This is a debug log showin…
can it be found whether these options or what fraction of these options have been bought/sold by the traders/investors or market makers?
We do not receive this specific breakup of OI data from Exchange through streaming.
Along with the API key, they will need an access token, which requires your account credentials such as user ID, passwords, TOTP, etc., in order to have full access to your account. So, it is always advisable to exercise caution when sharing API key…
once the first leg (parent order) of an iceberg order is executed, its state is changed to COMPLETE, and immediately the second leg's order will placed into the market.
The second leg's orderId will be available in the orderbook only after the firs…
Zerodha streaming does not provide such "total" data.
Yes, there is no individual API for this.
This thread provides a solution for a similar scenario.
We flush all sessions, including APIs and Websockets, at around 07:30 AM every day. Users will need to establish a new WebSocket session if required fresh the next day. This process helps mitigate non-essential impacts.
Can a link be created to fetch it automatically?
No, you can only fetch live tick data or historical data not with an applied indicator. That, you need to build at your end.
Whenever the same API call is being sent in a loop this error is thrown .
504 Gateway Time-out
Are you making API calls exceeding the rate limits, in the loop? Add some seconds delay, for the next request in the loop.
message: 'The order quantity 1000 (40 lots) is higher than the maximum quantity of 900 (36 lots) allowed by the exchanges. Please reduce the order quantity or use iceberg orders.
quantity: 1000,
You need to place lesser than the freeze quantity, set…
orders = [...]
kite.place_gtt(...., orders=orders)
Orders should include tradingsymbol and exchange params as well. Go through the order list documentation and python oco gtt example.
GET /instruments/NFO HTTP/1.1
Whenever the same API call is being sent in a loop this error is thrown .
It's not recommended to download the instrument file for each request, but store it once at the start of the day locally and consume the same for…
Is it possible to fetch only those orders from API?
There is no individual API for this, but you need to fetch orderbook, kite.orders() and filter out those orders based on the status and order_type.
But I need 10-April every 5 or 10 or 15 min data, in that case, which subscription I should take, should I need to subscribe to historical data?
Yes, Historical candle APIs or you can use form candles at your end as well using the websocket streamin…
Since it is JUST VIEW mode I would like to leverage publisher API.
No, the Publisher JS plugin can't be used to make GET calls for account-related information. You can make only make a POST request (order placement here). Go through the documentatio…