Bug in the Upstox API for download historical data

Hello,

How tester tested and got passed I don’t know.

  1. While testing historical api got one one surprising part is without login also we can download historical data. So it means anyone can access historical data. The reason is access token is not being used while requesting the data.

  2. Historical data is is taking wrong argument. instead of start date it is taking as to date and instead of to date it is taking as start date it is taking as to date. Because of that when we try to fetch only one day data then it nothing is getting fetched. means no data is coming.
    Check in below screenshot.

  1. As per document we need to provide with this format
    curl -X ‘GET’
    https://api-v2.upstox.com/historical-candle/NSE_EQ|INE848E01016/day/2022-10-01/2022-10-04
    -H ‘accept: application/json’
    -H ‘Api-Version: 2.0’
    but getting error for fetching the data.

  1. It means that we need to provide in reverse format then working and because of that getting point 2 and point 3 error

.

@Chaitanya_Kalyani

Thank you for sharing your detailed observations.

Following are the clarifications.

  1. The Historical API is intentionally open. This is consistent with the documentation, which does not state any Authorization requirement since the API is meant to be open.
  2. The attached screenshot represents a typical intraday situation. For the current date, data should be fetched using the intraday endpoint. Fetching from the historical endpoint for the same would likely yield an empty array.
  3. We’ve noted the discrepancy in the CURL sample provided in the documentation, where values are switched. We aim to rectify this in the next documentation release.
  4. The documentation indeed specifies the necessary fields in the order of importance, highlighting the expectation to input the to_date before the from_date.

    The incorrect CURL sample might have been misleading. We apologize for any confusion caused.

Your detailed feedback is valued, and we’re grateful for your understanding and continued support.

Thank you!

Hello sir,
Could you please share this python code?