I am getting error while getting historic data
-
I getting error as in the figure
from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
apikey = 'XXXXXX'
username = 'V237043'
pws = 'XXXXXXXXX'obj=SmartConnect(api_key=apikey)
data = obj.generateSession(username,pws)
refreshToken = data['data']['refreshToken']feedToken = obj.getfeedToken()
userProfile = obj.getProfile(refreshToken)
print (userProfile)
#Historic api
try:
historicParam={
"exchange": "NSE",
"symboltoken": "3045",
"interval": "ONE_MINUTE",
"fromdate": "2021-05-27 09:20",
"todate": "2021-05-27 09:35"
}
smartApi.getCandleData(historicParam)
except Exception as e:
print("Historic Api failed: {}".format(e.message)) -
HI @V237043 Are you able to generate session.?