Skip to main content

Connection

Connect to the Manifold WebSocket endpoint:
wss://api.delphiterminal.co/ws/mani?api_key=YOUR_API_KEY
PropertyValue
ProtocolWebSocket (wss://)
Authenticationapi_key query parameter
KeepalivePing every 54 seconds
Timeout60 seconds without pong
Max Message Size16 KB

Subscribing to markets

Once connected, send a JSON message to subscribe using market_id:
{
  "action": "subscribe",
  "market_ids": ["Iz0lRpO85N", "SdZ6A2IZ88"],
  "message_types": ["prices", "orderbook", "trades"]
}
FieldTypeRequiredDescription
actionstringYessubscribe or unsubscribe
market_idsarrayYesArray of Manifold market identifiers (slug strings)
message_typesarrayNo["prices"], ["orderbook"], ["trades"], or any combination. Defaults to prices and orderbook if omitted

Unsubscribing

{
  "action": "unsubscribe",
  "market_ids": ["Iz0lRpO85N"]
}

Message types

Price messages

{
  "type": "prices",
  "data": {
    "venue": "MANI",
    "market_id": "Iz0lRpO85N",
    "server_time": 1774762511552,
    "ingest_time": 1774762511553,
    "payload": {
      "type": "Ticker",
      "Ticker": {
        "price": 0.67,
        "yes_bid": 0.66,
        "yes_ask": 0.68,
        "volume": 0,
        "open_interest": 0
      }
    }
  }
}

Orderbook messages

{
  "type": "orderbook",
  "data": {
    "exchange": "MANI",
    "market_id": "Iz0lRpO85N",
    "yes_side": [100, 200, 300],
    "no_side": [50, 100, 150],
    "server_time": "2026-03-29T12:00:00Z"
  }
}

Trade messages

{
  "type": "trades",
  "data": {
    "venue": "MANI",
    "market_id": "Iz0lRpO85N",
    "server_time": 1774762511552,
    "payload": {
      "type": "Trade",
      "Trade": {
        "bet_id": "abc123",
        "outcome": "YES",
        "amount": 10.0,
        "shares": 14.82,
        "price": 0.676
      }
    }
  }
}

Full example

const ws = new WebSocket("wss://api.delphiterminal.co/ws/mani?api_key=YOUR_API_KEY");

ws.onopen = () => {
  console.log("Connected to Manifold WebSocket");

  ws.send(JSON.stringify({
    action: "subscribe",
    market_ids: ["Iz0lRpO85N"],
    message_types: ["prices", "orderbook", "trades"]
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);

  if (data.type === "prices") {
    console.log("Price update:", data.data);
  } else if (data.type === "orderbook") {
    console.log("Orderbook update:", data.data);
  } else if (data.type === "trades") {
    console.log("Trade:", data.data);
  }
};

ws.onclose = () => console.log("Disconnected");
ws.onerror = (error) => console.error("WebSocket error:", error);

Important notes

  • Authentication required via api_key query parameter
  • Use market_id (Manifold market identifier) to subscribe
  • Manifold data is sourced via REST polling (5–15s intervals), not native WebSocket
  • Messages are only sent for markets you have explicitly subscribed to
  • Trades must be explicitly requested (not included in the default subscription)