Invalid response format when requesting for instruments

Getting the following exception in python client
DataException('Invalid response format')
  • abhishek01
    abhishek01 edited April 2016
    On digging the issue further, I have found that the python client is unable to parse the sent data. It appears that the format of the received data has changed.

    Look into this at the earliest. Either push the corrected code by 8AM or do not push till the end of trading day because we will just write a hack to over come this issue.

    We are extremely disappointed that in a financial product we are facing bugs regularly, making us lose our confidence in this product. Please do not push untested code to live environment. New features can be introduced slowly but don't go about breaking stuff.
  • Vivek
    @abhishek01 We didn't make any changes to our system recently. You may face few issues like that before market opening since there is an EOD maintenance process on OMS every night after commodity market closes. During market hours you may get few errors if OMS timeout and its intermittent. We haven't got any bugs reports on API reliability, If you could share more details about the scenario we will be able to help you.
  • abhishek01
    @vivek We are using kite.instruments(), where kite is an object of KiteConnect.

    We are getting the following error
    File "/Users/abhishek/anaconda/lib/python2.7/site-packages/", line 862, in _handle
    File "/Users/abhishek/anaconda/lib/python2.7/site-packages/", line 1732, in wrapper
    rv = callback(*a, **ka)
    File "/Users/abhishek/Downloads/zerodha_login/", line 78, in markets
    t = kite.instruments()
    File "/Users/abhishek/anaconda/lib/python2.7/site-packages/kiteconnect/", line 359, in instruments
    return self._get("market.instruments.all")
    File "/Users/abhishek/anaconda/lib/python2.7/site-packages/kiteconnect/", line 372, in _get
    return self._request(route, "GET", params)
    File "/Users/abhishek/anaconda/lib/python2.7/site-packages/kiteconnect/", line 467, in _request
    raise ex.DataException("Invalid response format")
    DataException: Invalid response format

    If we do debug true the first few lines of the response are:

    ('Response :', 200, 'instrument_token,exchange_token,tradingsymbol,name,last_price,expiry,strike,tick_size,lot_size,instrument_type,segment,exchange\r\n128031748,500124,DRREDDY*,DR.REDDYS LABORATORIES,0.0,,0.0,0.05,1,EQ,BSE,BSE\r\n213057285,832255,ARVI16JUN300.00CE,,0.0,2016-06-30,300.0,0.05,1700,CE,BFO-OPT,BFO\r\n213067013,832293,ARVI16JUN300.00PE,,0.0,2016-06-30,300.0,0.05,1700,PE,BFO-OPT,BFO\r\n4331777,16921,20MICRONS,20....

    Hope this will help you triangulate the error.
  • Kailash
    We're releasing a patch for the Python client tomorrow that should address this. Thanks.
Sign In or Register to comment.