API Documentation
Overview
The Prediqt API provides programmatic access to prediction markets — place orders, query prices, manage positions, and stream real-time data. All market settlement happens on-chain on Polygon; the API handles off-chain order matching and data queries.
Base URL: https://api.prediqt.com
An interactive Swagger UI is available at https://api.prediqt.com/api-docs. It documents every endpoint, request body, and response schema.
Authentication
The API supports three authentication methods:
API Key
Create an API key from the Settings page in the app. Pass it via the x-api-key header:
curl -H "x-api-key: pm_live_your_key_here" \
https://api.prediqt.com/marketsBearer Token (Privy JWT)
If you authenticate through the web app, you receive a Privy JWT. Pass it via the Authorization header:
curl -H "Authorization: Bearer <token>" \
https://api.prediqt.com/ordersEIP-191 Signature
For wallet-based authentication without Privy, sign a message containing a timestamp with your wallet (EIP-191 personal sign) and send three headers:
x-address— Your wallet addressx-signature— EIP-191 personal sign of a message containing the timestampx-timestamp— Unix timestamp (must be within 5 minutes for replay protection)
curl -H "x-address: 0xYourWalletAddress" \
-H "x-signature: 0xSignatureHex" \
-H "x-timestamp: 1700000000" \
https://api.prediqt.com/ordersPublic endpoints (markets list, prices, trades) do not require authentication. Authenticated endpoints (listing your orders, managing API keys) require one of the methods above.
REST Endpoints
Markets
GET /markets— List all markets with filtering and paginationGET /markets/:id— Get detailed market informationGET /markets/:id/candles— OHLCV candle data for price chartsGET /markets/:id/orderbook— Order book depth for a marketGET /markets/:id/trades— Recent trades for a marketGET /markets/:id/activity— Activity feed for a marketGET /markets/:id/holders— Top holders of a market
Orders
POST /orders— Submit a new signed orderGET /orders— List active orders for the authenticated userGET /orders/:hash— Get order details by hashDELETE /orders/:hash— Cancel an order by its hashPOST /orders/batch— Submit multiple orders in a single requestDELETE /orders/batch— Cancel multiple orders by their hashesDELETE /orders/cancel-all— Cancel all open orders for the authenticated userDELETE /orders/market/:marketId— Cancel all open orders for a specific marketGET /orders/nonce/:address— Get current signing nonce for an addressPOST /orders/nonce— Increment nonce to bulk-cancel all prior orders
POST /orders is self-authenticating via the EIP-712 signature embedded in the order body — no API key or bearer token is needed for this endpoint. Other authenticated endpoints (listing your orders, cancelling, managing API keys) require one of the auth methods above.
Prices
GET /price— Get a single token priceGET /prices— Get batch token pricesGET /books— Get batch order book dataGET /spread— Get bid-ask spread for a tokenGET /midpoint— Get midpoint price for a tokenGET /tick-size— Get the tick size (minimum price increment)
Trades
GET /trades— List trades globally with filters and pagination
Auth
POST /auth/api-key— Create a new API keyGET /auth/api-key— List API keys for the authenticated userDELETE /auth/api-key/:id— Revoke an API key
This covers the core trading endpoints. For the complete API reference including user profiles, balances, events, leaderboard, comments, and notifications, visit the interactive Swagger documentation.
WebSocket
Real-time data is delivered over Socket.IO (not raw WebSocket). Connect to the same base URL as the REST API:
import { io } from "socket.io-client";
const socket = io("https://api.prediqt.com");
// Subscribe to channels
socket.emit("subscribe", ["orderbook:market-id", "trades:market-id"]);
// Listen for updates
socket.on("orderbook", (data) => console.log(data));
socket.on("trade", (data) => console.log(data));Channels
orderbook:{marketId}— Order book updates (snapshot on subscribe, then deltas)trades:{marketId}— Trade executions for a marketmarket:{marketId}— Market price and status updatesprice:{tokenId}— Individual token price updatesuser:{address}— Private channel for user-specific updates (requires authentication)
Authentication (WebSocket)
To subscribe to private user: channels, authenticate after connecting:
// EIP-191 signature auth
socket.emit("authenticate", {
address: "0x...",
signature: "0x...",
timestamp: Date.now(),
});
// Or Privy token auth
socket.emit("authenticate", { token: "privy-jwt-token" });
socket.on("authenticated", (data) => {
// Now you can subscribe to user channels
socket.emit("subscribe", ["user:0x..."]);
});Rate Limits
Order submission endpoints (POST /orders and POST /orders/batch) have strict rate limits to prevent abuse. If you hit a rate limit you will receive a 429 Too Many Requests response.
For high-frequency operations, use the batch endpoints (POST /orders/batch, DELETE /orders/batch) to submit or cancel multiple orders in a single request.
Getting Started
- Create an account — Sign up and log in to the Prediqt app.
- Create an API key — Go to Settings and generate an API key. Copy it immediately; it will not be shown again.
- Fetch markets — List available markets:
curl -H "x-api-key: pm_live_your_key_here" \
https://api.prediqt.com/markets- Check prices — Get the current price for a token:
curl "https://api.prediqt.com/price?tokenId=TOKEN_ID"- Place an order — Submit a signed order (orders must be signed with your wallet using EIP-712):
curl -X POST https://api.prediqt.com/orders \
-H "Content-Type: application/json" \
-d '{
"order": { ... },
"signature": "0x..."
}'Note: POST /orders does not require an API key or bearer token — the EIP-712 signature in the request body authenticates the order.
For the full request and response schemas, refer to the interactive Swagger documentation.