Token List downLoad
-
from smartapi import SmartConnect
from smartapi import WebSocketobj=SmartConnect(api_key="")
data = obj.generateSession("","")
feedToken=obj.getfeedToken()WebSocket
token="nse_cm|2885"
ss = WebSocket(feedToken,"")def on_tick(ws, tick):
print(tick)def on_connect(ws, response):
ws.send_request(token)def on_close(ws, code, reason):
ws.stop()Assign the callbacks.
ss.on_ticks = on_tick
ss.on_connect = on_connect
ss.on_close = on_closess.connect()
-
<function on_connect at 0x000001716110FEE0>
getting above error
-
HI @Heena-Shah Please do not share your private credential publicly here.
-
hi @Heena-Shah we will update the web socket code soon.
-
@admin when will b new updated websocket code available
-
Hi @Heena-Shah we will update the code in this code.we will update you once we do that.
-
@admin
token="nse_cm|2885"
task="sfi" # mw|sfi|dpobj=SmartConnect(api_key=api_key)
login = obj.generateSession(client_code,your_password)
#refreshToken= login['data']['refreshToken']
feedToken=obj.getfeedToken()#userProfile= obj.getProfile(refreshToken)
ss = WebSocket(feedToken,client_code)def on_tick(ws, tick):
print("Ticks: {}".format(tick))def on_connect(ws, response):
ws.websocket_connection()
ws.send_request(token,task)def on_close(ws, code, reason):
ws.stop()Assign the callbacks.
ss.on_ticks = on_tick
ss.on_connect = on_connect
ss.on_close = on_closep1 = multiprocessing.Process(target = ss.connect())
sys.exit()
p1.start()Getting only...
<function on_connect at 0x00000227435DFEE0>
Ticks: [{'ak': 'nk', 'msg': 'sfi', 'task': 'sfi'}] -
Hi @Heena-Shah which version of sdk you are using.
-
@admin
python 3.8.3 -
smartapi-python
version
1.2.6 -
@admin
Login error{'status': False, 'message': 'Login Id or password is invalid', 'errorcode': 'AB1007', 'data': None}
-
Do I need to register for market feed??
Do I need to refresh api_key and password every day??
-
@Heena-Shah
Firstly, there's a possibility that you data hasn't been migrated. Communicate issue here, and the Angel team will let you know if you can access APIs with the account you are using. You only need to tell them the client code. I am not sure if they've completed migration.Secondly, try using the APIs instead of library Angel has provided. I had issues using the library, but, could use APIs smoothly.
You don't need sign up for SmartAPI to get market feed. It is free. It is just that you need to sign up. You don't need to refresh API key and password. However, you need to get a new jwttoken every day. It is with this token that you can use the APIs.
-
@shrikantshet
My account is new account created online not attached to any sub-brokers. Please check client code H104220Presently I am using Only Market feed app.
Order is still under development.
Do I still have to migrate my account?Once after migration , I can use web based desktop application
also at same time? -
Is my version of python & SmartAPI both ok??
-
Hi @Heena-Shah yes we need it also please go through the documentation https://smartapi.angelbroking.com/docs
-
@admin
My account is new account created online not attached to any sub-brokers.
Please check client code H104220 and migrate -
hi @Heena-Shah said in Token List downLoad:
My account is new account created online not attached to any sub-brokers.
Please check client code H104220 and migrateyour account is migrated.
-
@admin
generateSession error{'status': False, 'message': 'Login Id or password is invalid', 'errorcode': 'AB1007', 'data': None}
-
Hi @Heena-Shah Reset your password and try again.