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
    • Tag
    • AccountResponse
    • TagsResponse
    • 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
    • Team
    • TeamSide
    • TimeseriesData
    • TimeseriesLatestBatchResponse
    • TimeseriesLatestData
    • TimeseriesLatestResponse
    • TimeseriesPoint
    • TimeseriesResponse
    • TweetCountVariantData
    • VariantData
    • VariantData_CryptoUpDownVariantData
    • VariantData_SportsFifaFriendliesVariantData
    • VariantData_SportsFifaWorldCupVariantData
    • VariantData_SportsNbaVariantData
    • VariantData_SportsPropsMarketData
    • VariantData_TweetCountVariantData
  1. WebSocket

Request Format

Clients send JSON text frames to subscribe, unsubscribe, and answer heartbeats.

Message structure (client to server)#

{
  "method": "subscribe",
  "requestId": 1,
  "params": ["predictOrderbook/123"]
}
FieldTypeRequiredDescription
methodstringYessubscribe, unsubscribe, or heartbeat.
requestIdnumberFor subscribe / unsubscribeA unique non-negative integer you choose, echoed back on the matching response so you can correlate it.
paramsstring[]For subscribe / unsubscribeThe topic to act on. One topic per request — only the first entry is used.
dataanyFor heartbeatThe exact timestamp received from the server's heartbeat.

Subscribe#

{ "method": "subscribe", "requestId": 1, "params": ["predictMarketStatus/123"] }
The server replies with a response message (type: "R") carrying the same requestId. For snapshot-backed topics, a snapshot message (type: "M") is also pushed immediately, followed by live updates. Subscribing again to a topic you already hold is a no-op that simply re-acknowledges.

Unsubscribe#

{ "method": "unsubscribe", "requestId": 2, "params": ["predictMarketStatus/123"] }
Unsubscribing always acknowledges successfully, whether or not the subscription existed.

Heartbeat#

Answer each server heartbeat by echoing its timestamp. The heartbeat request has no requestId or params:
{ "method": "heartbeat", "data": 1736696400000 }
See Heartbeats for the full mechanism.

Errors#

A malformed or rejected request is answered with a response message whose success is false and whose error.code is one of:
CodeMeaning
invalid_jsonThe message is not valid JSON. Returned with requestId: -1.
invalid_topicThe topic is malformed, unknown, or has an invalid parameter.
invalid_credentialsThe wallet JWT is invalid, expired, or revoked.
internal_server_errorAn unexpected server error occurred.
(Authentication failures during the initial handshake are returned as HTTP status codes, not as these JSON errors.)
Modified at 2026-06-18 15:44:19
Previous
General Information
Next
Response Format
Built with