Massive (formerly Polygon.io) · AsyncAPI Specification

Polygon WebSocket Streaming API

Version 1.0

Polygon real-time market data WebSocket clusters. Each asset class (stocks, options, indices, forex, crypto) has its own dedicated cluster at `wss://socket.polygon.io/{cluster}`. Clients authenticate by sending an `auth` action with their API key, then subscribe to one or more channels prefixed by event type and ticker (e.g. `T.AAPL`, `Q.AAPL`, `A.AAPL`, `AM.AAPL`).

View Spec View on GitHub FinanceFintechMarket DataStocksOptionsForexCryptoIndicesFuturesWebSocketReal-TimeHistoricalPublic APIsFinancial DataAsyncAPIEventsWebSockets

Channels

control
Client-to-server control messages (auth, subscribe, unsubscribe).
events
Server-to-client market data events.

Messages

✉
AuthMessage
Authenticate
Send API key to authenticate the WebSocket session.
✉
SubscribeMessage
Subscribe To Channels
✉
UnsubscribeMessage
Unsubscribe From Channels
✉
StatusMessage
Status Message
✉
TradeMessage
Trade Tick
✉
QuoteMessage
NBBO Quote Tick
✉
AggregateMessage
Aggregate (Per-Minute) Bar

Servers

wss
stocks
Stocks real-time cluster
wss
options
Options real-time cluster
wss
indices
Indices real-time cluster
wss
forex
Forex real-time cluster
wss
crypto
Crypto real-time cluster

AsyncAPI Specification

Raw ↑
asyncapi: 3.0.0
info:
  title: Polygon WebSocket Streaming API
  version: '1.0'
  description: |
    Polygon real-time market data WebSocket clusters. Each asset class
    (stocks, options, indices, forex, crypto) has its own dedicated
    cluster at `wss://socket.polygon.io/{cluster}`. Clients authenticate
    by sending an `auth` action with their API key, then subscribe to
    one or more channels prefixed by event type and ticker (e.g.
    `T.AAPL`, `Q.AAPL`, `A.AAPL`, `AM.AAPL`).
  contact:
    name: Polygon Documentation
    url: https://polygon.io/docs/stocks/ws_getting-started
defaultContentType: application/json
servers:
  stocks:
    host: socket.polygon.io
    pathname: /stocks
    protocol: wss
    description: Stocks real-time cluster
  options:
    host: socket.polygon.io
    pathname: /options
    protocol: wss
    description: Options real-time cluster
  indices:
    host: socket.polygon.io
    pathname: /indices
    protocol: wss
    description: Indices real-time cluster
  forex:
    host: socket.polygon.io
    pathname: /forex
    protocol: wss
    description: Forex real-time cluster
  crypto:
    host: socket.polygon.io
    pathname: /crypto
    protocol: wss
    description: Crypto real-time cluster
channels:
  control:
    address: control
    description: Client-to-server control messages (auth, subscribe, unsubscribe).
    messages:
      auth:
        $ref: '#/components/messages/AuthMessage'
      subscribe:
        $ref: '#/components/messages/SubscribeMessage'
      unsubscribe:
        $ref: '#/components/messages/UnsubscribeMessage'
  events:
    address: events
    description: Server-to-client market data events.
    messages:
      status:
        $ref: '#/components/messages/StatusMessage'
      trade:
        $ref: '#/components/messages/TradeMessage'
      quote:
        $ref: '#/components/messages/QuoteMessage'
      aggregateMinute:
        $ref: '#/components/messages/AggregateMessage'
operations:
  sendControl:
    action: send
    channel:
      $ref: '#/channels/control'
    messages:
      - $ref: '#/channels/control/messages/auth'
      - $ref: '#/channels/control/messages/subscribe'
      - $ref: '#/channels/control/messages/unsubscribe'
  receiveEvents:
    action: receive
    channel:
      $ref: '#/channels/events'
    messages:
      - $ref: '#/channels/events/messages/status'
      - $ref: '#/channels/events/messages/trade'
      - $ref: '#/channels/events/messages/quote'
      - $ref: '#/channels/events/messages/aggregateMinute'
components:
  messages:
    AuthMessage:
      name: Auth
      title: Authenticate
      summary: Send API key to authenticate the WebSocket session.
      payload:
        type: object
        required: [action, params]
        properties:
          action:
            type: string
            const: auth
          params:
            type: string
            description: The API key.
    SubscribeMessage:
      name: Subscribe
      title: Subscribe To Channels
      payload:
        type: object
        required: [action, params]
        properties:
          action:
            type: string
            const: subscribe
          params:
            type: string
            description: Comma-separated channel list, e.g. T.AAPL,Q.AAPL,A.AAPL.
    UnsubscribeMessage:
      name: Unsubscribe
      title: Unsubscribe From Channels
      payload:
        type: object
        required: [action, params]
        properties:
          action:
            type: string
            const: unsubscribe
          params:
            type: string
    StatusMessage:
      name: Status
      title: Status Message
      payload:
        type: object
        properties:
          ev:
            type: string
            const: status
          status:
            type: string
          message:
            type: string
    TradeMessage:
      name: Trade
      title: Trade Tick
      payload:
        type: object
        properties:
          ev:
            type: string
            const: T
          sym:
            type: string
          x:
            type: integer
            description: Exchange ID.
          i:
            type: string
            description: Trade ID.
          p:
            type: number
            description: Price.
          s:
            type: integer
            description: Size.
          c:
            type: array
            items:
              type: integer
            description: Trade conditions.
          t:
            type: integer
            format: int64
            description: SIP timestamp (ms).
    QuoteMessage:
      name: Quote
      title: NBBO Quote Tick
      payload:
        type: object
        properties:
          ev:
            type: string
            const: Q
          sym:
            type: string
          bx:
            type: integer
          bp:
            type: number
          bs:
            type: integer
          ax:
            type: integer
          ap:
            type: number
          as:
            type: integer
          t:
            type: integer
            format: int64
    AggregateMessage:
      name: AggregateMinute
      title: Aggregate (Per-Minute) Bar
      payload:
        type: object
        properties:
          ev:
            type: string
            enum: [A, AM]
          sym:
            type: string
          v:
            type: number
          av:
            type: number
          op:
            type: number
          vw:
            type: number
          o:
            type: number
          c:
            type: number
          h:
            type: number
          l:
            type: number
          a:
            type: number
          s:
            type: integer
            format: int64
          e:
            type: integer
            format: int64

Work with this as data

Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for asyncapi

4 MCP tools reach this
  • find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This AsyncAPI spec
curl "https://apis.io/api/v1/asyncapis/polygon-websocket-asyncapi"
All asyncapi
curl "https://apis.io/api/v1/asyncapis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.