- TypeScript
- Python
- API
Given a market, read its outcome token IDs:
Order Book
Retrieve the resting bids and asks for one outcome token. Bids are ordered by ascending price and asks by descending price, so the best bid and ask are the last entries in their respective arrays. Each response also includes ahash
for the order-book state. Compare it with the previous response’s hash to
determine whether the book changed between reads.
Fetch an Order Book
- TypeScript
- Python
- API
Call The returned
fetchOrderBook() on a PublicClient or SecureClient to fetch an outcome’s
order book.OrderBook describes its price levels and the market details
needed to interpret them:Fetch Multiple Order Books
Batch order-book reads return the resting bids and asks for several outcomes in one request.Maximum 500 items per request.
- TypeScript
- Python
- API
Call Each item uses the
fetchOrderBooks() on a PublicClient or SecureClient to fetch several order
books in one request.OrderBook shape described above:Best Market Price
Read the best available execution price for an outcome and side.BUY returns
the lowest ask, which is the price you would pay to buy. SELL returns the
highest bid, which is the price you would receive when selling.
Fetch a Price
- TypeScript
- Python
- API
Call The method returns the price as a decimal string:
fetchPrice() on a PublicClient or SecureClient to fetch the best price for
one side. For a BUY, the method returns the lowest ask.Fetch Multiple Prices
Batch price reads return the best market price for several outcome-and-side pairs in one request. Use them when the same view or calculation needs more than one outcome.Maximum 500 items per request.
- TypeScript
- Python
- API
Call
fetchPrices() on a PublicClient or SecureClient to fetch several prices in
one request.Prices maps each token ID to the requested side and price:Midpoint Price
The midpoint is the average of the best bid and best ask. It provides a reference price between the two sides of the order book.Fetch a Midpoint
- TypeScript
- Python
- API
Call The method returns the midpoint as a decimal string:
fetchMidpoint() on a PublicClient or SecureClient to fetch the midpoint.Fetch Multiple Midpoints
Fetch midpoint prices for several outcomes in one request.Maximum 500 items per request.
- TypeScript
- Python
- API
Call
fetchMidpoints() on a PublicClient or SecureClient to fetch several
midpoints.Midpoints maps each token ID to its midpoint:Spread
The spread is the difference between the best ask and best bid. A narrower spread indicates that the two sides of the order book are closer together.Fetch a Spread
- TypeScript
- Python
- API
Call The method returns the spread as a decimal string:
fetchSpread() on a PublicClient or SecureClient to fetch the spread.Fetch Multiple Spreads
Batch spread reads return the bid-ask spread for several outcomes in one request.Maximum 500 items per request.
- TypeScript
- Python
- API
Call The result maps each token ID to its spread:
fetchSpreads() on a PublicClient or SecureClient to fetch several spreads
in one request.Last Trade Price
Use the last trade price to see where an outcome most recently traded.Fetch a Last Trade Price
- TypeScript
- Python
- API
Call When a token has never traded,
fetchLastTradePrice() on a PublicClient or SecureClient to fetch the last
trade.LastTradePrice pairs the traded price with its order side:fetchLastTradePrice() returns null
instead of a LastTradePrice object:Fetch Multiple Last Trade Prices
Fetch the most recent matched trade for several outcomes in one request.Maximum 500 items per request.
- TypeScript
- Python
- API
Call Each
fetchLastTradePrices() on a PublicClient or SecureClient to fetch several
last trades.LastTradePriceForToken identifies the outcome alongside its traded
price and side:Price History
Read historical prices for an outcome token over a selected time period.- TypeScript
- Python
- API
Call Each
Points are oldest first. The final observation can fall between bucket
boundaries. Read
listPriceHistory() on a PublicClient or SecureClient. Choose a
relative window, an explicit time range, or a point in time.PriceHistoryPoint carries the observation time in epoch
milliseconds, the price as a decimal string, and the window it was
observed in:Output: PriceHistoryPoint
Output: PriceHistoryPoint
resolutionSeconds instead of assuming uniform spacing.History Windows and Resolution
History Windows and Resolution
- Explicit
start/endranges span at most 15 days.startis inclusive andendexclusive. PriceHistoryInterval.Maxreturns full history at 12-hour buckets by default. ExplicitbucketSecondsvalues of 10800 or 43200 also cover full history. Finer widths return only the last 30 days.bucketSecondsaccepts 60 to 86400 seconds, with a floor of 600 formax/1mand 300 for1w. Omit it to let the server choose a width for the span and available history.- One-minute data lasts at least 7 days, five-minute at least 60 days, and thirty-minute at least 90 days (floors, not exact horizons). Three-hour and twelve-hour data is permanent. Explicitly requesting a resolution the store cannot fill returns an empty or sparse page with
resolution_secondsechoing the requested grid; omitbucket_secondsto always get the densest series that exists.