LynxMetrics

Documentation · Mega Wheel

Mega Wheel API

Rounds from Pragmatic Play's Mega Wheel table: the wheel segment (1, 2, 5, 8, 10, 15, 20, 30 or 40) and the multiplier drawn in the round, with the slot it landed on. This page shows how the Mega Wheel API responds, with every field explained.

https://api.lynxmetrics.com/v1/mega-wheel

See Mega Wheel live

View as Markdown

Authentication

Send a key created in the dashboard for Mega Wheel in the x-api-key header, since a key from another API gets key_wrong_api.

curl https://api.lynxmetrics.com/v1/mega-wheel/latest \
  -H "x-api-key: YOUR_KEY"

Keys, the trial and subscriptions (you can subscribe to the same API several times, each with its own keys) work the same on every API and are explained in the general documentation.

Code examples

Ready-to-copy examples in Python, Node.js and PHP. Replace YOUR_KEY with the key from your dashboard and run it: each one calls the on_round function (onRound in Node.js) on every new Mega Wheel round, and that is where your code goes.

Real time over the stream (recommended)

One open connection that receives every round the moment it closes. Only opening the connection costs a request, so you never hit the per-minute limit, and it is the fastest way to get the data. The example reconnects on its own, sends last-event-id to receive in missed whatever closed while it was away, and stops when closed arrives.

import json
import time
import requests

API = "https://api.lynxmetrics.com/v1/mega-wheel"
KEY = "YOUR_KEY"


def on_round(r):
    print(r["id"], r["outcome"], r["data"])


def listen():
    last_id = None
    while True:
        headers = {"x-api-key": KEY, "accept": "text/event-stream"}
        if last_id:
            headers["last-event-id"] = last_id
        try:
            with requests.get(API + "/stream", headers=headers, stream=True, timeout=(10, 60)) as res:
                if res.status_code != 200:
                    print("HTTP", res.status_code, res.text)
                    time.sleep(int(res.headers.get("retry-after", 10)))
                    continue
                res.encoding = "utf-8"
                event, data = None, []
                for line in res.iter_lines(chunk_size=1, decode_unicode=True):
                    if line.startswith("event:"):
                        event = line[6:].strip()
                    elif line.startswith("data:"):
                        data.append(line[5:].strip())
                    elif line == "":
                        if event and data:
                            body = json.loads("\n".join(data))
                            if event == "ready":
                                for r in body.get("missed") or []:
                                    on_round(r)
                                if body.get("data"):
                                    last_id = body["data"]["id"]
                            elif event == "round":
                                on_round(body["data"])
                                last_id = body["data"]["id"]
                            elif event == "closed":
                                return
                        event, data = None, []
        except requests.RequestException as error:
            print("reconnecting:", error)
        time.sleep(3)


listen()

Latest with wait (no open connection)

For those who prefer to ask instead of keeping a connection open. ?wait=20 holds the response until the next Mega Wheel round closes, for at most 20 seconds, so the round arrives the moment it closes and the example makes a few requests per minute instead of asking all the time. It sends the ETag of the last response in if-none-match: while nothing changes, the wait ends in a bodiless 304, and on a 429 it waits for the time in the retry-after header instead of insisting.

import time
import requests

API = "https://api.lynxmetrics.com/v1/mega-wheel"

session = requests.Session()
session.headers["x-api-key"] = "YOUR_KEY"


def on_round(r):
    print(r["id"], r["outcome"], r["data"])


etag = None
last_id = None
while True:
    try:
        res = session.get(
            API + "/latest",
            params={"wait": 20},
            headers={"if-none-match": etag} if etag else {},
            timeout=30,
        )
    except requests.RequestException as error:
        print("retrying:", error)
        time.sleep(5)
        continue

    if res.status_code == 200:
        etag = res.headers.get("etag")
        r = res.json()["data"]
        if r and r["id"] != last_id:
            if last_id:
                on_round(r)
            last_id = r["id"]
    elif res.status_code == 429:
        time.sleep(int(res.headers.get("retry-after", 5)))
        continue
    elif res.status_code != 304:
        print("HTTP", res.status_code, res.text)
        time.sleep(10)
        continue
    time.sleep(2)

Send every round to Telegram

Replace the on_round function of any example above with this one, using your bot token (the one @BotFather gives you) and the id of the chat or channel. outcome and everything inside data are explained further down, in Fields of each round.

BOT_TOKEN = "123456:ABC..."
CHAT_ID = "-1001234567890"


def on_round(r):
    text = f"{r['outcome'].upper()} · {r['id']}"
    requests.post(
        f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage",
        json={"chat_id": CHAT_ID, "text": text},
        timeout=10,
    )

