Skip to content

Instantly share code, notes, and snippets.

@ntuaha
Forked from frieadgood/fugle-realtime-api.py
Created September 18, 2019 05:16
Show Gist options
  • Save ntuaha/93bd19fa6c47d891feb7d38699813033 to your computer and use it in GitHub Desktop.
Save ntuaha/93bd19fa6c47d891feb7d38699813033 to your computer and use it in GitHub Desktop.
Fugle realtime API demo code(#2884)
import websocket
def on_message(ws, message):
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("### closed ###")
if __name__ == "__main__":
websocket.enableTrace(False)
ws = websocket.WebSocketApp("wss://api.fugle.tw/realtime/v0/intraday/quote?symbolId=2884&apiToken=demo",
on_message = on_message,
on_error = on_error,
on_close = on_close)
ws.run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment