It looks like you're new here. If you want to get involved, click one of these buttons!
import requests
response = requests.get("https://api.kite.trade/instruments?api_key=v49n7lj7cvuknagb")
response
Output1:
Response [200]
My Code1:
kws = WebSocket("api_key", "public_token", "user_id")
Above 3 values are assigned already without any errors.
def on_tick(tick,ws):
print tick, "\n"
def on_connect(ws):
ws.subscribe([53287175])
ws.set_mode(ws.MODE_FULL,[53287175])
kws.on_tick = on_tick
kws.on_connect = on_connect
kws.connect()
Output1:kiteconnect.WebSocket object at 0x0000000003630780
You should be printing response.text. Not response object
Code 2.
The instrument token 53287175 is invalid. I tried with a valid token and it works fine. Please retry again
For Code2:
After checking on each of valid token of 4716033 & 25601, I am getting:
kiteconnect.WebSocket object at 0x000000000245B860
def on_connect(ws):
ws.subscribe([738561, 5633])
ws.set_mode(ws.MODE_FULL, [738561])
But the result is coming same(Just last 7 digits keep on changing):
kiteconnect.WebSocket object at 0x00000000037FD9B0
print tick, "\n"
def on_tick(tick,ws):
print tick, "\n"
Where's the difference?
Are you using python 3?