def login(self) -> bool:
"""Connect to Angel One API"""
try:
self.session = SmartConnect(api_key=self.api_key)
get_new_totp = pyotp.TOTP(self.totp).now()
data = self.session.generateSession(self.client_id, self.password, get_new_totp)
if data['status']:
self.feed_token = data['data']['feedToken']
self.auth_token = data['data']['jwtToken']
self.connected = True
print("Successfully connected to Angel One API")
return True
else:
print(f"Login failed: {data['message']}")
return False
except Exception as e:
print(f"Login failed: {str(e)}")
return False
A
Latest posts made by amitpanchall
-
RE: Login problem
-
RE: "Couldn't parse the JSON response received from the server: b''"
historicParam = {
"exchange": exchange,
"symboltoken": symbol,
"interval": interval,
"fromdate": from_date,
"todate": to_date
}historical_data = self.session.getCandleData(historicParam)
-
RE: Getting Internal Error for /getLtpData.
live_data = self.session.ltpData("NSE", "NIFTY 50", "99926000")
here may be issue of tradingsymbol
-
RE: Websoket running giving below Error
User websocketv2 api
sws = SmartWebSocketV2(
auth_token=self.auth_token,
api_key=self.api_key,
client_code=self.client_id,
feed_token=self.feed_token,
) -
RE: "YOUR USER ID OR PASSWORD IS INVALID","errorcode":"AB1007"
@admin GIRG1088 user name password invalid
-
RE: "YOUR USER ID OR PASSWORD IS INVALID","errorcode":"AB1007"
GIRG1088 username password invalid. Pls do needful