> ## Documentation Index
> Fetch the complete documentation index at: https://doc.va777.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and continuous polling

> Page through results with nextToken, and poll bet records continuously without gaps.

## Pagination

List APIs page with `nextToken` and `maxResults`:

* Across pages of one query, send the same parameters except `nextToken` and `sign`. Different parameters start a new query.
* On the first page, send an empty `nextToken`. On each following page, send the `nextToken` from the previous response.
* The query ends when a response returns no data and an empty `nextToken`.

### Example

For [List bet records](https://doc.va777.net/en/api-reference/betlog/list-by-time.md) with 12000 records in total, fetching 5000 at a time:

| Round | Input nextToken | Input maxResults | Records returned | Output nextToken | Output maxResults |
| - | - | - | - | - | - |
| 1 | (empty) | 5000 | 5000 | `1stqwertuy` | 5000 |
| 2 | `1stqwertuy` | 5000 | 5000 | `2nddsv56hd` | 5000 |
| 3 | `2nddsv56hd` | 5000 | 2000 | `3rdtbg6jdh` | 5000 |
| 4 | `3rdtbg6jdh` | 5000 | 0 | (empty) | 5000 |

## Polling bet records continuously

When you poll [List bet records](https://doc.va777.net/en/api-reference/betlog/list-by-time.md) or [List historical bet records](https://doc.va777.net/en/api-reference/betlog/history/list-by-time.md) over consecutive time ranges for records and reconciliation, **make each query's start time equal to the previous query's end time** so no records are missed.

Polling 1 minute at a time:

| Query | Start time | End time |
| - | - | - |
| 1 | `2025-12-01T00:00:00.000+08:00` | `2025-12-01T00:01:00.000+08:00` |
| 2 | `2025-12-01T00:01:00.000+08:00` | `2025-12-01T00:02:00.000+08:00` |
| 3 | `2025-12-01T00:02:00.000+08:00` | `2025-12-01T00:03:00.000+08:00` |

> [!WARNING]
>
> With this approach, bets within less than 1 millisecond of the boundary between two queries can be returned twice. Remove duplicates on your side.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.