samco-sdk / Python-SDK

Official Python SDK for accessing Stocknote API
MIT License
15 stars 11 forks source link

GetQuote for Nifty Indices #21

Open starzar opened 1 year ago

starzar commented 1 year ago

For Indices symbol_name = 'NIFTY 50','NIFTY BANK' & 'NIFTY FINANCIAL SERVICES how to get quotes?

# quote = samco.get_quote(symbol_name='SBIN',exchange= samco.EXCHANGE_NSE) #Working
quote = samco.get_quote(symbol_name='NIFTY 50',exchange= samco.EXCHANGE_NSE) #NotWorking
print(quote)
cknmca commented 1 year ago

By utilizing the specific index trading symbol value from the ScripMaster.csv file available at https://developers.stocknote.com/doc/ScripMaster.csv and inserting it into the symbol_name field pair value, the API enables the retrieval of real-time quotes for the individual stocks that constitute these indices. Additionally, the exchange can be customized based on the symbol_name, thereby providing access to the relevant quotes as needed.For Example nifty August month specific contract you can insert like below quote=samco.get_quote(symbol_name='NIFTY17AUG2318250CE',exchange= samco.EXCHANGE_NFO) #Working

Response : { "serverTime": "27/07/23 15:18:24", "msgId": "607959f2-ff7c-4f0b-9538-92eb6f5001fc", "status": "Success", "statusMessage": "Quote details retrieved successfully", "tradingSymbol": "NIFTY17AUG2318250CE", "exchange": "NFO", "lastTradedTime": "27/07/2023 03:10:31", "lastTradedPrice": "1328.70", "previousClose": "1328.7", "changeValue": "0.00", "changePercentage": "0.0", "lastTradedQuantity": "0", "lowerCircuitLimit": "871.65", "upperCircuitLimit": "2358.40", "averagePrice": "0.00", "openValue": "0.0", "highValue": "0.0", "lowValue": "0.0", "closeValue": "1328.7", "totalBuyQuantity": "1750", "totalSellQuantity": "1750", "totalTradedValue": "0.00", "totalTradedVolume": "0", "yearlyHighPrice": "0.00", "yearlyLowPrice": "0.00", "tickSize": "0.05", "openInterest": "0", "bestBids": [ { "number": "1", "quantity": "1750", "price": "1274.65" }, { "number": "2", "quantity": "0", "price": "0.00" }, { "number": "3", "quantity": "0", "price": "0.00" }, { "number": "4", "quantity": "0", "price": "0.00" }, { "number": "5", "quantity": "0", "price": "0.00" } ], "bestAsks": [ { "number": "1", "quantity": "1750", "price": "1694.00" }, { "number": "2", "quantity": "0", "price": "0.00" }, { "number": "3", "quantity": "0", "price": "0.00" }, { "number": "4", "quantity": "0", "price": "0.00" }, { "number": "5", "quantity": "0", "price": "0.00" } ], "expiryDate": "17 Aug 23", "spotPrice": "19658.50", "instrument": "OPTIDX", "lotQuantity": "50", "listingId": "52211_NFO", "openInterestChange": "0", "oIChangePer": "0" }

raginisahu commented 5 months ago

DId you find any solution ? I also want to fetch quote for index NIFTY 50, BankNifty. get_quote is not working to fetch data for index.

Please provide me solution.

Regards, Ragini

imadhiraj commented 3 weeks ago

quote = samco.index_quote('NIFTY 50') attributeError: 'StocknoteAPIPythonBridge' object has no attribute 'index_quote' is there any solution? i used the new domain api..but its giving rate limit error.. i dont know why.. can neone suggest some work around?

regards adhiraj