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

Response Format

The server sends two kinds of JSON text frame: responses (type: "R") that answer a client request, and messages (type: "M") that push subscription data.

Response (type R)#

Sent in reply to a subscribe or unsubscribe request.
{ "type": "R", "requestId": 1, "success": true }
{
  "type": "R",
  "requestId": 1,
  "success": false,
  "error": { "code": "invalid_topic", "message": "unknown topic: foo" }
}
FieldTypeDescription
typestringAlways "R".
requestIdnumberMatches the requestId of the request (or -1 if the request JSON could not be parsed).
successbooleanWhether the request succeeded.
errorobjectPresent only when success is false. Has code and an optional message.
See Request Format for the full list of error codes.

Message (type M)#

Pushed for every subscription, including the initial snapshot and the heartbeat.
{ "type": "M", "topic": "predictOrderbook/123", "data": { "...": "..." } }
FieldTypeDescription
typestringAlways "M".
topicstringThe topic the message belongs to, e.g. predictOrderbook/123. The heartbeat uses the reserved topic heartbeat.
dataanyThe payload for that topic. See Subscription Topics for per-topic shapes.

Endpoint#

Connect to wss://ws.predict.fun/ws. Use ws:// only against a local development server.
Modified at 2026-06-18 15:44:19
Previous
Request Format
Next
Subscription Topics
Built with