使用Python和Websockets实时流式传输股市数据



在此视频中,我们使用websockets和我们的Alpaca API密钥从polygon.io流式传输股票市场数据。我们同时使用wscat和Python Websocket客户端进行连接。 。

9 comments
  1. Hi Larry, perhaps you have an answer, I cannot authenticate via the terminal. Thanks for your help.
    > (base) MacBook-Pro-GJ:~ gj$ wscat -c wss://alpaca.socket.polygon.io/stocks

    Connected (press CTRL+C to quit)

    < [{"ev":"status","status":"connected","message":"Connected Successfully"}]

    > {"action":"auth","params":"I use my key here"}

    < [{"ev":"status","status":"auth_failed","message":"authentication failed"}]

  2. Fantastic video. Very educational. appreciate the time taken to make these videos and make the content easy to use. Just started working with the Alpaca API last week so having the Polygon data feeding into it will be a nice complement. Keep the videos coming please.

Comments are closed.