# STX Prediction API Documentation > REST and WebSocket APIs for the STX exchange. Every request is signed with an > Ed25519 API key; the same key authenticates REST, GraphQL and the private > WebSocket channels. STX runs two separate exchanges - Canada (Ontario, live) > and the United States (not yet open for trading). ## Start here - [STX Prediction API Documentation](https://docs.stxapp.io/index.md): Build on the STX Prediction Platform, an order book for binary contracts, with REST, WebSocket channels and Ed25519 request signing. ## Concepts - [Account limits](https://docs.stxapp.io/concepts/account-limits.md) - [Fees](https://docs.stxapp.io/concepts/fees.md) - [How markets work](https://docs.stxapp.io/concepts/how-markets-work.md) - [Leaderboard](https://docs.stxapp.io/concepts/leaderboard.md) - [Mapping markets](https://docs.stxapp.io/concepts/market-shape.md) - [Market and order status](https://docs.stxapp.io/concepts/market-status.md) - [Market symbols](https://docs.stxapp.io/concepts/market-symbols.md) - [Order types](https://docs.stxapp.io/concepts/order-types.md) - [Positions and liability](https://docs.stxapp.io/concepts/positions.md) - [Rate limits](https://docs.stxapp.io/concepts/rate-limits.md) - [Settlements and payouts](https://docs.stxapp.io/concepts/settlements.md) - [United States and Canada](https://docs.stxapp.io/concepts/us-and-canada.md): STX runs two separate exchanges under different regulators. Which one you integrate with changes almost everything. ## REST API - [Request signing](https://docs.stxapp.io/api/authentication.md) - [REST API reference](https://docs.stxapp.io/api/rest.md): Trade on the STX exchange over HTTP. - [Account](https://docs.stxapp.io/api/rest/account.md): Your balance and fee summary, your open positions and your exposure per market: liability, projected fees and worst-case loss. - [Accept terms and conditions](https://docs.stxapp.io/api/rest/account/accept-terms.md): Record acceptance of the currently-in-effect terms and privacy version for this account. - [Get account balance](https://docs.stxapp.io/api/rest/account/get-account-balance.md): Your balance and fee summary as a point-in-time snapshot, the same object the balances:{user_id} WebSocket channel publishes, so a REST read and a channel update delta are interchangeable. - [Get account market stats](https://docs.stxapp.io/api/rest/account/get-market-stats.md): Your exposure and realized result per market: liability, projected fees and worst-case loss. - [List open positions](https://docs.stxapp.io/api/rest/account/list-open-positions.md): Your open positions as a point-in-time snapshot, largest position first. - [Events](https://docs.stxapp.io/api/rest/events.md): The events markets belong to. - [List events](https://docs.stxapp.io/api/rest/events/list-events.md): Events, optionally filtered by sport, competition, type, title and status. - [Fills](https://docs.stxapp.io/api/rest/fills.md): Your own executions. - [List fills](https://docs.stxapp.io/api/rest/fills/list-fills.md): Fills for the authenticated account, most recent first. - [Identity](https://docs.stxapp.io/api/rest/identity.md): Who your key belongs to. - [Get the authenticated account](https://docs.stxapp.io/api/rest/identity/get-account.md): The account behind the credential: identifiers, name, how the request authenticated and your public profile. - [Update your public profile](https://docs.stxapp.io/api/rest/identity/update-your-public-profile.md): Change your handle, avatar or leaderboard_opt_in. - [Leaderboard](https://docs.stxapp.io/api/rest/leaderboard.md): Ranked members per period (day, week, month, year, all time, on America/New_York days) and per sport, on up to eight boards: volume, profit, contracts settled, markets settled, win rate, biggest win, return and winning streak. - [Get a leaderboard](https://docs.stxapp.io/api/rest/leaderboard/get-leaderboard.md): The top members for one period, category and metric, best first. - [Get your own standing](https://docs.stxapp.io/api/rest/leaderboard/get-your-own-standing.md): Your rank and value on every shown board for one period and category, including a rank outside the list, plus your win rate and how many markets you have had decided. - [Markets](https://docs.stxapp.io/api/rest/markets.md): Find something to trade. - [List markets](https://docs.stxapp.io/api/rest/markets/list-markets.md): Markets, filterable by event, competition, sport, status and whether they are currently trading. - [Orders](https://docs.stxapp.io/api/rest/orders.md): Place, inspect and cancel orders, individually or in batches. - [Cancel all open orders](https://docs.stxapp.io/api/rest/orders/cancel-all-orders.md): Cancel every resting order on the account. - [Cancel several orders](https://docs.stxapp.io/api/rest/orders/cancel-multiple-orders.md): Cancel a specific set of orders in one call. - [Cancel an order](https://docs.stxapp.io/api/rest/orders/cancel-order.md): Cancel one resting order by order_id. - [Get an order](https://docs.stxapp.io/api/rest/orders/get-order.md): One order by order_id. - [List orders](https://docs.stxapp.io/api/rest/orders/list-orders.md): Orders for the authenticated account, most recent first. - [Place an order](https://docs.stxapp.io/api/rest/orders/place-order.md): Places a single order. - [Place several orders](https://docs.stxapp.io/api/rest/orders/place-several-orders.md): Places up to 100 orders (configurable) in one call. - [Portfolio](https://docs.stxapp.io/api/rest/portfolio.md): Money that has already moved: settlements, deposits, withdrawals, fees, adjustments and loyalty entries. - [List adjustments](https://docs.stxapp.io/api/rest/portfolio/list-adjustments.md): Manual corrections applied to the account balance by an administrator, most recent first, enriched with the reason recorded against each one. - [List deposits](https://docs.stxapp.io/api/rest/portfolio/list-deposits.md): Deposit history, most recent first, enriched with the payment method and the provider's reason for each transaction. - [List fees](https://docs.stxapp.io/api/rest/portfolio/list-fees.md): Fees charged against the account, most recent first, across every fee source: per-trade, per-settlement, market-group and event. - [List loyalty entries](https://docs.stxapp.io/api/rest/portfolio/list-loyalty.md): Loyalty point transactions, most recent first. - [List settlements](https://docs.stxapp.io/api/rest/portfolio/list-settlements.md): Settled positions and their payouts, most recent first. - [List withdrawals](https://docs.stxapp.io/api/rest/portfolio/list-withdrawals.md): Withdrawal history, most recent first, enriched with the payment method and the provider's reason for each transaction. ## Optional - [Changelog](https://docs.stxapp.io/changelog.md): Changes to the STX API, the SDKs, and these docs. - [Concepts](https://docs.stxapp.io/concepts.md): How the STX exchange works: binary contracts, order matching, liability, settlement and the limits that apply to your account. - [Environments](https://docs.stxapp.io/environments.md): Demo and production base URLs for each region. - [Explore](https://docs.stxapp.io/explore.md): Real STX data from your browser. See the exchange before you build against it. - [Live markets](https://docs.stxapp.io/explore/live-markets.md): A real STX order book, streaming in your browser. See the spread and the depth before deciding whether to build. - [ISV program](https://docs.stxapp.io/isv.md): Build an app that STX members connect to their account, with scoped, revocable access they approve on STX. - [Hosted pages](https://docs.stxapp.io/isv/hosted-pages.md) - [With the TypeScript SDK](https://docs.stxapp.io/isv/typescript-sdk.md): Link a member, act for them, read market data as your app, and unlink, with @stxapp/stx-typescript/oauth. - [OAuth](https://docs.stxapp.io/oauth.md): How an app acts for other STX members with OAuth 2.0, how that differs from an API key, and where OAuth is enabled. - [OAuth 2.0 authorization code flow](https://docs.stxapp.io/oauth/authorization-flow.md) - [Discovery and errors](https://docs.stxapp.io/oauth/discovery-and-errors.md): The OAuth metadata documents STX publishes, and the errors the OAuth endpoints and the API return. - [Scopes](https://docs.stxapp.io/oauth/scopes.md) - [Tokens and security](https://docs.stxapp.io/oauth/tokens-and-security.md) - [Integrate with STX](https://docs.stxapp.io/quick-start.md): Pick your environment, register and create an API key, sign your first request, and connect over WebSocket. - [Risk controls](https://docs.stxapp.io/risk-controls.md) - [SDKs](https://docs.stxapp.io/sdks.md): Official client libraries for the STX API. - [C# SDK](https://docs.stxapp.io/sdks/csharp.md): Official .NET SDK for the STX trading API. - [Authentication](https://docs.stxapp.io/sdks/csharp/authentication.md): API-key signing, email/password login, 2FA, token refresh, and background session keep-alive. - [Configuration](https://docs.stxapp.io/sdks/csharp/configuration.md): Register STX.Sdk services and pick the right endpoints per environment. - [Errors & retries](https://docs.stxapp.io/sdks/csharp/errors-and-retries.md): Exceptions STX.Sdk throws, what they mean, and how the SDK retries transient failures. - [Installation](https://docs.stxapp.io/sdks/csharp/installation.md): Install STX.Sdk from NuGet, required .NET version, and dependencies. - [Market data](https://docs.stxapp.io/sdks/csharp/markets.md): Query markets, events, sports, and competitions. - [Quickstart](https://docs.stxapp.io/sdks/csharp/quickstart.md): Install STX.Sdk, authenticate, and make your first call in under five minutes. - [Reference](https://docs.stxapp.io/sdks/csharp/reference.md): Full method signatures, grouped by concern. - [Account](https://docs.stxapp.io/sdks/csharp/reference/account.md): Identity, settlements, and terms-and-conditions services. - [Auth (legacy)](https://docs.stxapp.io/sdks/csharp/reference/auth-2fa.md): Email and password services, kept for integrations that already use them. - [Market data](https://docs.stxapp.io/sdks/csharp/reference/market-data.md): STXMarketService + STXEventService method signatures. - [Trading](https://docs.stxapp.io/sdks/csharp/reference/trading.md): STXOrderService + STXTradeService + relevant channels. - [Settlements](https://docs.stxapp.io/sdks/csharp/settlements.md): Query settlement history for your account. - [Trading](https://docs.stxapp.io/sdks/csharp/trading.md): Place and cancel orders, inspect trade history. - [WebSockets](https://docs.stxapp.io/sdks/csharp/websockets.md): Phoenix channels for real-time orders, trades, balance, and market updates. - [Python SDK](https://docs.stxapp.io/sdks/python.md): The Python SDK for the STX exchange. - [Async](https://docs.stxapp.io/sdks/python/async.md): AsyncSTX for concurrent requests, and client calls alongside WebSocket streams. - [Authentication](https://docs.stxapp.io/sdks/python/authentication.md): Pass your API key to the client: a credentials profile, environment variables, or keyword arguments. - [Environments](https://docs.stxapp.io/sdks/python/environments.md): Select the STX exchange the client connects to. - [Errors & retries](https://docs.stxapp.io/sdks/python/errors-and-retries.md): The typed exceptions the SDK raises, timeouts, and what it retries. - [Installation](https://docs.stxapp.io/sdks/python/installation.md): Install stx-python and import it. - [Markets](https://docs.stxapp.io/sdks/python/markets.md): Markets and events: filters, sorting, pagination, and the market object. - [Portfolio](https://docs.stxapp.io/sdks/python/portfolio.md): Balance, positions, fills, settlements, per-market stats and account history. - [Quickstart](https://docs.stxapp.io/sdks/python/quickstart.md): Install stx-python, add an API key, and make your first calls. - [API reference](https://docs.stxapp.io/sdks/python/reference.md): Every class and method in stx-python, generated from the source. - [AsyncSTX](https://docs.stxapp.io/sdks/python/reference/async-stx.md): The asyncio client: every method and its parameters. - [Channel](https://docs.stxapp.io/sdks/python/reference/channel.md): A joined WebSocket channel and the messages it delivers. - [Errors](https://docs.stxapp.io/sdks/python/reference/errors.md): Every exception the SDK raises. - [Page and retry policies](https://docs.stxapp.io/sdks/python/reference/helpers.md): Pagination results, batch order results, and the retry and reconnect policies. - [STX](https://docs.stxapp.io/sdks/python/reference/stx.md): The blocking client: every method, its parameters and what it returns. - [STXWebSocket](https://docs.stxapp.io/sdks/python/reference/stx-websocket.md): The WebSocket client: connecting, joining channels and reconnecting. - [Trading](https://docs.stxapp.io/sdks/python/trading.md): Place single and batch orders, cancel one, many or all, and read order state. - [WebSockets](https://docs.stxapp.io/sdks/python/websockets.md): Stream the order book, prices, trades, market changes and your account over one signed socket. - [TypeScript SDK](https://docs.stxapp.io/sdks/typescript.md): The TypeScript SDK for the STX exchange. - [Authentication](https://docs.stxapp.io/sdks/typescript/authentication.md): Pass your API key to the client: a credentials profile, environment variables, or constructor options. - [Environments](https://docs.stxapp.io/sdks/typescript/environments.md): Select the STX exchange the client connects to. - [Errors & retries](https://docs.stxapp.io/sdks/typescript/errors-and-retries.md): The typed errors the SDK throws, and what it retries. - [Installation](https://docs.stxapp.io/sdks/typescript/installation.md): Install @stxapp/stx-typescript and import it. - [Markets](https://docs.stxapp.io/sdks/typescript/markets.md): Markets, events, filters, and cursor pagination. - [Portfolio](https://docs.stxapp.io/sdks/typescript/portfolio.md): Read your balance, positions, fills, settlements and account history. - [API reference](https://docs.stxapp.io/sdks/typescript/reference.md): Every class and method in @stxapp/stx-typescript, generated from the source. - [AccountView](https://docs.stxapp.io/sdks/typescript/reference/account-view.md): The live view of your balance, open orders, fills and positions. - [Channel](https://docs.stxapp.io/sdks/typescript/reference/channel.md): A joined WebSocket channel and the messages it delivers. - [Errors](https://docs.stxapp.io/sdks/typescript/reference/errors.md): Every exception the SDK throws. - [Page and retry policies](https://docs.stxapp.io/sdks/typescript/reference/helpers.md): Pagination results and the retry and reconnect policies. - [STX](https://docs.stxapp.io/sdks/typescript/reference/stx.md): The client: every method, its parameters and what it returns. - [STXWebSocket](https://docs.stxapp.io/sdks/typescript/reference/stx-websocket.md): The WebSocket client: connecting, joining channels and reconnecting. - [Trading](https://docs.stxapp.io/sdks/typescript/trading.md): Place and cancel orders, set expiration, and arm cancel-on-disconnect. - [WebSockets](https://docs.stxapp.io/sdks/typescript/websockets.md): Stream market data and your account over one socket. - [Support](https://docs.stxapp.io/support.md): Where to ask, and what to include when a request is failing. - [WebSocket channels](https://docs.stxapp.io/websockets.md) - [Account Channel](https://docs.stxapp.io/websockets/channels/account.md) - [Balances Channel](https://docs.stxapp.io/websockets/channels/balances.md) - [Event volume (events)](https://docs.stxapp.io/websockets/channels/events.md) - [Fills Channel](https://docs.stxapp.io/websockets/channels/fills.md) - [Order book, ticker and trades](https://docs.stxapp.io/websockets/channels/market-data.md) - [Price history (market_stats)](https://docs.stxapp.io/websockets/channels/market-stats.md) - [Watched markets (market_updates)](https://docs.stxapp.io/websockets/channels/market-updates.md) - [All markets (markets)](https://docs.stxapp.io/websockets/channels/markets.md) - [Order Slip Channel](https://docs.stxapp.io/websockets/channels/order-slip.md) - [Orders Channel](https://docs.stxapp.io/websockets/channels/orders.md) - [Positions Channel](https://docs.stxapp.io/websockets/channels/positions.md) - [Settlements Channel](https://docs.stxapp.io/websockets/channels/settlements.md) - [User Info Channel](https://docs.stxapp.io/websockets/channels/user-info.md) - [Wire format](https://docs.stxapp.io/websockets/channels/wire-format.md) - [Market order book](https://docs.stxapp.io/websockets/order-book.md): The per-market channel that delivers one market's aggregated order book together with its full market record. ## Machine-readable - [OpenAPI document](https://docs.stxapp.io/openapi.json): the REST API contract, 16 operations - [Postman collection](https://docs.stxapp.io/downloads/stx-rest-api.postman_collection.json): with the Ed25519 signing script