Predict API (Beta)
  1. WebSocket
Predict API (Beta)
  • FAQs
  • Deployed Contracts
  • Guides
    • Understanding the Orderbook
    • [TS] How to authenticate your API requests
    • [PY] How to authenticate your API requests
    • How to create or cancel orders
  • Authorization
    • Get auth message
      GET
    • Get JWT with valid signature
      POST
  • Accounts
    • Get connected account
      GET
    • Get account activity
      GET
    • Set a referral
      POST
  • Orders
    • Get order by hash
      GET
    • Get orders
      GET
    • Get order match events
      GET
    • Create an order
      POST
    • Remove orders from the orderbook
      POST
  • Categories
    • Get categories
      GET
    • Get category by slug
      GET
  • Markets
    • Get markets
    • Get market by ID
    • Get market statistics
    • Get market last sale information
    • Get the orderbook for a market
  • Positions
    • Get positions
  • OAuth
    • Finalize a OAuth connection
    • Get the orders for a OAuth connection
    • Create an order for a OAuth connection
    • Cancel the orders for a OAuth connection
    • Get the positions for a OAuth connection
  • WebSocket
    • General Information
    • Request Format
    • Response Format
    • Subscription Topics
    • Heartbeats
    • Client Example
  1. WebSocket

Heartbeats

Heartbeat Mechanism#

To maintain an active connection, the server implements a heartbeat mechanism.
1.
Server Probe: Every 15 seconds, the server sends:
{ "type": "M", "topic": "heartbeat", "data": 1736696400000 }
2.
Client Response: The client must respond within the next 15 seconds with:
{ "method": "heartbeat", "data": 1736696400000 }
Note: The data value must match the timestamp received from the server.
Failure to respond to the heartbeat will result in the server terminating the connection.
Modified at 2026-01-12 15:31:00
Previous
Subscription Topics
Next
Client Example
Built with