https://blockforecast.io/api/v2. Authentication uses a long-lived API key (bf_<32 hex>) that you obtain by signing a one-time challenge with your wallet. This guide walks you through every step from zero to your first successful response.
1
Get an API key (programmatic)
Keys are issued in a two-step nonce-bound flow: request a challenge, sign the exact message it returns, post both back. No account required — your wallet address is your identity. Each nonce is single-use, so the same signature can’t be replayed for any other action.The response contains your API key (shown once):Store the
curl
apiKey value as a secret in your deployment platform — the server only stores its SHA-256 hash, so a leaked DB doesn’t leak keys, but the raw key cannot be re-fetched. See Authentication for the full signing flow, the regenerate/revoke endpoints, and error reference.2
Make your first request
With your key in hand, call
GET /api/v2/public/markets to fetch the current list of active prediction markets.3
Parse the response
A successful Each market object includes the current LSMR prices (
GET /markets response looks like this:yesPrice, noPrice), aggregate volume, available liquidity, and the resolution date. Prices are expressed as probabilities between 0 and 1 — a yesPrice of 0.34 means the market currently prices the YES outcome at 34 cents per share. The status field is open while trading is live, resolving after close, and resolved once the oracle settles.All monetary values in the API are denominated in USDC (6-decimal precision on-chain, returned as floating-point USD in the REST API).
4
Next steps
You have the basics working. Here is where to go next depending on what you want to build:
Public API reference
Full endpoint reference with request params, response fields, and multi-language examples for every route.
Authentication
Wallet-signature auth flow, error codes, key rotation, and security best practices.
Rate limits
Default limits, 429 handling, exponential backoff examples, and how to request a higher limit.
x402 Agent API
Create markets from an autonomous AI agent — no API key required, just $1 USDC per market via x402.