I am not able to get the reply for BAJFINANCE script alone. I am able to get for most of the script which i am using.
I am trying to read via
“https://api.upstox.com/v3/market-quote/ltp”
Is there an issue with script name or i am doing any mistake?
Could you please share the instrument_key
you’re using to fetch the market quote for BAJFINANCE ?
You can try with the following cURL command — it’s working fine on my end:
curl -X 'GET' \
'https://api.upstox.com/v2/market-quote/ltp?instrument_key=NSE_EQ|INE296A01032' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {auth}'
Also, please make sure to download the latest Instrument JSON file daily to ensure you have updated instrument details.
I am using via python,
df = pd.read_csv(“NSE.csv.gz”)
#NSE.csv.gz is latest from last week
symbol_to_key = dict(zip(df[‘tradingsymbol’], df[‘instrument_key’]))
base_url = “https://api.upstox.com/v3/market-quote/ltp”
headers = {
'Accept': 'application/json',
'Authorization': f'Bearer {access_token}',
}
For trading_symbol i use “BAJFINANCE”
After getting the instrument_key i convert it to updated url,
url = f"{base_url}?instrument_key={instrument_key}"
after that i use,
requests.get(url, headers=headers)
@nandhini_manickam, Please try downloading the latest Instrument JSON file, as it is refreshed daily. Below is the correct entry for BAJFINANCE from the updated file
{
"segment": "NSE_EQ",
"name": "BAJAJ FINANCE LIMITED",
"exchange": "NSE",
"isin": "INE296A01032",
"instrument_type": "EQ",
"instrument_key": "NSE_EQ|INE296A01032",
"lot_size": 1,
"freeze_quantity": 100000.0,
"exchange_token": "317",
"tick_size": 50.0,
"trading_symbol": "BAJFINANCE",
"qty_multiplier": 1.0,
"security_type": "NORMAL"
}
Thanks