Complete reference for all BlockForecast public REST API endpoints — list markets, fetch trade data, place trades, and create markets with creator access.
The BlockForecast public REST API exposes prediction market data and trading functionality over standard HTTP. All endpoints live under 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.
Creates a new prediction market. Requires your wallet to have approved creator status. Apply for creator access — applications are reviewed within 24 hours.
curl -X POST "https://blockforecast.io/api/v2/public/markets" \ -H "X-API-Key: $BLOCKFORECAST_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "question": "Will ETH surpass $10,000 before July 2027?", "description": "Tracks ETH/USD price on Coinbase Pro at any point before the resolution date.", "resolutionCriteria": "Resolves YES if ETH/USD closes above $10,000 on Coinbase Pro on any day before July 1, 2027. Resolves NO otherwise.", "resolveDate": "2027-07-01T00:00:00Z", "category": "crypto" }'
import os, requestsresp = requests.post( "https://blockforecast.io/api/v2/public/markets", headers={ "X-API-Key": os.environ["BLOCKFORECAST_API_KEY"], "Content-Type": "application/json", }, json={ "question": "Will ETH surpass $10,000 before July 2027?", "description": "Tracks ETH/USD price on Coinbase Pro at any point before the resolution date.", "resolutionCriteria": "Resolves YES if ETH/USD closes above $10,000 on Coinbase Pro on any day before July 1, 2027. Resolves NO otherwise.", "resolveDate": "2027-07-01T00:00:00Z", "category": "crypto", },)resp.raise_for_status()market = resp.json()print(f"Created market: https://blockforecast.io/market/{market['slug']}")
const resp = await fetch("https://blockforecast.io/api/v2/public/markets", { method: "POST", headers: { "X-API-Key": process.env.BLOCKFORECAST_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ question: "Will ETH surpass $10,000 before July 2027?", description: "Tracks ETH/USD price on Coinbase Pro at any point before the resolution date.", resolutionCriteria: "Resolves YES if ETH/USD closes above $10,000 on Coinbase Pro on any day before July 1, 2027. Resolves NO otherwise.", resolveDate: "2027-07-01T00:00:00Z", category: "crypto", }),});if (!resp.ok) throw new Error(`API error: ${resp.status}`);const market = await resp.json();console.log(`Created: https://blockforecast.io/market/${market.slug}`);
If your API key’s wallet does not have creator status, this endpoint returns 403 Forbidden with code INSUFFICIENT_PERMISSIONS. Apply at blockforecast.io/apply — the same approval covers both the public API and the x402 Agent API.
The following endpoints are available but covered separately in the authentication and trading documentation:
Method
Path
Description
POST
/api/v2/auth/challenge
Issue a single-use nonce for a wallet-signed action (issue / revoke / regenerate).
POST
/api/v2/auth/token
Exchange a wallet signature + nonce for a bf_… API key.
GET
/api/v2/auth/keys?address=
List active keys (prefixes only) for a wallet.
POST
/api/v2/auth/keys/:id/revoke
Revoke a specific key by id.
POST
/api/v2/auth/keys/:id/regenerate
Atomically rotate — old revoked, new issued.
GET
/api/v2/public/markets/:id/price
Current LSMR price and price impact for a given quote size.
GET
/api/v2/public/markets/:id/history
OHLC price history.
POST
/api/v2/public/markets/:id/trade
Place a trade on a market.
GET
/api/v2/public/positions
Open positions for your wallet.
GET
/api/v2/public/positions/history
Trade history for your wallet.
GET
/api/v2/public/balance
Your USDC balance on BlockForecast.
To create markets programmatically without the manual creator approval flow, see the x402 Agent API — autonomous agents can pay $1 USDC per market with no signup required (creator approval still needed, but the flow is fully programmatic).