Hi i am using api quotes to retrive data using the below code for multiple symbols
api_response = api_instance.get_full_market_quote(symbol, api_version).
Now my question is the how to retrive the value from the api_response variable.The variable type is not Dictionary or List type of python. I need to use loop to iterate this variable
import upstox_client
from upstox_client.rest import ApiException
configuration = upstox_client.Configuration()
configuration.access_token = 'access_token'
api_version = '2.0'
symbol = 'NSE_EQ|INE669E01016,NSE_EQ|INE848E01016'
api_instance = upstox_client.MarketQuoteApi(upstox_client.ApiClient(configuration))
try:
api_response = api_instance.get_full_market_quote(symbol, api_version)
print(api_response.data['NSE_EQ:NHPC'])
except ApiException as e:
print("Exception when calling MarketQuoteApi->get_full_market_quote: %s\n" % e)
The get_full_market_quote function returns an object of the GetFullMarketQuoteResponse type.
The data field within this object is a dictionary, allowing you to easily access the data.
For a better understanding, please refer to these example codes: Example Codes