What breaks bots most often

  • Do not poll faster than the table plays. With less than 1 second between requests you only burn your limit and get 429: the new round does not arrive any sooner. If you need the result within the same second, use /stream.
  • On a 429, read the retry-after header and wait that long, because retrying right away does not help. Every response carries x-ratelimit-remaining and x-ratelimit-reset, which tell you how much still fits in the minute.
  • A 401 on every call means the key is wrong, revoked or was rotated in the dashboard: copy the key again. Many attempts in a row with an invalid key make your IP receive 429 for a while, even after you fix it.
  • trial_expired means the trial hours are over. Subscribe to a plan in the dashboard and the same key works again, with no code change.
  • If your bot was down, do not guess what it missed: call /results?after= with the id of the last round you have and receive, in order, every round that closed after it.
  • Each key has a number of stream connections, shown in the limits table. Go over it and the oldest connection is ended with closed. To run several bots, create one key for each in the dashboard.

GET /v1/mega-wheel/latest

The latest Mega Wheel round, or null if there is none yet.

  • waitnumber

    Seconds the response may wait for the next round, up to 20. It only waits if you already have the latest one: send its ETag in if-none-match or its id in after. When a round closes, the response comes right away with it; if the time runs out first, you get 304 (with ETag) or the same round (with after). It counts as a single request, and your client timeout must be longer than wait.

  • afterid

    The id of the last round you have. Only used together with wait, for clients that do not keep the ETag.

Response

{
  "data": {
    "id": "p19858971304",
    "game": "mega-wheel",
    "tableId": "pragmatic-mega-wheel",
    "startedAt": "2026-12-05T01:46:14.000Z",
    "settledAt": "2026-12-05T01:46:58.868Z",
    "outcome": "20",
    "data": {
      "segment": 20,
      "multiplier": 88,
      "multiplierSlot": 30,
      "sector": "2019"
    }
  }
}

GET /v1/mega-wheel/results

Mega Wheel rounds from newest to oldest. To fetch the next page, pass the response's nextCursor as before, and when it comes back null there are no more results.

  • limitnumber

    How many rounds to return, 50 by default and 250 to 1000 at most.

  • beforeISO 8601

    Returns only rounds settled before this date, like the nextCursor of the previous page, and how far back you can go depends on the plan.

  • afterISO 8601 | id

    To sync without repeating or skipping rounds, pass the settledAt or the id of the last round you already have, and the response brings only the rounds settled after it, from oldest to newest, up to limit. When the page comes back full, pass its nextCursor as the next after, and when it comes back null you are up to date. It also follows the plan's history limit and can be combined with before.

GET /v1/mega-wheel/results?limit=1

{
  "data": [
    {
      "id": "p19858971304",
      "game": "mega-wheel",
      "tableId": "pragmatic-mega-wheel",
      "startedAt": "2026-12-05T01:46:14.000Z",
      "settledAt": "2026-12-05T01:46:58.868Z",
      "outcome": "20",
      "data": {
        "segment": 20,
        "multiplier": 88,
        "multiplierSlot": 30,
        "sector": "2019"
      }
    }
  ],
  "nextCursor": "2026-12-05T01:46:58.868Z"
}

GET /v1/mega-wheel/stream

Live Mega Wheel rounds over a connection that stays open (SSE, Server-Sent Events): every round arrives the moment it is saved, with no polling on your side. It is the fastest path, because it removes the gap between your requests. It is plain HTTP, so it goes through proxies and CDNs and works with any client that can send a header and read continuously.

curl -N https://api.lynxmetrics.com/v1/mega-wheel/stream \
  -H "x-api-key: YOUR_KEY" \
  -H "accept: text/event-stream"

Response

event: round
data: {
data:   "data": {
data:     "id": "p19858971304",
data:     "game": "mega-wheel",
data:     "tableId": "pragmatic-mega-wheel",
data:     "startedAt": "2026-12-05T01:46:14.000Z",
data:     "settledAt": "2026-12-05T01:46:58.868Z",
data:     "outcome": "20",
data:     "data": {
data:       "segment": 20,
data:       "multiplier": 88,
data:       "multiplierSlot": 30,
data:       "sector": "2019"
data:     }
data:   },
data:   "timing": {
data:     "receivedAt": "2026-12-05T01:47:02.768Z",
data:     "sentAt": "2026-12-05T01:47:02.818Z"
data:   }
data: }

