Fetches a paginated list of all available prediction market threads.
Endpoint
GET https://app.kash.bot/api/threads
Query Parameters
Filter by thread status. Options: active, upcoming, completed, resolved, cancelled, paused
Filter by category (e.g., politics, crypto, sports)
Comma-separated list of tags to filter by (e.g., election,2024)
Maximum number of results per page (max: 100)
Pagination offset for fetching subsequent pages
sortBy
string
default:"created_at"
Field to sort by. Options: created_at, updated_at, total_volume, market_count, title
Sort direction. Options: asc, desc
Response
Array of thread objects
Thread description (optional)
Total trading volume across all markets in cents
Number of markets in this thread
Number of unique participants
Thread start time (Unix timestamp in seconds)
Thread end time (Unix timestamp in seconds)
Current status: active, upcoming, completed, resolved, cancelled, paused
ISO 8601 timestamp of thread creation
ISO 8601 timestamp of last update
Pagination metadata
Total number of matching threads
Whether more results are available
Rate Limit
50 requests per minute per IP address
Example Request
curl "https://app.kash.bot/api/threads?status=active&limit=10&sortBy=total_volume&sortOrder=desc"
Example Response
{
"threads": [
{
"id": "abc123-def456",
"title": "2024 Election Predictions",
"description": "Markets for the 2024 US Presidential Election",
"totalVolume": 1250000,
"marketCount": 12,
"participantCount": 342,
"startTime": 1704067200,
"endTime": 1735689600,
"status": "active",
"category": "politics",
"tags": ["election", "politics", "2024"],
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T12:30:00Z"
},
{
"id": "xyz789-abc123",
"title": "Crypto Price Predictions 2024",
"description": "Will Bitcoin reach $100k?",
"totalVolume": 980000,
"marketCount": 8,
"participantCount": 256,
"startTime": 1704067200,
"endTime": 1735689600,
"status": "active",
"category": "crypto",
"tags": ["bitcoin", "crypto", "2024"],
"createdAt": "2024-01-05T00:00:00Z",
"updatedAt": "2024-01-16T08:15:00Z"
}
],
"pagination": {
"offset": 0,
"limit": 10,
"total": 25,
"hasMore": true
},
"_meta": {
"authenticated": false,
"requestedAt": "2024-01-16T12:00:00Z"
}
}
{
"error": "Invalid query parameters",
"message": "limit must be between 1 and 100",
"code": "INVALID_REQUEST"
}
429 - Rate Limit Exceeded
{
"error": "Too many requests",
"message": "Rate limit of 50 requests per minute exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 45
}
All responses include rate limit headers:
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704067260000
Access-Control-Allow-Origin: *
Common Use Cases
Fetch active threads with high volume
curl "https://app.kash.bot/api/threads?status=active&sortBy=total_volume&sortOrder=desc&limit=5"
curl "https://app.kash.bot/api/threads?category=politics&tags=election,2024"
Paginate through all threads
async function fetchAllThreads() {
let allThreads = [];
let offset = 0;
let hasMore = true;
while (hasMore) {
const response = await fetch(
`https://app.kash.bot/api/threads?limit=100&offset=${offset}`
);
const data = await response.json();
allThreads = allThreads.concat(data.threads);
hasMore = data.pagination.hasMore;
offset += 100;
}
return allThreads;
}