OmniMarketX

Trade what matters.

Skip to Content

Using the API

Markets, practice orders, errors, limits and live updates.

All addresses below start with https://api.omnimarketx.com/api/public/v1. Every request is signed as described in the Quick start.

Markets and prices

RequestReturns
GET /marketsMarkets, with filters status, category, q (text), sort, limit, offset
GET /markets/{id}One market: options, resolution rules, close time
GET /markets/{id}/pricesReal-money prices
GET /practice/markets/{id}/pricesPractice prices
GET /markets/{id}/historyPrice history of one option (optionKey, period)

Each market has two prices per option:

  • Real price (options[].currentPrice): the real-money market, for reference.
  • Practice price (practicePrices): what practice orders fill at.

They move separately, so always use the practice price when you trade.

Your practice account

RequestReturns
GET /meYour username, Pro status and this key's permissions
GET /practice/accountPractice balance
GET /practice/positionsOpen practice positions
GET /practice/ordersYour practice orders, newest first

Practice orders

Placing orders needs a key with Practice trading and an active OmniMarket Pro subscription.

Preview first

GET /practice/markets/{id}/quote?optionKey=YES&side=BUY&amountUsd=25 returns:

  • shares: how many shares you get
  • avgPrice: the average price you pay. Your price limit is checked against this number.
  • priceNow: the practice price before your order
  • cost, fee, total

Bigger orders move the price, so avgPrice rises with the amount.

Place the order

POST /practice/orders
{
  "clientOrderId": "my-bot-0001",
  "marketId": "<market id>",
  "optionKey": "YES",
  "side": "BUY",
  "amountUsd": 25,
  "maxPrice": 0.62
}
  • Price limit (required): maxPrice for a BUY, minPrice for a SELL (with shares). The order fills completely at or better than your limit, or is refused. It is never half-filled.
  • clientOrderId (required): your own id for this order. Sending the same request again returns the first result with "replayed": true and never creates a second order. Reusing the id for a different order is refused.

Errors explained

Every error has a success: false, an error code and a plain message.

CodeWhat it meansWhat to do
credential_requiredNo key or token was sentAdd the three signing headers
invalid_credentialThe key is unknown, revoked or expiredCreate a new key
invalid_signatureThe signature doesn't matchCheck the four signed lines and the path with query
stale_requestThe timestamp is too old or was already usedUse the current time; send each request once
wrong_environmentA test key on production, or the reverseUse a key from this site
ip_not_allowedThe request came from an IP the key doesn't allowUpdate the key's IP allow list
scope_requiredThe key or connection can only readUse a key with Practice trading (Pro)
pro_subscription_requiredTrading needs OmniMarket ProGet Pro, or trade on the website
price_limit_requiredNo maxPrice / minPriceAdd a price limit
price_limit_exceededThe price moved past your limitGet a new quote and try again
client_order_id_conflictThis clientOrderId was used for another orderUse a new id
insufficient_balanceNot enough practice balanceUse a smaller amount
insufficient_sharesYou don't hold that many sharesSell fewer shares
market_not_tradable / market_closingThe market is closed or closes very soonChoose another market
market_api_pausedTrading through the API is paused on this marketTry later, or use the website
api_trading_disabledTrading through the API is switched off for nowTry later; reading still works
key_exposure_cap / market_exposure_capThe order would pass a safety capUse a smaller amount
rate_limitedToo many requestsWait for the seconds in Retry-After
temporarily_unavailableWe couldn't safely check the requestRetry shortly; nothing was placed

Rate limits

  • Per key or connected assistant: 120 reads and 30 orders per minute. Each response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
  • Up to 5 keys per account. Keys can have an IP allow list and an expiry date.
  • Trading through the API stops a few minutes before a market closes.

Live updates

Open a WebSocket to https://api.omnimarketx.com/api/public/v1/stream with your signing headers, then subscribe to topics:

TopicSends
market:<id>:pricesReal-price changes
market:<id>:practice-pricesPractice-price changes
me:ordersYour practice orders as they fill

Up to 3 streams per key. Revoking the key closes its streams.

Last updated on