Skip to main content

Connection

wss://api.arbiterapi.com/v1/ws?api_key=YOUR_API_KEY

Subscribing

Send a JSON message to subscribe to a channel for a specific market:
{
  "subscribe": "trades",
  "market_id": "poly_0x24fb..."
}

Available Channels

ChannelDataExample
tradesReal-time trade executionPrice, size, side, timestamp
pricesPrice changesLatest price per market
orderbookOrderbook updatesBids/asks deltas

Wildcard Subscription

Subscribe to all markets on a channel:
{
  "subscribe": "trades",
  "market_id": "*"
}

Message Format

Trade Event

{
  "type": "trade",
  "market_id": "poly_0x24fb...",
  "platform": "polymarket",
  "price": 0.55,
  "size": 100.0,
  "side": "buy",
  "timestamp_ms": 1774399231269
}

Price Event

{
  "type": "price",
  "market_id": "poly_0x24fb...",
  "platform": "polymarket",
  "price": 0.56,
  "timestamp_ms": 1774399231500
}

Unsubscribing

{
  "unsubscribe": "trades",
  "market_id": "poly_0x24fb..."
}

Example: Node.js

import WebSocket from 'ws';

const ws = new WebSocket('wss://api.arbiterapi.com/v1/ws?api_key=YOUR_KEY');

ws.on('open', () => {
  ws.send(JSON.stringify({
    subscribe: 'trades',
    market_id: '*'
  }));
});

ws.on('message', (data) => {
  const event = JSON.parse(data.toString());
  console.log(`${event.market_id}: ${event.price} (${event.side})`);
});

Example: Python

import asyncio
import websockets
import json

async def stream():
    uri = "wss://api.arbiterapi.com/v1/ws?api_key=YOUR_KEY"
    async with websockets.connect(uri) as ws:
        await ws.send(json.dumps({
            "subscribe": "trades",
            "market_id": "*"
        }))
        async for msg in ws:
            event = json.loads(msg)
            print(f"{event['market_id']}: {event['price']} ({event['side']})")

asyncio.run(stream())