GuidesGet started
Introduction
What you can build with Predict's APIs and SDKs, which environments exist, and where to start.
Predict is a prediction market on BNB Chain. Its order book runs off-chain, and every trade settles on-chain through Predict's exchange contracts. You can read market data, trade from your own wallet, and follow both as they change.
The APIs
| Interface | What it is for |
|---|---|
| REST API | Market data, your account and positions, and placing and removing orders. |
| WebSocket API | Live order books, market status changes, and events for your own orders. |
| SDKs | Signing orders, setting approvals, and managing positions on-chain. Available for TypeScript and Python. |
Report anything that does not work as described in our Discord server.
Environments
| BNB Mainnet | BNB Testnet | |
|---|---|---|
| REST API | https://api.predict.fun | https://api-testnet.predict.fun |
| WebSocket API | wss://ws.predict.fun/ws | Not available yet |
| Chain ID | 56 | 97 |
| API key | Required | Not needed |
Every REST path starts with /v1, for example https://api.predict.fun/v1/markets. On mainnet, send your API key in the x-api-key header of every REST request. The WebSocket connection takes it as the same header or as an apiKey query parameter (see the WebSocket overview). Testnet works without a key, so you can try the REST API there before you have one.
Predict's servers run in AWS ap-northeast-1 (Tokyo). Deploy close to that region for the lowest latency.
Get an API key
Create an API key in the developer console. Each key has rate limits, which you can see in the console. See Rate limits for the defaults and how to read them from responses.
Install an SDK
npm install @predictdotfun/sdk ethersThe SDK uses ethers v6 for signing. Source: github.com/PredictDotFun/sdk.
Where to start
Markets and categories
How markets, outcomes and categories fit together.
Prices and order book
How prices work, and how the Yes and No sides share one book.
Authentication
Get a JWT for your wallet, as an EOA or a Predict account.
Place orders
Build, sign and submit limit and market orders.
Docs for AI tools
These docs are available in forms that coding assistants and language models can read:
/llms.txtlists every page with a one-line summary./llms-full.txtholds the full text of every page in one file. It's over 1 MB, more than most AI tools can read at once, so prefer/llms.txtand the pages you need.- Every page has a Markdown copy at its URL plus
.md, for example/introduction.md. The buttons at the top of each page copy it or open it in an AI tool. - Ask AI, at the bottom right of every page, answers questions from these docs.
Our SDKs and docs are also on Context7, which you can use through its MCP server or its website: