Blog · Lightning Baccarat

Lightning Baccarat history: how to download past rounds

How to pull the full Lightning Baccarat history from the API: pagination with before, syncing with after, exporting to CSV, and what the data is good for.

Published on October 30, 2026 · 5 min read

Any broadcast shows the latest result for free. What you cannot find lying around is the complete, gap-free Lightning Baccarat history: every hand, in order, with the cards that came out. That is where a results API earns its place, and it is what this article teaches you to download.

The Lightning Baccarat API keeps every round it has read since 30 October 2026, the day it went live. Nothing is discarded: the Pro plan queries the last 7 days and Business queries everything.

The history endpoint

curl "https://api.lynxmetrics.com/v1/lightning-baccarat/results?limit=100" \
  -H "x-api-key: YOUR_KEY"

The response returns rounds newest first, in the same format as /latest, plus a cursor:

{
  "data": [ { "id": "v1793371825421", "settledAt": "2026-10-30T18:10:58.903Z", "outcome": "player", "...": "..." } ],
  "nextCursor": "2026-10-30T17:44:12.118Z"
}
ParameterWhat it does
limitHow many rounds to return. Default 50, max 250 on Pro and 1,000 on Business
beforeOnly rounds settled before this date. This is where the previous page's nextCursor goes
afterOnly rounds settled after the id or settledAt you pass, oldest first

When nextCursor comes back null, there are no more pages.

Downloading the whole history, one page at a time

The pattern is always the same: ask for a page, store it, send the cursor back in before, repeat. In Python:

download-history.py

import json
import time
import requests

URL = "https://api.lynxmetrics.com/v1/lightning-baccarat/results"
HEADERS = {"x-api-key": "YOUR_KEY"}

rounds = []
cursor = None
while True:
    params = {"limit": 250}
    if cursor:
        params["before"] = cursor
    response = requests.get(URL, headers=HEADERS, params=params, timeout=30)
    response.raise_for_status()
    body = response.json()
    rounds.extend(body["data"])
    cursor = body["nextCursor"]
    print(len(rounds), "rounds")
    if not cursor:
        break
    time.sleep(1)   # slack for the per-minute limit

with open("lightning-baccarat.json", "w", encoding="utf-8") as file:
    json.dump(rounds, file, ensure_ascii=False)

Two things worth noticing here:

  • The time.sleep(1). The limit is per minute (60 requests on Pro, 400 on Business), and a one-second pause between pages keeps you well clear of it. Without the pause you get a 429 with a Retry-After header telling you how long to wait.
  • A before older than your plan's history answers plan_limit. On Pro that happens when you reach 7 days — it is not a bug in your code, it is the end of what the plan covers.

Keeping a copy in sync: the after parameter

For anyone storing rounds in their own database, after is more useful than before. You pass the id of the last round you already have and receive only what came after it, in chronological order:

def sync(last_id):
    while True:
        r = requests.get(URL, headers=HEADERS, params={"after": last_id, "limit": 250}, timeout=30)
        body = r.json()
        for round_ in body["data"]:
            store(round_)           # your database, keyed by the unique id
            last_id = round_["id"]
        if not body["nextCursor"]:
            return last_id          # you are in sync

This is the right way to never skip or repeat a round, and it is also the stream's complement. A short outage the stream handles by itself: reconnecting with last-event-id returns up to 50 rounds from your absence. /results?after= is for when the absence was longer than that — the stream flags it with resyncError: "too_many_missed" — or when you are building the copy for the first time. The live path is in live results.

Turning it into CSV or a spreadsheet

To study it in Excel, Sheets or pandas, nested JSON gets in the way. One row per round fixes that:

to-csv.py

import csv

with open("lightning-baccarat.csv", "w", newline="", encoding="utf-8") as file:
    writer = csv.writer(file)
    writer.writerow(
        ["id", "settledAt", "outcome", "player_cards", "player_score", "player_pair",
         "banker_cards", "banker_score", "banker_pair", "natural", "cards"]
    )
    for r in rounds:
        p, b = r["data"]["player"], r["data"]["banker"]
        writer.writerow([
            r["id"], r["settledAt"], r["outcome"],
            " ".join(p["cards"]), p["score"], p["pair"],
            " ".join(b["cards"]), b["score"], b["pair"],
            r["data"]["natural"], len(p["cards"]) + len(b["cards"]),
        ])

The last column, the round's total card count, does not come from the API: it is a one-line computation that immediately separates the short hands from the ones that went to a third card. That kind of derived column is where history starts paying off.

What you can study with the history

With the rounds in hand, questions nobody answers by watching the broadcast are one query away:

  • How many hands per hour the table actually runs, and at what times it stops to shuffle or change dealer.
  • What fraction of rounds end in a natural, and how that compares with the theoretical probability.
  • How often a pair shows up on each side, which is the most common side bet.
  • The distribution of streak lengths: how many times the same side won 3, 4, 5 times in a row in your sample.
  • How far your sample sits from the long-run percentages, which is the exercise in the statistics article.

It is worth saying what the history does not do, because it is the most tempting use and the only one that does not work: it does not point to the next hand. Testing a strategy against the past shows how it would have behaved in that past, and nothing more — every new hand comes out of a shuffled shoe, indifferent to what came before.

How much history each plan covers

PlanPriceHistoryPer requestPer minute
ProR$ 21.90/monthlast 7 daysup to 250 rounds60 requests
BusinessR$ 49.90/monthfull, since 30 Oct 2026up to 1,000 rounds400 requests

The free 2-hour trial uses Pro limits, so you can run the whole download script before subscribing to anything. Each round's fields are listed in the documentation and explained in the API overview.

Frequently asked questions

How far back does the Lightning Baccarat history go at LynxMetrics?

To 30 October 2026, when the API went live. Every round read since then is kept, with no discarding: the Pro plan queries the last 7 days and Business the full history.

How many Lightning Baccarat rounds come in each request?

The default is 50 and the maximum is 250 on the Pro plan and 1,000 on Business. To go further, pass the response's nextCursor in the before parameter and ask for the next page.

How do I sync my database without repeating or skipping rounds?

Use the after parameter with the id of the last round you already have: the response returns only the rounds settled after it, oldest first. Store the id as a unique key, because it is fixed and never changes.

Can I export the Lightning Baccarat history to CSV or Excel?

Yes. The API returns JSON and a dozen lines of Python convert it to CSV, with one row per round and columns for cards, score, pair and natural. The article includes the script.

Can the history predict the next round?

No. It shows what happened and lets you measure past frequencies and streaks. Every new hand comes out of a shuffled shoe and does not depend on the previous ones, so no pattern in the history points to the next result.

For adults 18 and over only. LynxMetrics is not affiliated with Evolution or with the casinos that offer Lightning Baccarat, and it only sells data and stats, never predictions or betting tips, because every round is random and past results do not predict the next one.

Read also