gexbot api
quant

websocket real-time feed

Provides real-time, low-latency market data via Azure Web PubSub WebSocket streams.

WSPOST /v2/negotiateQuant Tier

Provides real-time, low-latency market data via binary WebSocket streams.

Extended Python SDK & Samples →


1. Negotiation (POST /v2/negotiate)

Negotiate WebSocket connections by providing the analytics groups and spot price channels your application requires.

Request

Headers

NameTypeDescription
AuthorizationstringRequired. Format: "Bearer <YOUR_API_KEY>"
Content-TypestringRequired. Set to "application/json".
User-AgentstringRequired. Identify your client application.
AcceptstringRequired. Set to "application/json".

Request Body

FieldTypeDescription
groupsarray[string]Required. List of unprefixed group names (e.g. ["SPX_classic_gex_full", "SPX_spot", "QQQ_state_gamma_zero"]).
{
  "groups": [
    "SPX_classic_gex_full",
    "SPX_spot",
    "NDX_state_delta_zero",
    "ES_SPX_orderflow_orderflow"
  ]
}

Response

FieldTypeDescription
websocket_urlsobjectAn object containing the WebSocket connection URLs with embedded authentication tokens.
websocket_urls.v2_classicstringConnection URL for the Classic GEX hub.
websocket_urls.v2_state_gexstringConnection URL for the State GEX Profile hub.
websocket_urls.v2_state_greeks_zerostringConnection URL for the 0DTE State Greeks hub.
websocket_urls.v2_state_greeksstringConnection URL for the Aggregate State Greeks hub.
websocket_urls.v2_state_greeks_onestringConnection URL for the 1DTE State Greeks hub.
websocket_urls.v2_orderflowstringConnection URL for the Orderflow hub.
{
  "websocket_urls": {
    "v2_classic": "wss://ws.gex.bot:443/client/hubs/v2_classic?access_token=<...>",
    "v2_state_gex": "wss://ws.gex.bot:443/client/hubs/v2_state_gex?access_token=<...>",
    "v2_state_greeks_zero": "wss://ws.gex.bot:443/client/hubs/v2_state_greeks_zero?access_token=<...>",
    "v2_state_greeks": "wss://ws.gex.bot:443/client/hubs/v2_state_greeks?access_token=<...>",
    "v2_state_greeks_one": "wss://ws.gex.bot:443/client/hubs/v2_state_greeks_one?access_token=<...>",
    "v2_orderflow": "wss://ws.gex.bot:443/client/hubs/v2_orderflow?access_token=<...>"
  }
}
{
  "type": "object",
  "properties": {
    "websocket_urls": {
      "type": "object",
      "properties": {
        "v2_classic": { "type": "string", "format": "uri" },
        "v2_state_gex": { "type": "string", "format": "uri" },
        "v2_state_greeks_zero": { "type": "string", "format": "uri" },
        "v2_state_greeks": { "type": "string", "format": "uri" },
        "v2_state_greeks_one": { "type": "string", "format": "uri" },
        "v2_orderflow": { "type": "string", "format": "uri" }
      }
    }
  }
}

2. Dynamic Subscription Updates (PATCH /v2/negotiate)

Update group subscriptions on active WebSocket connections without reconnecting.

Request Body

{
  "groups": [
    { "hub": "v2_classic", "group": "NVDA_classic_gex_full" },
    { "hub": "v2_classic", "group": "NVDA_spot" }
  ]
}

Wire Format & Protobuf Decoding

Incoming binary WebSocket frames are compressed using Zstandard (zstd) and serialized with Protocol Buffers (protobuf).

Protobuf Schemas & Scaling Factors

  • SpotPrice (spot_price.proto):
    • spot: Divide integer value by 100 to obtain decimal price.
  • Gex (gex.proto):
    • spot, zero_gamma, major_positive, major_negative: Divide by 100.
    • sum_gex_vol, sum_gex_oi: Divide by 1,000.
  • OptionProfile (option_profile.proto):
    • Strike-by-strike IV quotes and classified trade volumes.
  • Orderflow (orderflow.proto):
    • Sub-second timestamped Net GEX, Aggregate DEX, and Net Convexity ticks.

Connection Guidelines

Best Practices

  • Server-Side Joining: In the V2 architecture, groups passed in POST /v2/negotiate are joined automatically on the server. Do not send client-side joinGroup messages.
  • Token Expiry: Authorized URLs expire after 15 minutes if not connected.
  • Concurrency: 1 active connection allowed per hub per Quant subscription key.
  • Market Hours: Live updates stream during regular US market hours (9:30 AM–4:00 PM ET).

On this page