Fetches detailed information for a single prediction market thread by its ID.
Endpoint
GET https://app.kash.bot/api/threads/:id
Path Parameters
The unique thread identifier (UUID format)
Response
Thread details object
Thread description (may include markdown)
Thread cover image URL (IPFS or CDN)
Background image URL for enhanced displays
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, optional)
Thread end time (Unix timestamp in seconds, optional)
Current status: active, upcoming, completed, resolved, cancelled, paused
Thread category (e.g., politics, crypto, sports)
Array of tag strings for filtering and discovery
ISO 8601 timestamp of thread creation
ISO 8601 timestamp of last update
Request metadata
Whether the request was authenticated
ISO 8601 timestamp of request processing
Rate Limit
100 requests per minute per IP address
Example Request
curl "https://app.kash.bot/api/threads/abc123-def456"
Example Response
{
"thread": {
"id": "abc123-def456",
"title": "2024 Election Predictions",
"description": "Make predictions on the 2024 US Presidential Election and related political events.",
"image": "https://ipfs.io/ipfs/QmXyz...",
"backgroundImage": "https://ipfs.io/ipfs/QmAbc...",
"totalVolume": 1250000,
"marketCount": 12,
"participantCount": 342,
"startTime": 1704067200,
"endTime": 1735689600,
"status": "active",
"category": "politics",
"tags": ["election", "politics", "2024", "usa"],
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T12:30:00Z"
},
"_meta": {
"authenticated": false,
"requestedAt": "2024-01-16T12:00:00Z"
}
}
{
"error": "Thread not found",
"message": "No thread exists with ID: abc123-def456",
"code": "THREAD_NOT_FOUND"
}
429 - Rate Limit Exceeded
{
"error": "Too many requests",
"message": "Rate limit of 100 requests per minute exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 45
}
All responses include rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1704067260000
Access-Control-Allow-Origin: *
Common Use Cases
Fetch thread before embedding
Before embedding a thread iframe, fetch its details to display metadata:
async function embedThread(threadId) {
// Fetch thread details
const response = await fetch(`https://app.kash.bot/api/threads/${threadId}`);
const { thread } = await response.json();
// Display thread info above iframe
document.getElementById('thread-title').textContent = thread.title;
document.getElementById('thread-stats').textContent =
`${thread.marketCount} markets • ${thread.participantCount} participants`;
// Embed iframe
const iframe = document.createElement('iframe');
iframe.src = `https://app.kash.bot/threads/${threadId}/iframe`;
iframe.width = '100%';
iframe.height = '900';
document.getElementById('embed-container').appendChild(iframe);
}
Check thread status before displaying
Avoid embedding inactive threads:
const { thread } = await fetch(`https://app.kash.bot/api/threads/${threadId}`)
.then(r => r.json());
if (thread.status !== 'active') {
console.log('Thread is not active, showing fallback content');
return;
}
// Proceed with embedding
Build custom thread cards
Create custom UI cards with thread data:
function ThreadCard({ threadId }) {
const [thread, setThread] = useState(null);
useEffect(() => {
fetch(`https://app.kash.bot/api/threads/${threadId}`)
.then(r => r.json())
.then(data => setThread(data.thread));
}, [threadId]);
if (!thread) return <div>Loading...</div>;
return (
<div className="thread-card">
<img src={thread.image} alt={thread.title} />
<h3>{thread.title}</h3>
<p>{thread.description}</p>
<div className="stats">
<span>{thread.marketCount} markets</span>
<span>${(thread.totalVolume / 100).toLocaleString()} volume</span>
</div>
</div>
);
}