Error Fetching Historical Data

upstox_client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Thu, 17 Jul 2025 03:55:50 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘vary’: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’, ‘message’: ‘request failed’, ‘requestid’: ‘535f45b0-2330-4816-b171-66013e1a6a9f’, ‘x-content-type-options’: ‘nosniff’, ‘x-xss-protection’: ‘1; mode=block’, ‘Cache-Control’: ‘no-cache, no-store, max-age=0, must-revalidate’, ‘pragma’: ‘no-cache’, ‘expires’: ‘0’, ‘strict-transport-security’: ‘max-age=0; includeSubDomains’, ‘x-frame-options’: ‘DENY’, ‘CF-Cache-Status’: ‘MISS’, ‘Set-Cookie’: ‘__cf_bm=qrV5ZMKk0IoPFEA1Ctl8ptP5bQjaB0UCUIMhnJr6nbk-1752724550-1.0.1.1-Bk6FbHkzgXga_nCK6wNeSSEZaNw.5TFxFQJlzAA0i3G6bFynVDEs..cCkfUntO5r; path=/; expires=Thu, 17-Jul-25 04:25:50 GMT; domain=.upstox.com; HttpOnly; Secure; SameSite=None, _cfuvid=vNbmJ5tqx9.lVGKhkW7lETjhHdPBDAeaB2Vl59xeApY-1752724550623-0.0.1.1-604800000; path=/; domain=.upstox.com; HttpOnly; Secure; SameSite=None’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘9606ce59399d4212-BOM’, ‘alt-svc’: ‘h3=“:443”; ma=86400’})
HTTP response body: b’{“status”:“error”,“errors”:[{“errorCode”:“UDAPI100500”,“message”:“Something went wrong… please contact us”,“propertyPath”:null,“invalidValue”:null,“error_code”:“UDAPI100500”,“property_path”:null,“invalid_value”:null}]}’

1 Like

I am getting the same error.
According to API We should be able to fetch 1 month of 1m data but I am getting 400 for anything greater than 4 trading days.
@Ketan Please look into this, such inconsistency shouldn’t happen, We has the users of the upstox API suffer alot because of these problems.

getting the same issue today suddenly.

It seems to be duplicate of Something wrong with API today - #5 by Aman_Jha
@Ketan @Ushnota

@Kautilya , I am getting same error for 4 days of historical trading data. Is it working for you and if yes, then could you post the code snippet.

@yuvika_9347091
What I noticed about this api is when I try to fetch more than 4 days data for 1minute, it give me error anything else is working fine.
If you can tell me what dates and interval are you trying to fetch, I can help with it.

It seems python API library which upstox has developed does not support from_date, only to_date when getting historical data. So I am unable to fetch only 4 days of data @Kautilya

1 Like

have the same error - any luck?

I am getting the same error, i think Upstox has decreased the rate limits for fetching historical data which is wrong, i am thinking of changing my api provider.