Predict API (Beta)
  1. WebSocket
  • FAQs
  • Deployed Contracts
  • Guides
    • Understanding the Orderbook
    • [TS] How to authenticate your API requests
    • [PY] How to authenticate your API requests
    • How to create or cancel orders
  • WebSocket
    • General Information
    • Request Format
    • Response Format
    • Subscription Topics
    • Heartbeats
    • Client Example
  • Authorization
    • Get auth message
      GET
    • Get JWT with valid signature
      POST
  • Categories
    • Get categories
      GET
    • Get category by slug
      GET
    • Get all tags
      GET
  • Markets
    • Get markets
      GET
    • Get market by ID
      GET
    • Get market statistics
      GET
    • Get market last sale information
      GET
    • Get the orderbook for a market
      GET
    • Get market timeseries
      GET
    • Get latest market timeseries value
      GET
  • Orders
    • Get order by hash
      GET
    • Get orders
      GET
    • Get order match events
      GET
    • Remove orders from the orderbook
      POST
    • Create an order
      POST
    • Remove orders by hash
      POST
  • Accounts
    • Get connected account
      GET
    • Get account activity
      GET
    • Set a referral
      POST
  • Positions
    • Get positions
      GET
    • Get positions by address
      GET
  • Search
    • Search categories and markets
      GET
  • OAuth
    • Finalize a OAuth connection
      POST
    • Get the orders for a OAuth connection
      POST
    • Create an order for a OAuth connection
      POST
    • Cancel the orders for a OAuth connection
      POST
    • Get the positions for a OAuth connection
      POST
  • Schemas
    • AccountData
    • AccountResponse
    • ActivityEvent
    • ActivityEventName
    • ActivityOrderData
    • ActivityResponse
    • AuthMessageData
    • AuthMessageResponse
    • AuthTokenData
    • AuthTokenResponse
    • BulletinBoardUpdate
    • BulletinBoardUpdatesResponse
    • CategoriesResponse
    • CategoryResponse
    • CategorySort
    • CategoryStatsData
    • CategoryStatsResponse
    • CategoryStatus
    • CategoryStatusFilter
    • CategoryTranslationData
    • CategoryTranslationFields
    • CategoryTranslationsResponse
    • CategoryWithStats
    • ContractOrder
    • CreateOrderData
    • CreateOrderRequest
    • CreateOrderResponse
    • CreateOrderResponseData
    • CryptoUpDownVariantData
    • ErrorCode
    • ErrorResponse
    • Fee
    • FeeEventData
    • FeeEventsResponse
    • FeeType
    • LastOrderSettled
    • LastSaleData
    • LastSaleResponse
    • Market
    • MarketResponse
    • MarketRewards
    • MarketSort
    • MarketStatsData
    • MarketStatsResponse
    • OAuthCancelOrdersData
    • MarketStatus
    • OAuthCancelOrdersRequest
    • MarketStatusFilter
    • OAuthCancelOrdersResponse
    • OAuthCreateOrderData
    • MarketTimeseries
    • OAuthCreateOrderRequest
    • MarketTimeseriesLatest
    • MarketTradingStatus
    • OAuthCreateOrderResponse
    • OAuthFinalizeData
    • MarketTranslationData
    • OAuthFinalizeRequest
    • MarketType
    • MarketVariant
    • OAuthFinalizeResponse
    • OAuthOrdersData
    • MarketWithStats
    • MarketsResponse
    • OAuthOrdersRequest
    • MatchData
    • OAuthOrdersResponse
    • MatchesResponse
    • OAuthPositionsData
    • Metric
    • OAuthPositionsRequest
    • OAuthPositionsResponse
    • OrderData
    • OrderFillData
    • OrderResponse
    • OrderStatus
    • OrderStatusFilter
    • OrderStrategy
    • OrderbookData
    • OrderbookResponse
    • OrderbooksResponse
    • OrdersResponse
    • Outcome
    • OutcomeSide
    • OutcomeStatus
    • OutcomeTranslation
    • OutcomeVariantData
    • OutcomeVariantData_SportsTeamOutcomeData
    • PendingYieldData
    • PendingYieldResponse
    • PointsInfo
    • PositionData
    • PositionSort
    • PositionsResponse
    • PostAuthRequest
    • RemoveOrdersData
    • PriceFeedProvider
    • RemoveOrdersRequest
    • RemoveOrdersResponse
    • PriceLevel
    • QuoteType
    • ReferralInfo
    • ReferralStatus
    • RemoveOrdersByHashData
    • RemoveOrdersByHashRequest
    • ReservedBalancePolicy
    • Resolution
    • ResolutionProvider
    • RewardPeriod
    • SearchData
    • SearchResponse
    • SelectTeamsRequest
    • SelfTradePreventionStrategy
    • SetReferralData
    • SetReferralRequest
    • SetReferralResponse
    • SportsDataProvider
    • SportsEventTeam
    • SportsFifaFriendliesVariantData
    • SportsFifaWorldCupVariantData
    • SportsNbaVariantData
    • SportsPropsMarketData
    • SportsTeamOutcomeData
    • Tag
    • TagsResponse
    • Team
    • TeamSide
    • TimeseriesData
    • TimeseriesLatestBatchResponse
    • TimeseriesLatestData
    • TimeseriesLatestResponse
    • TimeseriesPoint
    • TimeseriesResponse
    • TweetCountVariantData
    • VariantData
    • VariantData_CryptoUpDownVariantData
    • VariantData_SportsFifaFriendliesVariantData
    • VariantData_SportsFifaWorldCupVariantData
    • VariantData_SportsNbaVariantData
    • VariantData_SportsPropsMarketData
    • VariantData_TweetCountVariantData
  1. WebSocket

