Skip to content
Back to Markets

API Documentation

Build on Kayxa with our REST API and WebSocket feeds. Create trading bots, custom dashboards, and integrations.

Get an API Key

Create scoped keys with specific permissions.

Manage Keys

Authentication

Pass API key via <1>X-Api-Key</1> header.

Base URL

/api/v1

API Key Scopes

ScopeAccess LevelRisk
readGET on markets, positions, leaderboardLow
tradeExecute market tradesHigh
ordersCreate/cancel limit ordersHigh
balanceView/manage balanceHigh
alertsCreate/delete price alertsMedium
exportCSV export endpointsLow

Markets

Browse, search, and fetch market data including prices, order books, holders, and comments.

GET/api/v1/markets
GET/api/v1/markets/:id
GET/api/v1/markets/:id/prices
GET/api/v1/markets/:id/merged-book
GET/api/v1/markets/:id/comments
GET/api/v1/markets/:id/top-holders

Trading

Execute trades, get quotes, manage limit orders, view P&L, and split/merge positions.

POST/api/v1/trades/execute
POST/api/v1/trades/quote
GET/api/v1/positions
GET/api/v1/positions/live
POST/api/v1/orders
GET/api/v1/orders
DELETE/api/v1/orders/:id
POST/api/v1/positions/split
POST/api/v1/positions/merge

Account

Balance management, authentication, and user profile.

GET/api/v1/balance
POST/api/v1/auth/siwe
GET/api/v1/users/me
GET/api/v1/leaderboard

Withdrawals

Create, track, and cancel withdrawal requests across multiple rails.

GET/api/v1/withdrawals/rails
POST/api/v1/withdrawals
GET/api/v1/withdrawals
GET/api/v1/withdrawals/:id
POST/api/v1/withdrawals/:id/cancel
GET/api/v1/withdrawals/stats

Referral

Apply referral codes, check status, and view referral earnings.

POST/api/v1/referral/apply
GET/api/v1/referral/status
GET/api/v1/referral/stats

Compliance

Policy acceptance, risk disclosure status, and regulatory checks.

GET/api/v1/compliance/policies
GET/api/v1/compliance/status
POST/api/v1/compliance/accept
GET/api/v1/compliance/risk-disclosure/status
POST/api/v1/compliance/risk-disclosure/accept

Activity Feed

Global trade feed and top trades by notional USD with time windows.

GET/api/v1/activity/global
GET/api/v1/activity/global/top

Real-Time

WebSocket subscriptions and Server-Sent Events for live data.

WS/ws
SSE/api/v1/stream/pulse

Rate Limits

Standard Tier

120 requests/minute

Premium Tier

600 requests/minute

Auth Endpoints

10 requests/minute

Rate limit headers (<1>X-RateLimit-Remaining</1>) are included in all API responses.

WebSocket Quick Start

// Connect to WebSocket
const ws = new WebSocket('wss://your-api-host/ws');

// Subscribe to a market
ws.send(JSON.stringify({
  type: 'subscribe',
  channel: 'market:<address>'
}));

// Subscribe to all trades
ws.send(JSON.stringify({
  type: 'subscribe',
  channel: 'global:trades'
}));

// Ping/pong keepalive
ws.send(JSON.stringify({ type: 'ping' }));

Available channels: <1>market:&lt;address&gt;</1>, <2>global:markets</2>, <3>global:trades</3>

Ready to build?

Create your API key and start building integrations on Kayxa.

Create API Key

Kayxa REST and WebSocket API Documentation

The Kayxa API provides programmatic access to all market data, trade execution, account balances, and position information on the platform. Developers can integrate Kayxa prediction market data into their own applications, build trading bots, create analytics dashboards, and automate strategies using the REST and WebSocket APIs. All API endpoints are rate-limited and require authentication via API keys generated in your account settings.

The REST API supports market listing, individual market lookup by slug or contract address, real-time price data, order book snapshots, and historical trade logs. Authentication is handled via bearer tokens in the Authorization header. All responses are JSON-formatted. Markets are identified by their on-chain contract address on Polygon or by the slug format asset-updown-timeframe-timestamp. The API supports GET requests for data retrieval and POST requests for trade execution when using a valid API key with trading permissions.

The WebSocket API provides real-time streaming data for market price changes, trade events, and order book updates. Connect to the WebSocket endpoint and subscribe to specific market channels or the global trades feed to receive low-latency updates as they happen. WebSocket connections support ping/pong keepalive to maintain persistent connections. Market data is pushed whenever a trade occurs, a market resolves, or a new market is created by the rolling market worker. Use the global:markets channel to receive notifications when new 15-minute markets are created for BTC, ETH, SOL, XRP, DOGE, BNB, HYPE, and MSTR.

Kayxa is built on Polygon blockchain with smart contracts written in Solidity. The BinaryMarket.sol contract handles individual market logic including buy, resolve, and claim functions. The KayxaCore.sol factory contract manages market creation and admin credit operations. All on-chain transactions are executed by the admin wallet so API users never need to manage private keys or pay gas fees. Balances are tracked off-chain in USDC and settled on-chain during deposit and withdrawal operations. Chainlink oracle price feeds on Polygon mainnet power automated market resolution for all crypto price prediction markets.