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

# Pagination

> How to work with paginated API responses

OneBalance API uses cursor-based pagination for endpoints that return large collections of items. This approach provides efficient navigation through result sets.

## How Pagination Works

The `/status/get-tx-history` endpoint supports pagination through the following parameters:

| Parameter      | Type   | Required | Description                                                                  |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `limit`        | string | Yes      | Maximum number of transactions to return in a single request (e.g., `10`)    |
| `continuation` | string | No       | A cursor value received from a previous response used to fetch the next page |

## Response Format

Paginated responses include:

```json Paginated Response theme={null}
{
  "transactions": [
    // Array of transaction objects
  ],
  "continuation": "txn_00123456789abcdef" // Token to fetch the next page
}
```

The `continuation` property will be present when more results are available beyond the current page. If it's absent or null, you've reached the end of the results.

## Pagination Example

### Initial Request

```bash Initial Request theme={null}
GET /api/status/get-tx-history?user=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&limit=10
```

### Response

```json Paginated Response theme={null}
{
  "transactions": [
    // 10 transaction objects
  ],
  "continuation": "txn_00123456789abcdef"
}
```

### Subsequent Request

To fetch the next page, include the `continuation` token from the previous response:

```bash Subsequent Request theme={null}
GET /api/status/get-tx-history?user=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&limit=10&continuation=txn_00123456789abcdef
```

## Pagination Best Practices

1. **Always specify a limit** - This controls how many items you receive per page.
2. **Store the continuation token** - Save the token from each response to allow users to navigate to the next page.
3. **Check for continuation** - If a response doesn't include a continuation token, it means you've reached the end of the results.
4. **Handle pagination in your UI** - Implement "Next" and "Previous" buttons that appear or disappear based on the availability of continuation tokens.

## Limits and Constraints

* The `limit` parameter must be a positive number.
* For optimal performance, we recommend using reasonable limit values (10-50).
* The maximum number of results you can request per page may be capped by the server.
* Continuation tokens are temporary and may expire after a certain period of time.