Subscription Topics

Topics are strings of the form topicName/parameter, for example predictOrderbook/123. Subscribe to one topic per request.

Snapshots#

When you subscribe to a market-data topic that caches a value, the latest value is pushed immediately as a normal type: "M" message, followed by live updates. Treat the snapshot as best-effort: it may be absent if no value has been cached yet. The change-notification and wallet-event topics do not send a snapshot.

Market data topics#

predictOrderbook/{marketId}#

Live order book for a market, as aggregated price levels. Snapshot: yes.
Payload:
{
  "version": 1,
  "marketId": 123,
  "updateTimestampMs": 1736696400000,
  "orderCount": 42,
  "asks": [[0.62, 1500.0], [0.63, 800.0]],
  "bids": [[0.61, 2000.0], [0.60, 1200.0]],
  "lastOrderSettled": {
    "id": "987654321",
    "price": "0.62",
    "kind": "LIMIT",
    "marketId": 123,
    "side": "Ask",
    "outcome": "Yes"
  },
  "settlementsPending": { "asks": [[0.62, 310.0]], "bids": [] }
}
Each entry in asks/bids is a [price, quantity] level: price is the YES price
between 0 and 1, quantity is the size in shares. asks are sorted ascending by price,
bids descending. lastOrderSettled is null until the first settlement; its kind is
the order strategy (MARKET/LIMIT). settlementsPending holds [price, value] levels
whose settlement is in flight.

predictTradingStatus/{marketId}#

Whether a market is currently matching orders. Snapshot: yes.
Payload:
{
  "kind": "tradingStatusUpdate",
  "tsMs": 1736696400000,
  "marketId": 123,
  "tradingStatus": "OPEN"
}
tradingStatus is OPEN, MATCHING_NOT_ENABLED, CANCEL_ONLY, or CLOSED.

predictMarketStatus/{marketId}#

Lifecycle status and outcome prices for a market. Snapshot: yes.
Payload:
{
  "kind": "marketStatusUpdate",
  "tsMs": 1736696400000,
  "marketId": 123,
  "status": "OPEN",
  "marketOutcomes": [
    { "label": "Yes", "price": "0.62", "indexSet": 1, "onChainId": "..." }
  ]
}
marketOutcomes is optional.

predictMarketChanged/{marketId}#

Notification that a market changed, so clients can refetch or patch their cached copy.
Snapshot: no.
Payload:
{ "kind": "marketChanged", "patchKind": null, "tsMs": 1736696400000, "marketId": 123 }
patchKind is null for a generic change. When the change carries an inline patch,
patchKind names the patch type and a patch object with the changed fields is included.

predictCategoryChanged/{categoryId}#

Notification that a category changed. Snapshot: no.
Payload:
{
  "kind": "categoryChanged",
  "patchKind": null,
  "tsMs": 1736696400000,
  "categoryId": 45,
  "slug": "politics"
}
As with market changes, patchKind names the patch type and a patch object is included
when the change carries inline data.

Account topic#

predictWalletEvents/{jwt} (authenticated)#

Live events for a user's own orders and trades. Requires a valid wallet JWT in the topic string. Snapshot: no.
A revoked, invalid, or expired JWT returns invalid_credentials.

Event payload#

Every wallet event shares this base shape:
{
  "type": "orderAccepted",
  "orderId": "123456789",
  "orderHash": "0x…",
  "walletAddress": "0x…",
  "timestamp": 1736696400000,
  "details": {
    "marketId": 123,
    "outcomeIndex": 0,
    "marketQuestion": "Will X happen?",
    "outcome": "YES",
    "quoteType": "BID",
    "quantity": "100.000",
    "quantityFilled": "0.000",
    "price": "0.620",
    "value": "62.00",
    "valueFilled": "0.00",
    "strategyType": "LIMIT",
    "categorySlug": "politics"
  }
}
outcome is YES/NO; quoteType is ASK/BID; strategyType is MARKET/LIMIT.

Event types#

typeMeaningExtra fields
orderAcceptedOrder placed in the book.—
orderNotAcceptedOrder rejected.reason: noMarketMatch, rejectedDuplicate, or rejectedPostOnly
orderExpiredOrder reached its end time.—
orderCancelledOrder cancelled.optional reason: selfTradePrevention
orderTransactionSubmittedOrder matched; settlement submitted on-chain.kind: SALE/PURCHASE, settlementId, fill
orderTransactionSuccessOn-chain settlement succeeded.settlementId, fill, optional isMaker, optional fee
orderTransactionFailedOn-chain settlement failed.settlementId, fill
fill schema:
{ "executedPriceWei": "…", "executedSizeWei": "…", "executedValueWei": "…" }
fee schema:
{ "amountWei": "…", "type": "COLLATERAL" | "SHARES" }
Modified at 2026-06-18 15:44:19
Previous
Response Format
Next
Heartbeats
Built with