finnhubio / Finnhub-API

Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals and alternative data. https://finnhub.io/docs/api
98 stars 6 forks source link

websocket do not work as expected #35

Closed pycoder2020 closed 4 years ago

pycoder2020 commented 4 years ago

Tried to use websocket example from https://finnhub.io/docs/api#websocket-price

Modified subscribe list to single symbol

def on_open(ws):
    ws.send('{"type":"subscribe","symbol":"TTWO"}')

Output:

-----------------------
--- response header ---
HTTP/1.1 101 Switching Protocols
Server: nginx/1.10.3
Date: Wed, 18 Mar 2020 15:33:24 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: MZmnDtR4tRzskkGxPPDJUI3bzwE=
-----------------------
send: b'\x81\xa4\xf8\xaa#\xa4\x83\x88W\xdd\x88\xcf\x01\x9e\xda\xd9V\xc6\x8b\xc9Q\xcd\x9a\xcf\x01\x88\xda\xd9Z\xc9\x9a\xc5O\x86\xc2\x88w\xf0\xaf\xe5\x01\xd9'
{"type":"ping"}
{"type":"ping"}
{"type":"ping"}
{"type":"ping"}

No data just ping.

finnhubio commented 4 years ago

trading has been halted due to the big drop.