Hi, in the instruments file (complete.csv, nse.csv etc) the field values for tradingsymbol column are missing. I can’t seem to fetch the LTP of “Bank Nifty” for example, I have tried “NSE_INDEX|Bank Nifty”, “Bank Nifty”, “NSE_INDEX|28”, “28”, it just keeps saying symbol is of invalid format. What’s the issue? This is a very basic thing.
I am using this exact code for LTP: https://github.com/upstox/upstox-python/blob/master/docs/MarketQuoteApi.md#ltp
This is what I keep getting:
Reading instruments from file…
NSE_INDEX|Nifty Bank
idx_ltp: 0. error: Exception when calling MarketQuoteApi->ltp: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Sat, 23 Sep 2023 13:46:11 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’: ‘b5e887cf-0d23-4c30-952a-90cc293245e3’, ‘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’: ‘DYNAMIC’, ‘Set-Cookie’: ‘_cfuvid=wTrqc4Gyakcdl6kj2f9k_pTCE2c8yHS_TTUfCJzDj2s-1695476771394-0-604800000; path=/; domain=.upstox.com; HttpOnly; Secure; SameSite=None’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘80b33b7d0ad6470a-BOM’})
HTTP response body: b’{“status”:“error”,“errors”:[{“errorCode”:“UDAPI1011”,“message”:“symbol is of invalid format”,“propertyPath”:“getLastTradedPrice.symbol”,“invalidValue”:“NSE_INDEX|Nifty Bank,”,“error_code”:“UDAPI1011”,“property_path”:“getLastTradedPrice.symbol”,“invalid_value”:“NSE_INDEX|Nifty Bank,”}]}’