What arrives on the connection

  • readyevent

    Arrives once, as soon as the connection opens, carrying the latest settled round so you start in sync. It is not a new round: compare its id with the last one you have and don't count it twice. data comes null while there is no round yet. On a reconnect it also carries, in missed, the rounds that settled while you were away.

  • roundevent

    One per new round, carrying in data the same object /latest returns, the delivery timestamps in timing and, when the round had a phase, its ref. The event id is the round id, and only round carries an id, because it is the resume point on a reconnect.

  • correctionoptional

    Optional: it only arrives if you ask for it with ?corrections=1. It tells you that a round already delivered as round has changed: in Bac Bo, about once every 2,000 rounds the table re-shakes one cup after the dice had settled, and the die that was published no longer counts. It carries data, the round as it now stands (same id and same timestamps), previous, with the outcome and data that had been delivered, and sentAt. It has no event id, so last-event-id does not move. It arrives when that round ends on the table, from 30 seconds to 3 minutes after the round. Even if you don't ask for it, /latest, /results and /stats start returning the corrected round.

  • gapevent

    This connection's queue overflowed and rounds were dropped: your client wasn't keeping up. It carries resyncError: too_many_missed, the same code as a reconnect that went long. The connection stays open, and this is the only case where a round is missing mid-stream, always announced, because the ids aren't sequential and you'd have no way to notice. To close the hole, ask /results?after= with the id of the last round you received.

  • closedevent

    Your connection was ended because a newer one was opened with the same key. It carries reason: "replaced". This is not a network drop, so do not reconnect automatically: reconnecting here would only kill the newer connection, which would then reconnect and kill yours, with no end to it.

  • : pingcomment

    Every 20 seconds without a round, a line starting with a colon goes out. It is not an event and can be ignored; it only stops a proxy in between from closing an idle connection.

Timestamps and delay

Events carry the timestamps of each leg of the trip, so you measure the real delay instead of estimating it. The round's timestamps are on the table's clock; the delivery ones are on our API's clock. The delay for Mega Wheel is measured against the table and shows up in each event's own timestamps, round by round.

  • data.startedAtISO 8601

    The UTC instant the round started, or null when it was not seen (the round is just as valid: its instant is settledAt).

  • data.settledAtISO 8601

    End of the round on the table's clock: the moment the result was settled at the source. It is also the date used for ordering, for before and for after.

  • timing.receivedAtISO 8601

    When the result was ready on our side. The gap between it and settledAt is the delay from the source to us, which is the part that is in our hands.

  • timing.sentAtISO 8601

    When this event was written to your connection. The gap between it and receivedAt is how long the round waited in this connection's queue, usually a few milliseconds; the rest of the delay to your code is network.

Reconnecting without losing a round

When reconnecting, send the id of the last round you received in the last-event-id header: an SSE client that reconnects on its own already sends that header, and if you drive the reconnect yourself you send either the header or ?last_event_id=, whichever suits you. ready comes back with missed: the rounds that settled while you were away, oldest to newest. The stream covers absences of up to 50 rounds; if more than that settled, it does not hand you the most recent ones and does not even try: missed comes null with too_many_missed, and you close the gap with /results?after=. data is still the latest settled round, which is normally the last item of missed. When recovery isn't possible, missed comes null and resyncError says why; the connection opens either way, because a reconnect must never fail over a stale cursor.

curl -N https://api.lynxmetrics.com/v1/mega-wheel/stream \
  -H "x-api-key: YOUR_KEY" \
  -H "accept: text/event-stream" \
  -H "last-event-id: p19858971304"
  • bad_cursorresyncError

    The value sent is neither a round id nor an ISO 8601 date.

  • unknown_roundresyncError

    That id is not one of our rounds on this API. It may be from another API, or from a round we ended up dropping: a phase is no guarantee that the round will exist.

  • plan_limitresyncError

    The round is older than your plan's history.

  • too_many_missedresyncError

    More than 50 rounds settled while you were away, which means you were out too long for the stream to sort it out on its own. Ask /results?after= with the id you have and page through until you are in sync.

Keeping the connection

  • Within a connection, events go out one at a time and in chronological order: a round's phases always before its result (betting, resolving and round, carrying the same ref), and each round with a settledAt later than the previous one. A round's betting may arrive just before the previous round's round, because one comes from the table and the other from the database; what holds is the order within each round. No round arrives twice on the same connection. If your connection gets slow and its queue overflows, the oldest rounds are dropped and an event: gap goes out to tell you.
  • Each plan allows a number of simultaneous connections per key, shown in the limits table below. Going over it is not an error: the oldest connection on that key is ended with an event: closed and the new one takes its place. That way a process that died without the system telling us never locks you out of your own slot.
  • Every connection ends after 6 hours, even a healthy one, and the client is expected to reconnect. That ending carries no event: the connection simply closes, and closed is only about replacement, so a read that ends for no reason after hours open is this deadline. This is deliberate: connections do die silently, and this deadline is what stops one from holding a slot forever. Something running all day reconnects about four times a day.
  • If your client has a read timeout, keep it above 20 seconds, or it will cut the connection during the silence between rounds.
  • Opening the connection spends one request from your per-minute limit. The rounds that arrive afterwards cost nothing, so following the stream weighs less on the limit than polling /latest.
  • The key is only accepted in the x-api-key header, never in the URL, which would end up in proxy logs and browsing history. That is why the browser's EventSource won't do: it cannot send headers. In the browser, the way in is a fetch reading the body as it arrives; better still is your own server listening to the stream and passing it on, because a key in the browser would be visible to every visitor.

