Prediction Router
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

ParameterTypeRequiredDescription
platformstring✓polymarket or kalshi
qstringKeyword search
statusstringopen closed resolved
limitintegerMax results. Default 20, max 100
offsetintegerPagination 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

StatusCodeMeaning
400VALIDATION_ERRORplatform missing or unknown

GET /v1/markets/:id

Fetch a single market by ID. Responses are cached in KV for 60 seconds.

Path parameters

ParameterTypeRequiredDescription
idstring✓Platform-native market ID

Query parameters

ParameterTypeRequiredDescription
platformstring✓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

StatusCodeMeaning
404MARKET_NOT_FOUNDID not found on platform
400VALIDATION_ERRORplatform 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.

StatusCodeMeaning
405UNSUPPORTED_OPERATIONOrder books are not available on this platform