curl --request GET \
--url https://api.example.com/v1/prices{
"success": true,
"data": [
{
"timestamp": "<string>",
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 123
}
]
}Fetch real-time and historical price data
curl --request GET \
--url https://api.example.com/v1/prices{
"success": true,
"data": [
{
"timestamp": "<string>",
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 123
}
]
}GET https://api.matchr.xyz/v1/prices
curl -X GET "https://api.matchr.xyz/v1/prices?market_ids=mkt_yes123,mkt_no123&include_orderbook=true" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"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"
}
GET https://api.matchr.xyz/v1/prices/history
1m, 5m, 15m, 1h, 4h, 1d, 1wcurl -X GET "https://api.matchr.xyz/v1/prices/history?market_id=mkt_yes123&interval=1h&limit=24" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"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"
}
}
GET https://api.matchr.xyz/v1/prices/compare
curl -X GET "https://api.matchr.xyz/v1/prices/compare?event_id=evt_123" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"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
}
}
}
wss://api.matchr.xyz/v1/prices/stream
{
"action": "subscribe",
"market_ids": ["mkt_yes123", "mkt_no123"]
}
{
"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"
}
{
"action": "unsubscribe",
"market_ids": ["mkt_yes123"]
}
| Code | Description |
|---|---|
400 | Invalid query parameters |
401 | Missing or invalid API key |
404 | Market not found |
429 | Rate limit exceeded |
500 | Server error |