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

InterfaceWhat it is for
REST APIMarket data, your account and positions, and placing and removing orders.
WebSocket APILive order books, market status changes, and events for your own orders.
SDKsSigning 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 MainnetBNB Testnet
REST APIhttps://api.predict.funhttps://api-testnet.predict.fun
WebSocket APIwss://ws.predict.fun/wsNot available yet
Chain ID5697
API keyRequiredNot 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 ethers

The SDK uses ethers v6 for signing. Source: github.com/PredictDotFun/sdk.

Where to start

Docs for AI tools

These docs are available in forms that coding assistants and language models can read:

  • /llms.txt lists every page with a one-line summary.
  • /llms-full.txt holds 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.txt and 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:

On this page