Skip to main content
GET
/
v1
/
prices
{
  "success": true,
  "data": [
    {
      "timestamp": "<string>",
      "open": 123,
      "high": 123,
      "low": 123,
      "close": 123,
      "volume": 123
    }
  ]
}

Get Prices

Retrieve real-time prices and historical price data for markets.

Real-Time Prices

Endpoint

GET https://api.matchr.xyz/v1/prices

Query Parameters

market_ids
string
required
Comma-separated list of market IDs (max: 50)
include_orderbook
boolean
default:"false"
Include top-of-book bid/ask

Example Request

curl -X GET "https://api.matchr.xyz/v1/prices?market_ids=mkt_yes123,mkt_no123&include_orderbook=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "mkt_yes123": {
      "price": 0.52,
      "best_bid": 0.51,
      "best_ask": 0.53,
      "spread": 0.02,
      "change_24h": 0.03,
      "change_pct_24h": 6.12,
      "volume_24h": 250000,
      "last_trade": "2024-10-15T14:28:45Z",
      "updated_at": "2024-10-15T14:30:00Z"
    },
    "mkt_no123": {
      "price": 0.48,
      "best_bid": 0.47,
      "best_ask": 0.49,
      "spread": 0.02,
      "change_24h": -0.03,
      "change_pct_24h": -5.88,
      "volume_24h": 200000,
      "last_trade": "2024-10-15T14:27:30Z",
      "updated_at": "2024-10-15T14:30:00Z"
    }
  },
  "timestamp": "2024-10-15T14:30:00Z"
}

Historical Prices

Endpoint

GET https://api.matchr.xyz/v1/prices/history

Query Parameters

market_id
string
required
Market ID to fetch history for
interval
string
default:"1h"
Time interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w
start
string
Start time (ISO 8601 or Unix timestamp)
end
string
End time (ISO 8601 or Unix timestamp)
limit
number
default:"100"
Number of data points (max: 1000)

Example Request

curl -X GET "https://api.matchr.xyz/v1/prices/history?market_id=mkt_yes123&interval=1h&limit=24" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
Whether the request succeeded
data
array
Array of OHLCV candles

Example Response

{
  "success": true,
  "data": [
    {
      "timestamp": "2024-10-15T00:00:00Z",
      "open": 0.49,
      "high": 0.53,
      "low": 0.48,
      "close": 0.52,
      "volume": 45000
    },
    {
      "timestamp": "2024-10-15T01:00:00Z",
      "open": 0.52,
      "high": 0.54,
      "low": 0.51,
      "close": 0.53,
      "volume": 38000
    },
    {
      "timestamp": "2024-10-15T02:00:00Z",
      "open": 0.53,
      "high": 0.55,
      "low": 0.52,
      "close": 0.52,
      "volume": 52000
    }
  ],
  "meta": {
    "market_id": "mkt_yes123",
    "interval": "1h",
    "start": "2024-10-15T00:00:00Z",
    "end": "2024-10-15T23:00:00Z"
  }
}

Cross-Platform Price Comparison

Compare prices across platforms for matched markets.

Endpoint

GET https://api.matchr.xyz/v1/prices/compare

Query Parameters

event_id
string
required
Event ID to compare prices for

Example Request

curl -X GET "https://api.matchr.xyz/v1/prices/compare?event_id=evt_123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "event_id": "evt_123",
    "title": "Will Trump win the 2024 election?",
    "platforms": {
      "polymarket": {
        "market_id": "mkt_poly_123",
        "yes_price": 0.52,
        "no_price": 0.48,
        "volume_24h": 500000,
        "liquidity": 150000
      },
      "kalshi": {
        "market_id": "mkt_kalshi_456",
        "yes_price": 0.55,
        "no_price": 0.45,
        "volume_24h": 120000,
        "liquidity": 80000
      }
    },
    "spread_analysis": {
      "yes_spread": 0.03,
      "yes_spread_pct": 5.77,
      "best_yes_buy": "polymarket",
      "best_yes_sell": "kalshi",
      "arbitrage_opportunity": true
    }
  }
}

WebSocket Price Stream

Subscribe to real-time price updates via WebSocket.

Endpoint

wss://api.matchr.xyz/v1/prices/stream

Subscribe Message

{
  "action": "subscribe",
  "market_ids": ["mkt_yes123", "mkt_no123"]
}

Price Update Message

{
  "type": "price_update",
  "market_id": "mkt_yes123",
  "price": 0.53,
  "best_bid": 0.52,
  "best_ask": 0.54,
  "volume_24h": 255000,
  "timestamp": "2024-10-15T14:31:15Z"
}

Unsubscribe

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

Error Codes

CodeDescription
400Invalid query parameters
401Missing or invalid API key
404Market not found
429Rate limit exceeded
500Server error