i am looking for Nippon ETF, GOLD ETF and some other ETF data.
There is no specific API for ETF data. You can use the Historical Data API for the same. Example given for AXISGOLD ETF on NIFTY with ISIN - INF846K01W80.
import requests
isin = 'INF846K01W80'
url = f'https://api.upstox.com/v2/historical-candle/NSE_EQ%7C{isin}/1minute/2025-02-05/2025-02-01'
headers = {
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
The above snippet gives out the below result.
{'status': 'success', 'data': {'candles': [['2025-02-05T15:29:00+05:30', 72.03, 72.19, 72.03, 72.03, 413, 0], ['2025-02-05T15:28:00+05:30', 72.19, 72.3, 72.19, 72.19, 1627, 0], ['2025-02-05T15:27:00+05:30', 72.1, 72.19, 72.1, 72.19........
Hi @Shibli_Baig, You are right! Thanks for your input.
Hi @sreenivas, ETFs are like stocks and they have an instrument key. So, historical and market quote APIs can be used to get the ETF data.
@Ushnota @Shibli_Baig Thanks for info, Where can i find list of instrument keys of diff ETF??
Hi @sreenivas,
You can find ETF in the instrument json file-> Instruments | Upstox Developer API. You can search for âETFâ here.
@Ushnota I have encountered an issue while downloading the BSE CSV on Mac. It gives the following error. Is that an issue on my end or something else? Also will it be possible to have BSE list also in JSON format?
Yes, @Shibli_Baig, we do have a BSE JSON file, and we recommend using it.
Link to JSON files
However, if youâre encountering this error, you can try running the following command in the terminal within the directory where the file was downloaded:
gunzip BSE.csv.gz
Thanks.
Got it, thanks a lot for your help.