GET /v1/mega-wheel/stats

Mega Wheel statistics computed on the fly over the latest rounds.

  • samplenumber

    How many recent rounds to compute over, 100 by default and 250 to 1000 at most.

GET /v1/mega-wheel/stats (excerpt)

{
  "data": {
    "total": 100,
    "counts": {
      "1": 30,
      "2": 24,
      "5": 15,
      "8": 11,
      "10": 8,
      "15": 5,
      "20": 4,
      "30": 2,
      "40": 1
    },
    "currentStreak": { "outcome": "1", "length": 1 },
    "numbers": {
      "multiplier": {
        "count": 100,
        "min": 5,
        "max": 500,
        "mean": 46.3,
        "percentiles": { "p50": 25, "p90": 88 },
        "atLeast": {
          "20": { "count": 62, "percent": 62, "sinceLast": 0 },
          "50": { "count": 31, "percent": 31, "sinceLast": 0 },
          "100": { "count": 8, "percent": 8, "sinceLast": 9 },
          "500": { "count": 1, "percent": 1, "sinceLast": 57 }
        }
      }
    },
    "sample": {
      "from": "2026-12-05T00:27:40.000Z",
      "to": "2026-12-05T01:46:58.868Z"
    }
  }
}

Round fields

Shape of each Mega Wheel round in latest and results.

  • idstring

    Round id, unique and stable. It is generated by us, not by the provider, so use it only to compare and as a cursor (in after and last-event-id), without parsing its content.

  • gamestring

    API slug, always "mega-wheel" here.

  • tableIdstring | null

    Table id at the provider, or null when the source does not provide it.

  • startedAtstring | null

    The UTC instant the round started, or null when it was not seen (the round is just as valid: its instant is settledAt).

  • settledAtstring

    Round end in UTC, which is the date used for ordering and for before.

  • outcome"1" | "2" | "5" | "8" | "10" | "15" | "20" | "30" | "40"

    The segment the wheel stopped on, as text: 1, 2, 5, 8, 10, 15, 20, 30 or 40.

  • data.segmentnumber

    The winning segment, as a number. It is the same segment as outcome.

  • data.sectorstring | null

    The wheel sector where it stopped, as the table reports it, as text (e.g. "2019").

  • data.multipliernumber | null

    The multiplier drawn in the round (5 to 500 seen so far).

  • data.multiplierSlotnumber | null

    The segment that received the round multiplier, e.g. 30. The API delivers what the table reports and does not compute the payout: the multiplier only applies when multiplierSlot equals segment.

Statistics fields

  • totalnumber

    How many rounds were counted, equal to sample or fewer if there are not enough yet.

  • countsobject

    How many times each wheel segment came out in the sample.

  • percentagesobject

    The same counts as percentages, with one decimal place.

  • currentStreak{ outcome, length } | null

    The segment repeating right now and for how many rounds, or null with no rounds.

  • outcomesobject

    One block per segment: count (how many times it came out), percent, longestStreak (the longest run in the sample) and sinceLast (rounds since the last time, 0 for the most recent and null if it did not come out in the sample). Same shape in every API.

  • numbers{ multiplier }

    In multiplier, the multiplier drawn in the rounds: count, min, max, mean, percentiles and, in atLeast, how many rounds had a multiplier of at least 20, 50, 100, 200 and 500.

  • sample{ from, to } | null

    Sample period: the settledAt of the oldest round (from) and the newest (to), or null with no rounds.

Plans and limits

Limits of the Mega Wheel API on each plan. A parameter above the maximum is lowered to the maximum, and a before older than the plan's history returns plan_limit. The per minute column is the requests per minute limit of each subscription, adding up all of its keys, and the connections column is how many /stream connections the same key can keep open at once.

PlanPricePer minuteConnectionslimitsamplebefore
Trial24 hours, no card6012502507 days
Pro≈ $3.84/month6012502507 days
Business≈ $8.75/month400510001000full

Errors have the same format on every API and are listed in the general documentation.