Overview
Mobula’s Prediction Markets APIs provide a complete interface to interact with prediction markets (currently supporting Polymarket on Polygon):Market Data
Read Markets
- Market details & prices
- OHLCV candlesticks
- Order book depth
- Trade history
- Live short-duration markets
Search & Discovery
Find Markets
- Full-text search
- Trending markets
- Category browsing
- Volume/liquidity filters
Execution
Trade Markets
- Account setup & auth
- Order building & signing
- Order submission
- Deposits, withdrawals & redemptions
How It Works
Prediction markets let users trade on the outcome of real-world events. Each market has outcomes (e.g., “Yes” / “No”) represented as conditional tokens priced between 1. If your predicted outcome occurs, your tokens are redeemable for $1 each.Architecture
- EIP-712 typed data is built server-side — you only need to sign
- Account deployment (Safe wallet) is handled via simple build/submit endpoints
- Token approvals are pre-built as ready-to-send calldata
- Order matching goes through Polymarket’s CLOB for best execution
Trading Flow
Setup Account
Check if your wallet has a deployed Safe account via
GET /api/2/wallet/pm/status. If not, deploy one using the /api/2/pm/deploy/build and /api/2/pm/deploy/submit endpoints.Authenticate
Build auth typed data via
POST /api/2/pm/auth/build, sign it with your wallet, then derive CLOB API credentials via POST /api/2/pm/auth/derive.Approve Tokens
Build approval transactions via
POST /api/2/pm/approval/build and submit them on-chain. This allows the exchange contracts to transfer your USDC and conditional tokens.Data Conventions
- Dates (creation, end, resolution): ISO 8601 strings with
Zsuffix (e.g.,"2026-03-15T10:30:00.000Z") - Timestamps (trade events, price snapshots, candles): Unix milliseconds as
number(e.g.,1709913600000) - Monetary values: Always suffixed with
USD(e.g.,volume24hUSD,liquidityUSD,amountUSD) - Probabilities:
priceUSDfield, range 0 to 1 (consistent USD suffix convention)
Supported Platforms
| Platform | Chain | Status |
|---|---|---|
| Polymarket | Polygon (137) | Live |
API Endpoints
Market Details
Get full details for a specific market.
Search Markets
Search and filter prediction markets.
Market OHLCV
Get candlestick price data for an outcome.
Order Build
Build an order for signing.
Getting Started: You can query market data endpoints using demo-api.mobula.io without signup. For execution endpoints, generate a free API key to use api.mobula.io.
Error Responses
All PM endpoints return errors in the standard NestJS format:| Status Code | Meaning |
|---|---|
400 | Bad Request — invalid or missing parameters |
401 | Unauthorized — missing or invalid API key |
404 | Not Found — market or resource does not exist |
429 | Too Many Requests — rate limit exceeded |
500 | Internal Server Error |
502 | Bad Gateway — upstream platform (e.g., Polymarket CLOB) is unavailable |