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:
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

ParameterDescriptionDefaultRange/LimitType
pageSpecifies which page of results to retrieve1Minimum: 1integer
per_pageNumber of records returned in each page10Maximum: 250integer
# 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

1

Basic pagination

Start with the first page and a reasonable page size.
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
  }'
2

Navigate to specific page

Jump to a specific page when you know the approximate location of your data.
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
  }'
3

Large result sets

Use maximum page size for bulk data processing.
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
  }'
4

Combined with sorting

Paginate through sorted results for consistent ordering across pages.
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
  }'

Response structure

The pagination information is included in every search response:
{
  "found": 1247,
  "hits": [
    // ... result objects
  ],
  "out_of": 5000,
  "page": 2,
  "request_params": {
    "per_page": 50
  },
  "search_time_ms": 3
}

Key response fields

FieldDescriptionType
foundNumber of records matching your search criteriainteger
out_ofTotal number of records in the collectioninteger
pageCurrent page numberinteger
hitsArray of result objects for the current pagearray

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 or join our Discord community.