# Roleta ao Vivo history: every spin, page by page

> How to download the Roleta ao Vivo history from the API's /results: pages going back with before, gap-free sync with after, and how much history each plan keeps.

Source: https://lynxmetrics.com/en/blog/roleta-ao-vivo/roleta-ao-vivo-history · Published on 2026-11-21, updated on 2026-11-21

The **Roleta ao Vivo history** is what separates a look at the table from a real study. The
[public page](https://lynxmetrics.com/live/roleta-ao-vivo) shows the latest spins; for the whole day, the week or everything since launch, the
way in is the `/results` of the [Roleta ao Vivo API](https://lynxmetrics.com/apis/roleta-ao-vivo). It works in two ways, and each one solves
a problem.

## Going back: before

With no parameters, `/results` returns the latest spins, newest first, 50 per page (up to 250 on Pro and 1,000 on
Business with `limit`). The answer has a `nextCursor`: pass it in `before` to get the next page, and it comes back
`null` when there is nothing left.

```python
import requests

URL = "https://api.lynxmetrics.com/v1/roleta-ao-vivo/results"
KEY = {"x-api-key": "YOUR_KEY"}

spins, before = [], None
while True:
    params = {"limit": 250, **({"before": before} if before else {})}
    page = requests.get(URL, params=params, headers=KEY, timeout=20).json()
    spins += page["data"]
    before = page["nextCursor"]
    if not before:
        break
print(len(spins), "spins, from", spins[-1]["settledAt"], "to", spins[0]["settledAt"])
```

For a single day, combine both cursors: `after` with the start of the day and `before` with the end, and the answer
covers only the interval between them.

## Going forward: after

The other use is keeping your own copy up to date. Store the `id` (or the `settledAt`) of the last spin you already
have and ask for `after`: the API returns only the spins after it, oldest first. If the page comes back full, the
`nextCursor` goes in the next `after`; if it is `null`, you are up to date.

```python
def sync(last_id):
    while True:
        page = requests.get(URL, params={"after": last_id, "limit": 250}, headers=KEY, timeout=20).json()
        for spin in page["data"]:
            store(spin)            # your database, your spreadsheet
            last_id = spin["id"]
        if not page["nextCursor"]:
            return last_id
```

This pattern never skips or repeats a spin, even if your program is down for hours: it is the right way to combine
`/stream` with the history. The whole topic of storing live data in a database is in
[storing real-time data](https://lynxmetrics.com/blog/storing-real-time-data).

## How much history each plan keeps

| Plan | History | Spins per query |
| --- | --- | --- |
| Pro (R$ 21.90 a month) | last 7 days | up to 250 |
| Business (R$ 49.90 a month) | full, since 11/20/2026 | up to 1,000 |

Asking for a date older than the plan allows returns `plan_limit`, with the explanation. Since Roleta ao Vivo spins
about 73 times an hour, seven days of history are close to 12 thousand spins.

## A good history has no gaps

Roleta ao Vivo stops now and then (dealer change, studio pause), and the history shows those intervals as they were:
no invented spins. Each spin has a fixed `id`, so two copies of the same history match each other. For the numbers you
draw from it, see [how Brazilian Roulette works](https://lynxmetrics.com/blog/roleta-brasileira/how-brazilian-roulette-works) (the rules are
the same) and the [Roleta ao Vivo API](https://lynxmetrics.com/blog/roleta-ao-vivo/roleta-ao-vivo-api) guide.

## Frequently asked questions

### Where can I see today's Roleta ao Vivo history?

The latest spins are on the public results page. The whole day and earlier days are in the API, through /results, which pages back with before and forward with after.

### How much Roleta ao Vivo history does the API keep?

The last 7 days on the Pro plan and the full history, since November 20, 2026, on Business.

### How do I download the Roleta ao Vivo history without skipping spins?

With the after parameter: you pass the id of the last spin you have, and the API returns only the following ones, in order, until you are up to date.
