zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
981 stars 469 forks source link

is it possible to understand the simple way to consume Streaming Quote #82

Closed WhiteBlackGray closed 4 years ago

WhiteBlackGray commented 4 years ago

Zerodha Streaming Quote is a greek. Cannot consume it. I failed doing this 100 times.

vividvilla commented 4 years ago

Have you checked these examples - https://github.com/zerodhatech/pykiteconnect/blob/master/examples/ticker.py and https://github.com/zerodhatech/pykiteconnect/blob/master/examples/threaded_ticker.py

Threading in Python is bit more advanced topic so I would advice you to check that before implementing ticker in your application.

WhiteBlackGray commented 4 years ago

getting error ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))

vividvilla commented 4 years ago

Do you have Kite connect subscription? if yes then you need to use your creds to obtain access_token and send it. You can read about it here - https://kite.trade/docs/connect/v3/user/

Closing this thread since its not a technical discussion. You can reach to us on Kite trade forum - https://kite.trade/forum/

WhiteBlackGray commented 4 years ago

I Have Kite Connect subscription and yes i have obtain the access_token as well but still i am getting this error. You can close it but if its not the technical discussion then what would be? A simple streaming price functionality is not working and i can see 100s of query on the same. If you really want to hide the fact that its not user friendly and its not working fine, you can hide but fact will remain a fact.

vividvilla commented 4 years ago

The fact is there are hundreds of developers using the same API and API client successfully in production. In your case the issue seems like you are passing wrong access_token and haven't understood the login flow properly. If you post it on forum with the code someone can try explaining it to you better. Use issues here to raise any bug or vulnerability in code, not for seeking support.

edit: 403 - Forbidden is raised only when you are trying to connect with invalid access_token or api_key. Try sending some API call with same access_token and verify if its valid or not first.