REST APIMarkets
Get market quote
Get the best bid and best ask resting on a market's order book, quoted
against the outcome whose indexSet is 1, as the book itself is.
Prefer this over the full order book when only the current price matters, and over the quotes embedded in a market payload, which are deprecated.
ApiKeyAuthx-api-key<token>API key authentication via the x-api-key header.
id*integerThe market's ID.
int64application/json; charset=utf-8- response
Response for GET /v1/markets/:id/quote
success*booleandata*Top of a market's order book: the best price resting on each side.
This is the lightweight alternative to fetching a whole order book, or to reading the quotes that used to be embedded in a market payload. Both sides come from a single reading, so the two ends of a spread are always observed at the same instant.
Prices are quoted against the outcome whose indexSet is 1, the same
convention the order book itself uses. To price the complementary outcome,
swap the sides and subtract from one: its best bid is 1 - bestAsk.price and
its best ask is 1 - bestBid.price, at the same sizes. Round the result to
six decimal places, or binary floating point will hand you values like
0.17000000000000004.
A quote reports the order book as it stands and says nothing about whether the market is still trading. Read the market itself for that, and note that an absent quote means only that no book is being maintained.
curl -X GET 'https://api.predict.fun/v1/markets/0/quote'{ "success": true, "data": { "marketId": 0, "updateTimestampMs": 0, "bestBid": { "price": 0.1, "size": 0.1 }, "bestAsk": { "price": 0.1, "size": 0.1 } }}