Fetching nifty50 futures historical data

https://api.upstox.com/v2/historical-candle/NSE_FO|/3500430minute/2024-05-17/2024-05-16";

CAN YOU ASSIST WITH WHETHER THE ABOVE IS IN CORRECT FORMAT OR GUIDE WITH CORRECT FORMAT, FOR FETCHING DATA OF NIFTY24JUNEFUT

Hi @algotest_algotest,

Please try with the correct URL format as mentioned in the below API documentation

https://api.upstox.com/v2/historical-candle/:instrument_key/:interval/:to_date/:from_date

So for your example, URL should be as below, where

instrument_key=NSE_FO|35004
interval=30minute
to_date=2024-05-17
from_date=2024-05-16

URL:

https://api.upstox.com/v2/historical-candle/NSE_FO|35004/30minute/2024-05-17/2024-05-16

Do let us know if this helps, Thanks!

Thank you Anand, it is working now

similarly, when tried to fetch intraday, it shows error.

Error fetching data: Invalid argument: https://api.upstox.com/v2/historical-candle/intraday/NSE_FO|35004/1minute

can you please help to correct it ?

@algotest_algotest Glad to know if works!

For intraday, can you share the actual error code you are getting? The URL that you shared, it’s works for me. can you share the curl request for further investigation?

That i got already, am looking to fetch intraday ie, today’s data.

so what should be the correct url ?

@algotest_algotest Please do check the API documentation for intraday candles

Although, the URL that you shared for intraday seems to be correct.

Thanks

but error repeating Exception: Invalid argument: https://api.upstox.com/v2/historical-candle/intraday/NSE_FO|35004/1minute