Getting Started
Quick Start
Register, get your API key, and make your first call in under 2 minutes
1. Get your API key
Visit the dashboard and sign in with Google. Your API key is displayed automatically.
Alternatively, register via the API:
curl -s -X POST https://prediction-router-api.kalashshah47.workers.dev/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'Response:
{
"userId": "a1b2c3...",
"apiKey": "pr_..."
}Save your apiKey — it is shown only once.
2. Search markets
curl -s "https://prediction-router-api.kalashshah47.workers.dev/v1/markets?platform=polymarket&q=election&limit=3" \
-H "Authorization: Bearer pr_..."Response:
{
"markets": [
{
"id": "540817",
"platform": "polymarket",
"title": "Will the 2028 US election...",
"outcomes": [
{ "id": "0", "label": "Yes", "probability": 0.62, "price": 0.62 },
{ "id": "1", "label": "No", "probability": 0.38, "price": 0.38 }
],
"status": "open",
"volume": 15000,
"url": "https://polymarket.com/event/..."
}
]
}3. Connect a platform (for trading)
To place orders or read account data you need to connect a platform account first. For Polymarket, follow the two-step Deposit Wallet connect flow. For Kalshi the credential is <keyId>:<base64(PEM)>:
curl -s -X POST "https://prediction-router-api.kalashshah47.workers.dev/v1/platform-accounts" \
-H "Authorization: Bearer pr_..." \
-H "Content-Type: application/json" \
-d '{
"platform": "kalshi",
"label": "Main account",
"credential": "your-key-id:base64-encoded-pem"
}'Response — save the id, you can pass it as account_id to target this account:
{ "account": { "id": "8f3c1a2b-...", "platform": "kalshi", "label": "Main account" } }4. Place an order
curl -s -X POST "https://prediction-router-api.kalashshah47.workers.dev/v1/orders" \
-H "Authorization: Bearer pr_..." \
-H "Content-Type: application/json" \
-d '{
"platform": "kalshi",
"marketId": "KXETHD-24",
"outcomeId": "yes",
"side": "buy",
"amount": 10,
"price": 0.60
}'Response:
{
"order": {
"id": "ord_...",
"platform": "kalshi",
"side": "buy",
"amount": 10,
"price": 0.60,
"status": "open",
"createdAt": "2026-06-19T10:00:00Z"
}
}