You can now use our new domain, which also provides responses for NIFTY MID SELECT.
import json
from typing import Any
import pandas as pd
from snapi_py_client.snapi_bridge import StocknoteAPIPythonBridge
import requests
import json
samco = StocknoteAPIPythonBridge()
login = json.loads(samco.login(body={
“userId”: “XXXXX”,
“password”: “XXXX”,
“yob” : “XXXXX”
}))
session = login[‘sessionToken’]
print(session)
samco.set_session_token(sessionToken=session)
headers = {
‘Accept’: ‘application/json’,
‘x-session-token’: session
}
r = requests.get(‘https://tradeapi.samco.in/quote/indexQuote’, params={
‘indexName’: ‘NIFTY MID SELECT’
}, headers=headers)
print(r.json())
Response : {‘serverTime’: ‘20/08/24 12:14:04’, ‘msgId’: ‘7bbdded9-8c0a-4ca4-88d8-acfe8c0dbb1a’, ‘status’: ‘Success’, ‘statusMessage’: ‘Index Quote details retrieved successfully’, ‘indexDetails’: [{‘indexName’: ‘NIFTY MID SELECT’, ‘listingId’: ‘-60’, ‘lastTradedTime’: ‘2024-08-20 12:14:03.0’, ‘spotPrice’: 12815.95, ‘changePercentage’: 0.69, ‘averagePrice’: 0, ‘openValue’: 12807.6, ‘highValue’: 12825.85, ‘lowValue’: 12785.75, ‘closeValue’: 12728.6, ‘totalBuyQuantity’: 0, ‘totalSellQuantity’: 0, ‘totalTradedValue’: 0, ‘totalTradedVolume’: 0, ‘change’: 87.35}]}