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

# Pagination

> Navigate through large search result sets efficiently using page and per_page parameters

The `page` and `per_page` parameters control how search results are divided into manageable chunks. This is essential for handling large datasets efficiently and improving application performance.

## Quick start

Here's how to get the first 25 transactions:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "page": 1,
    "per_page": 25
  }'
```

***

## Pagination parameters

| Parameter  | Description                                 | Default | Range/Limit    | Type      |
| :--------- | :------------------------------------------ | :------ | :------------- | :-------- |
| `page`     | Specifies which page of results to retrieve | `1`     | Minimum: `1`   | `integer` |
| `per_page` | Number of records returned in each page     | `10`    | Maximum: `250` | `integer` |

```bash theme={"system"}
# Examples
{
  "page": 1,        # First page (default)
  "per_page": 50    # 50 results per page
}

{
  "page": 3,        # Third page
  "per_page": 250   # Maximum results per page
}
```

***

## Common pagination patterns

<Steps>
  <Step title="Basic pagination">
    Start with the first page and a reasonable page size.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "page": 1,
        "per_page": 50
      }'
    ```
  </Step>

  <Step title="Navigate to specific page">
    Jump to a specific page when you know the approximate location of your data.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/balances" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "page": 5,
        "per_page": 100
      }'
    ```
  </Step>

  <Step title="Large result sets">
    Use maximum page size for bulk data processing.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "filter_by": "created_at:[1720310400..1720396800]",
        "page": 1,
        "per_page": 250
      }'
    ```
  </Step>

  <Step title="Combined with sorting">
    Paginate through sorted results for consistent ordering across pages.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "sort_by": "created_at:desc",
        "page": 2,
        "per_page": 20
      }'
    ```
  </Step>
</Steps>

***

## Response structure

The pagination information is included in every search response:

```json theme={"system"}
{
  "found": 1247,
  "hits": [
    // ... result objects
  ],
  "out_of": 5000,
  "page": 2,
  "request_params": {
    "per_page": 50
  },
  "search_time_ms": 3
}
```

### Key response fields

| Field    | Description                                     | Type      |
| :------- | :---------------------------------------------- | :-------- |
| `found`  | Number of records matching your search criteria | `integer` |
| `out_of` | Total number of records in the collection       | `integer` |
| `page`   | Current page number                             | `integer` |
| `hits`   | Array of result objects for the current page    | `array`   |

***

## Best practices

* **Start with reasonable page sizes**: Use 20-50 records for UI display, 100-250 for data processing.
* **Always sort paginated results**: Use `sort_by` to ensure consistent ordering across pages.
* **Handle empty pages gracefully**: Check if `hits` array is empty before processing results.
* **Monitor performance**: Larger page sizes may impact response time.

***

## Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.

To ask questions or discuss issues, please [contact us](mailto:support@blnkfinance.com) or [join our Discord community](https://discord.gg/7WNv94zPpx).

***

<Tip>
  **Tip:** Connect to Blnk Cloud to see your Core data.

  You can view your transactions, manage identities, create custom reports, invite other team members to collaborate, and perform operations on your Core — all in one dashboard.

  [Check out Blnk Cloud →](https://www.blnkfinance.com/products/cloud)
</Tip>
