REST API

Overview

Base URLs, credentials, request and response formats, units, pagination and limits that apply to every REST API endpoint.

The REST API serves market data, your account and positions, and the orders you place and remove. Every endpoint in this section follows the rules on this page.

Base URLs

NetworkBase URLAPI key
BNB Mainnethttps://api.predict.funRequired
BNB Testnethttps://api-testnet.predict.funNot needed

Every path starts with /v1, for example https://api.predict.fun/v1/markets.

Credentials

HeaderValueNeeded for
x-api-keyYour API key from the developer consoleEvery mainnet request
AuthorizationBearer <jwt>Requests that act for a wallet, such as creating, reading and removing its orders

Each endpoint's page lists the credentials it needs under Authorization. Log in shows how to get a JWT for a wallet. For a Predict account, see Authentication.

On testnet, leave x-api-key out. Testnet doesn't need a key, but it rejects an invalid one.

Requests

Send request bodies as JSON, with Content-Type: application/json. Query and path parameters are listed on each endpoint's page.

Amounts and prices in orders are integer strings in wei, where 10^18 is 1 USDT or 1 share. For example, a price of 0.40 is "400000000000000000". A decimal string such as "0.4" is rejected.

Responses

A successful response has success: true. Most endpoints put their result in data:

{
  "success": true,
  "data": { "message": "Please sign this message to log in. …" }
}

A list adds a cursor for the next page (see Pagination). A few endpoints, such as Remove orders, return their fields next to success instead of in data. Each endpoint's page shows its response.

An error has success: false, the HTTP status in code, and a stable code in error to match on:

{
  "success": false,
  "code": 401,
  "error": "unauthorized",
  "message": "invalid signature",
  "timestamp": "2026-11-04T20:37:19.030930831Z"
}

Errors lists every code with its fix.

Units and timestamps

  • Share amounts in responses, such as a position's amount or an order's amountFilled, are wei strings, like the amounts you send.
  • Order book prices and sizes are plain numbers, such as [0.62, 1500]: a price between 0 and 1 and a number of shares. See Prices and order book.
  • Fee rates such as feeRateBps are in basis points, where 100 is 1%.
  • Times in fields named …At, such as createdAt, are date-time strings. Fields named …TimestampMs are milliseconds since the Unix epoch.

Pagination

List endpoints return one page at a time:

  1. Set the page size with first. The table below gives each endpoint's default and maximum.
  2. Read cursor from the response.
  3. Send it back as after to get the next page.

When there are no more pages, cursor is null.

EndpointsDefault firstMaximum first
GET /v1/categories, GET /v1/markets, GET /v1/positions, GET /v1/positions/{address}, GET /v1/series/{slug}/rounds20100
GET /v1/orders, GET /v1/orders/matches, GET /v1/account/activity, GET /v1/account/{address}/activity, GET /v1/maker-rebates, GET /v1/referral-fees50150

A first outside that range isn't rejected. A larger value is read as the maximum, and a value below 1 is read as 1.

Limits

Each API key has a request budget per minute. A key can also have a per-second cap on order placement and removal. Responses carry RateLimit-* headers with your remaining budget, except when the API key is rejected. A request over the limit gets a 429. See Rate limits.

Try it in the browser

Every endpoint's page has a Try in Playground button that sends the request from your browser. It uses mainnet unless you pick the testnet server. Enter your API key, and a JWT for wallet endpoints, in its Authorization fields.

The OpenAPI document behind these pages is at /openapi/rest.json. You can use it to generate a client.

How-tos

For the SDK side of trading, such as order options, approvals and positions, see the Trading guides.

On this page