order_trades function abruptly throwing ValueError on (03/07/2026)

VibhuKite09
Have been using this in an automated script for more than 6 months now. Today (03/07/2026) this api started throwing error on legitimate orders.

code:
oid = '26.....'
kite_order_detail_list = get_kite_order_details(order_ids=oid, kite = kite)
print(kite_order_detail_list)
kite_orders = kite.orders()
print(kite_orders)
order_trades_raw = kite.order_trades(order_id=oid)
print(order_trades_raw)

Out:
[{'placed_by':....
[{'placed_by':....
ValueError Traceback (most recent call last)
File ~/Desktop/kite/kite-venv-v1/lib/python3.9/site-packages/dateutil/parser/_parser.py:649, in parser.parse(self, timestr, default, ignoretz, tzinfos, **kwargs)
648 try:
--> 649 ret = self._build_naive(res, default)
650 except ValueError as e:

File ~/Desktop/kite/kite-venv-v1/lib/python3.9/site-packages/dateutil/parser/_parser.py:1235, in parser._build_naive(self, res, default)
1233 repl['day'] = monthrange(cyear, cmonth)[1]
-> 1235 naive = default.replace(**repl)
1237 if res.weekday is not None and not res.day:

ValueError: year 0 is out of range

The above exception was the direct cause of the following exception:

ParserError Traceback (most recent call last)
Cell In[2], line 8
6 kite_orders = kite.orders()
7 print(kite_orders)
----> 8 order_trades_raw = kite.order_trades(order_id=oid)
9 print(order_trades_raw)

File ~/Desktop/kite/kite-venv-v1/lib/python3.9/site-packages/kiteconnect/connect.py:452, in KiteConnect.order_trades(self, order_id)
446 def order_trades(self, order_id):
...
654 ret = self._build_tzaware(ret, res, tzinfos)

File :3, in raise_from(value, from_value)

ParserError: year 0 is out of range: 0000-01-01 09:20:25
  • VibhuKite09
    @ZerodhaAlgoTrading @zerodhaVyankatesh can someone pls check and inform as soon as this issue is resolved?
  • VibhuKite09
    KiteConnect latest version failing in order_trades().
    kiteconnect version: kiteconnect-5.2.0
    kite.order_trades(order_id=) raises: dateutil.parser.ParserError: year 0 is out of range: 0000-01-01 09:15:25
    Checked on latest kiteconnect. The API response appears to contain an invalid zero-year timestamp which the SDK attempts to parse in _format_response before returning.
    kite.orders() works for the same order_id.

    -----------------------
    import requests
    resp = requests.get(f"https://api.kite.trade/orders/{oid}/trades", headers={"X-Kite-Version": "3", "Authorization": f"token {kite.api_key}:{kite.access_token}"})
    print(resp.status_code)
    print(resp.text)

    order_trades_raw = kite.order_trades(order_id=oid)
    print(order_trades_raw)
    Output:
    200
    {'status': 'success',
    'data': [
    {
    'average_price': 190.13,
    'quantity': 5,
    'trade_id': '60*******',
    'product': 'MIS',
    'order_timestamp': '0000-01-01 09:15:25',
    'fill_timestamp': '2026-07-03 09:15:25',
    'exchange_timestamp': '2026-07-03 09:15:25',
    'exchange_order_id': '130****3',
    'order_id': '260******',
    'transaction_type': 'BUY',
    'tradingsymbol': 'TATASTEEL',
    'exchange': 'NSE',
    'instrument_token': 895745
    }
    ]
    }
  • Nivas
    We verified the order_trades function and it works fine now. Could you please check and let us know if the issue persits?
  • VibhuKite09
    VibhuKite09 edited July 3
    Still not working. I am getting 200 and legit response from the API, kite.order_trades python SDK is failing coz order_timestamp ("order_timestamp":"0000-01-01 09:15:25") is malformed. This was working perfectly till yesterday. PLS check python SDK on kiteconnect 5.2.0 (latest), response itself is working (curl might be too).
    ------
    import kiteconnect
    print(kiteconnect.__version__.__version__) # > 5.2.0
  • VibhuKite09
    VibhuKite09 edited July 5
    Till Thursday 02-07-2026 the kite.order response had order_timestamp following this format: 2026-06-25T09:15:13; and kite.order_trades following this format: 09:15:13.

    On 03-07-2026 the kite.order remained consistent and working but kite.order_trades received order_timestamp in this format: 0000-01-01 09:15:25. The Python SDK using python's dateparser failed - not a SDK issue; the response had bad timestamp. Though, the failure is happening with kiteconnect python package - API/SDK contract issue.

    PS: I am surprised with the slow response time here. On a active market day if the order trades function is failing this impacts algo trading/automated systems, why is the dev team not quick to respond/ fix the issue - any faster way to escalate for quicker response time (in future). IDK what the scale of this issue is but it surely happened with >20 orders for me. Are these bad timestamps only received for specific order id/ user id sets?

    No way for me to know if this is fixed or not till tomorrow. I hope this issue is resolved.
  • Nivas
    Nivas edited July 6
    We've already reported this to the team, and they're checking this and will provide you with an update asap. Until then, we request you to please use the raw HTTP API to fetch the trade details. We're sorry for the inconvenience caused.

Sign In or Register to comment.