Skip to main content

How can I connect to a Polygon WebSocket?

Updated over 2 years ago

The Polygon.io Stocks WebSocket API provides streaming access to the latest stock market data from all US stock exchanges. You can specify which channels you want to consume by sending instructions in the form of actions. Our WebSockets emit events to notify you when an event has occurred in a channel you've subscribed to.

Our WebSocket APIs are based on entitlements that control which WebSocket Clusters you can connect to and which kinds of data you can access. Examples in the documentation include your API key, which only you can see, and are personalized based on your entitlements.

WebSockets are available through all of our paid subscriptions. You will need to connect, authenticate, and then subscribe to stream WebSocket messages. You can follow the steps in our documentation to help you get set up.

Our documentation examples use wscat to connect. However, we also have multiple sample libraries to help you connect using different programming languages.

Did this answer your question?