API Reference
Markets
Search and fetch prediction markets across all platforms
All markets endpoints require Authorization: Bearer <key>.
Base URL: https://prediction-router-api.kalashshah47.workers.dev
GET /v1/markets
Search markets on a platform.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | polymarket or kalshi |
q | string | Keyword search | |
status | string | open closed resolved | |
limit | integer | Max results. Default 20, max 100 | |
offset | integer | Pagination offset. Default 0 |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/markets?platform=polymarket&q=election&limit=2" \
-H "Authorization: Bearer pr_..."Response
{
"markets": [
{
"id": "540817",
"platform": "polymarket",
"title": "New Rihanna Album before GTA VI?",
"outcomes": [
{ "id": "0", "label": "Yes", "probability": 0.51, "price": 0.51 },
{ "id": "1", "label": "No", "probability": 0.49, "price": 0.49 }
],
"volume": 832995.13,
"liquidity": 14091.03,
"status": "open",
"resolution": null,
"closeTime": "2026-07-31",
"url": "https://polymarket.com/event/new-rhianna-album-before-gta-vi-926"
}
]
}See Sample Responses for live examples from every platform.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | platform missing or unknown |
GET /v1/markets/:id
Fetch a single market by ID. Responses are cached in KV for 60 seconds.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Platform-native market ID |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | ✓ | One of the supported platforms |
Example
curl "https://prediction-router-api.kalashshah47.workers.dev/v1/markets/KXFED-0325?platform=kalshi" \
-H "Authorization: Bearer pr_..."Response
{
"market": {
"id": "KXFED-0325",
"platform": "kalshi",
"title": "Fed rate cut in March?",
"outcomes": [
{ "id": "yes", "label": "Yes", "probability": 0.28, "price": 0.28 },
{ "id": "no", "label": "No", "probability": 0.72, "price": 0.72 }
],
"volume": 250000,
"status": "open",
"resolution": null,
"closeTime": "2025-03-20T18:00:00.000Z",
"url": "https://kalshi.com/markets/kxfed-0325"
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 404 | MARKET_NOT_FOUND | ID not found on platform |
| 400 | VALIDATION_ERROR | platform missing or unknown |
GET /v1/markets/:id/orderbook
Order books aren't available yet. Both Polymarket and Kalshi return 405 UNSUPPORTED_OPERATION. Use each market's outcomes[].price for current prices.
| Status | Code | Meaning |
|---|---|---|
| 405 | UNSUPPORTED_OPERATION | Order books are not available on this platform |