https://blockforecast.io/api/v2/public/ and require an X-API-Key header. This page documents every endpoint with full parameter descriptions, response field definitions, and working code examples in curl, Python, and TypeScript. If you have not yet obtained an API key, start with Authentication.
All monetary values are returned as floating-point USD (e.g.,
18420.50) in the REST API. On-chain, amounts are USDC with 6-decimal precision — keep this in mind if you are reconciling against on-chain data.GET /public/markets
Returns a paginated, filterable list of prediction markets.Query parameters
Filter by market status. One of
open (trading), resolved (settled). Omit to return all statuses.Filter by category slug. Common values:
crypto, sports, politics, science, entertainment. Matched case-insensitively. Omit to return all categories.Response fields
Examples
- curl
- Python
- TypeScript
GET /public/markets/:id
Fetches a single market by its numeric ID, ticker ID, or slug.Path parameters
The market’s numeric
id (e.g., 781), tickerId (e.g., BF-0781), or slug. All three are accepted.Response fields
Returns a single market object with all the fields described inGET /markets, plus:
Examples
- curl
- Python
- TypeScript
POST /public/markets
Creates a new prediction market. Requires your wallet to have approved creator status. Apply for creator access — applications are reviewed within 24 hours.Request body
The market question. Should be phrased as a binary yes/no question. Maximum 280 characters.
Clear, unambiguous criteria that define how the market resolves. The AI oracle uses this text. Maximum 1000 characters.
ISO 8601 date-time for when the market is eligible for resolution (e.g.,
2026-12-31T23:59:59Z). Must be at least 1 hour in the future.Response fields
Returns the newly created market object with all fields fromGET /markets/:id.
Examples
- curl
- Python
- TypeScript
GET /public/markets/:id/trades
Returns a paginated list of trades for a specific market, ordered from most recent to oldest.Path parameters
Query parameters
Response fields
Examples
- curl
- Python
- TypeScript
Additional endpoints
The following endpoints are available but covered in detail in Authentication. The auth flow is two-step —/auth/challenge must be called before /auth/token: