Skip to content

Orderbook Data

Endpoints for accessing Central Limit Order Book data including prices, order books, and historical data.

Get Price

Get the current price for a specific token.

Endpoint: GET /public/api/v1/price

Query Parameters

  • token_id (required, string) - CTF token ID
  • side (required, string) - "BUY" or "SELL"

Example Request

curl "https://api.probable.markets/public/api/v1/price?token_id=0xabc123...&side=BUY"

Example Response

{
  "price": "0.65"
}

Get Prices

Get prices for multiple tokens in a single request.

Endpoint: POST /public/api/v1/prices

Request Body

[
  {
    "token_id": "0xabc123...",
    "side": "BUY"
  },
  {
    "token_id": "0xdef456...",
    "side": "SELL"
  }
]

Example Request

curl -X POST "https://api.probable.markets/public/api/v1/prices" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "token_id": "0xabc123...",
      "side": "BUY"
    },
    {
      "token_id": "0xdef456...",
      "side": "SELL"
    }
  ]'

Example Response

{
  "0xabc123...": {
    "BUY": "0.65",
    "SELL": "0.60"
  },
  "0xdef456...": {
    "BUY": "0.45",
    "SELL": "0.40"
  }
}

Get Midpoint

Get the midpoint price between bid and ask for a token.

Endpoint: GET /public/api/v1/midpoint

Query Parameters

  • token_id (required, string) - CTF token ID

Example Request

curl "https://api.probable.markets/public/api/v1/midpoint?token_id=0xabc123..."

Example Response

{
  "mid": "0.625"
}

Get Order Book

Get the complete order book (bids and asks) for a token.

Endpoint: GET /public/api/v1/book

Query Parameters

  • token_id (required, string) - CTF token ID

Example Request

curl "https://api.probable.markets/public/api/v1/book?token_id=0xabc123..."

Example Response

{
  "market": "BTC-USD",
  "asset_id": "0xabc123...",
  "timestamp": "1705312200",
  "hash": "0xdef456...",
  "bids": [
    {
      "price": "0.65",
      "size": "1000"
    },
    {
      "price": "0.64",
      "size": "500"
    }
  ],
  "asks": [
    {
      "price": "0.66",
      "size": "800"
    },
    {
      "price": "0.67",
      "size": "1200"
    }
  ],
  "min_order_size": "0.01",
  "tick_size": "0.001",
  "neg_risk": false
}

Price History

Get historical price data for a token.

Endpoint: GET /public/api/v1/prices-history

Query Parameters

  • market (required, string) - Market identifier (asset id)
  • startTs (optional, number) - Start timestamp
  • endTs (optional, number) - End timestamp
  • interval (optional, string) - Time interval: "max", "1m", "1h", "6h", "1d", "1w"
  • fidelity (optional, number) - Data fidelity level

Example Request

curl "https://api.probable.markets/public/api/v1/prices-history?market=0xabc123...&interval=1h&startTs=1705312200&endTs=1705315800"

Example Response

{
  "history": [
    {
      "t": 1705312200,
      "p": 0.65
    },
    {
      "t": 1705315800,
      "p": 0.66
    }
  ]
}

Interval Options

  • max - Maximum available data
  • 1m - 1 minute intervals
  • 1h - 1 hour intervals
  • 6h - 6 hour intervals
  • 1d - 1 day intervals
  • 1w - 1 week intervals