OmniMarketX

Trade what matters.

Skip to Content

Quick start

Create an API key, sign a request and get your first market data.

This takes about five minutes. You need an OmniMarketX account. Any account works for reading.

Create an API key

Go to Settings → API and choose New key. Give it a name and choose its permissions:

  • Read: markets, prices, your practice portfolio. Every account.
  • Practice trading: place practice orders. Needs OmniMarket Pro.

The private key is shown once. Save it somewhere safe before you close the window. If you lose it, revoke the key and create a new one.

Sign each request

Every request carries three headers:

HeaderValue
OMX-KEY-IDyour key id, for example omx_test_…
OMX-TIMESTAMPthe current time in milliseconds
OMX-SIGNATUREyour signature, base64

The signature is your Ed25519 private key signing these four lines, joined with a new line:

TIMESTAMP
METHOD
PATH_WITH_QUERY
hex(sha256(BODY))

The timestamp must be within 30 seconds of our clock. The path starts with /api/public/v1.

Make your first call

# pip install cryptography requests
import base64, hashlib, time, requests
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey

KEY_ID = "omx_..."        # from Settings → API
PRIVATE_KEY = "..."       # shown once when you created the key
BASE = "{{API_BASE}}"
key = Ed25519PrivateKey.from_private_bytes(base64.b64decode(PRIVATE_KEY))

def call(method, path, body=b""):
    ts = str(int(time.time() * 1000))
    msg = f"{ts}\n{method}\n/api/public/v1{path}\n{hashlib.sha256(body).hexdigest()}"
    sig = base64.b64encode(key.sign(msg.encode())).decode()
    headers = {"OMX-KEY-ID": KEY_ID, "OMX-TIMESTAMP": ts, "OMX-SIGNATURE": sig,
               "Content-Type": "application/json"}
    return requests.request(method, BASE + path, data=body, headers=headers).json()

print(call("GET", "/markets?limit=5"))

You get back the same markets the website shows, each with its real price and its practice price.

Next

Last updated on