Fetch detailed information for a specific prediction market, including optional price history and recent trades.
Endpoint
GET https://app.kash.bot/api/markets/{id}
Path Parameters
The unique market identifier
Query Parameters
Include price history snapshots (up to 100 data points)
Number of recent trades to return (max: 100). Only applies when trades=true
Response
Complete market details
Current YES probability (0-1)
Total trading volume in cents
Market status: OPEN, FROZEN, RESOLVED, CANCELLED
Market end time (Unix timestamp in milliseconds)
ISO 8601 timestamp of market creation
URL of the original market tweet
Price history data (only if history=true)
Price history snapshots (only included if history=true)
Price at this timestamp (0-1)
Probability at this timestamp (0-1)
Cumulative volume at this timestamp
Recent trades (only included if trades=true)
Rate Limit
100 requests per minute per IP address
Example Request
curl "https://app.kash.bot/api/markets/abc123"
Example Response
{
"market": {
"id": "abc123",
"question": "Will BTC hit $100k by end of 2025?",
"description": "Resolves YES if Bitcoin reaches $100,000 USD on any major exchange before December 31, 2025",
"probability": 0.72,
"yesPrice": 0.72,
"noPrice": 0.28,
"totalVolume": 1250000,
"tradeCount": 450,
"status": "OPEN",
"endTime": 1735689600000,
"category": "crypto",
"createdAt": "2024-01-01T00:00:00Z",
"sourceTweetUrl": "https://x.com/kash_bot/status/123456789"
},
"_meta": {
"requestedAt": "2025-01-15T12:00:00Z",
"includes": {
"history": false,
"trades": false,
"tradesCount": 0
}
}
}
200 - With History & Trades
{
"market": {
"id": "abc123",
"question": "Will BTC hit $100k by end of 2025?",
"probability": 0.72,
"priceHistory": [
{ "timestamp": 1705320000000, "probability": 0.72 },
{ "timestamp": 1705233600000, "probability": 0.68 },
{ "timestamp": 1705147200000, "probability": 0.65 }
]
},
"priceHistory": [
{ "timestamp": "2025-01-15T12:00:00Z", "price": 0.72, "probability": 0.72, "volume": 1250000 },
{ "timestamp": "2025-01-14T12:00:00Z", "price": 0.68, "probability": 0.68, "volume": 1100000 }
],
"recentTrades": [
{ "id": "trade-1", "side": "YES", "amount": 5000, "price": 0.72, "timestamp": "2025-01-15T11:30:00Z" },
{ "id": "trade-2", "side": "NO", "amount": 2500, "price": 0.28, "timestamp": "2025-01-15T11:15:00Z" }
],
"_meta": {
"requestedAt": "2025-01-15T12:00:00Z",
"includes": {
"history": true,
"trades": true,
"tradesCount": 2
}
}
}
{
"error": "Market not found"
}
Use Cases
Display Market Details
async function displayMarket(marketId) {
const res = await fetch(`https://app.kash.bot/api/markets/${marketId}`);
const { market } = await res.json();
return {
title: market.question,
probability: `${(market.probability * 100).toFixed(0)}% YES`,
volume: `$${(market.totalVolume / 100).toLocaleString()}`,
status: market.status
};
}
Build a Price Chart
async function getChartData(marketId) {
const res = await fetch(`https://app.kash.bot/api/markets/${marketId}?history=true`);
const { priceHistory } = await res.json();
return priceHistory.map(point => ({
x: new Date(point.timestamp),
y: point.probability * 100
}));
}