---
title: "Page through results with the BizPrint Print API"
description: "Use the page and perPage parameters and the X-Biz pagination headers to read long lists of printers or print jobs from the BizPrint Print API."
url: https://docs.getbizprint.com/developers/pagination/
section: "Developers"
last_updated: 2026-11-11
---

# Page through results with the BizPrint Print API

Section: Developers

> Use the page and perPage parameters and the X-Biz pagination headers to read long lists of printers or print jobs from the BizPrint Print API.

This page explains how the BizPrint Print API splits long lists into pages, and how to read every page. It is for developers who list [printers](https://docs.getbizprint.com/start-here/glossary/#printer) or [print jobs](https://docs.getbizprint.com/start-here/glossary/#print-job) from their own app or website with the Print API.

Two Print API requests return lists, and both work the same way:

- `GET /printers`, described in [List printers with the BizPrint Print API](https://docs.getbizprint.com/developers/printers/).
- `GET /jobs`, described in [Check print job status with the BizPrint Print API](https://docs.getbizprint.com/developers/job-status/).

## Choose the page and page size

Add these query parameters to a list request:

| Query parameter | What it does                                                             |
| --------------- | ------------------------------------------------------------------------ |
| `perPage`       | How many items to return on each page, from 1 to 100. The default is 10. |
| `page`          | Which page to return. The first page is 1, which is also the default.    |

For example, this request asks for the second page of print jobs, 50 jobs per page:

```http
GET https://print.bizswoop.app/api/connect-application/v1/jobs?perPage=50&page=2&publicKey=YOUR_PUBLIC_KEY&time=YOUR_TIMESTAMP&hash=YOUR_SIGNATURE
```

`perPage` and `page` are part of the query string, so they are included when you sign the request. Sign each page request separately, with a fresh `time`. See [Sign BizPrint Print API requests](https://docs.getbizprint.com/developers/authentication/).

A `perPage` above 100, or a `page` below 1, returns a `400` error with the code `ERR_INVALID_REQUEST`. The `errors` field in the response names the parameter that is wrong. See [BizPrint Print API error codes and how to fix them](https://docs.getbizprint.com/developers/errors/).

## Read the pagination headers

The items are in the `data` list in the response body. The response headers tell you where you are in the whole list:

| Header              | What it means                                                                     |
| ------------------- | --------------------------------------------------------------------------------- |
| `X-Biz-Has-More`    | `true` if there are more items after this page, `false` if this is the last page. |
| `X-Biz-Total-All`   | The total number of items in the whole list.                                      |
| `X-Biz-Total-Pages` | The total number of pages, for the `perPage` you asked for.                       |

Header values arrive as text, so compare `X-Biz-Has-More` with the text `true`, and turn the totals into numbers before you use them.

If you ask for a page after the last one, you get an empty `data` list and `X-Biz-Has-More` is `false`.

## Read every page

To read a whole list:

1. Send the list request with `page=1` and the `perPage` you want.
2. Add the items in `data` to your results.
3. Read the `X-Biz-Has-More` header.
4. Stop if the header is `false`.
5. Add 1 to `page` if the header is `true`.
6. Sign the new request.
7. Send it, and go back to step 2.

Here is the same loop in JavaScript for Node.js 18 or later, run on your server. The `signQuery` function adds `publicKey`, `time` and `hash` to the query, as described in [Sign BizPrint Print API requests](https://docs.getbizprint.com/developers/authentication/). It reads the keys from environment variables, so your [Secret Key](https://docs.getbizprint.com/start-here/glossary/#public-key-and-secret-key) stays on your server.

```js
import { createHash } from 'node:crypto';

const BASE_URL = 'https://print.bizswoop.app/api/connect-application/v1';
const publicKey = process.env.BIZPRINT_PUBLIC_KEY; // YOUR_PUBLIC_KEY
const secretKey = process.env.BIZPRINT_SECRET_KEY; // YOUR_SECRET_KEY, server only

// Adds publicKey, time and hash, and returns the signed query string.
function signQuery(params) {
  const query = new URLSearchParams(params);
  query.set('publicKey', publicKey);
  query.set('time', String(Math.floor(Date.now() / 1000)));
  const hash = createHash('sha256')
    .update(`${query.toString()}:${secretKey}`)
    .digest('hex');
  query.set('hash', hash);
  return query.toString();
}

export async function listAll(path) {
  const items = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const query = signQuery({ perPage: 100, page });
    const response = await fetch(`${BASE_URL}${path}?${query}`);
    const body = await response.json();

    if (!response.ok) {
      throw new Error(`${body.errorCode}: ${body.message}`);
    }

    items.push(...body.data);
    hasMore = response.headers.get('X-Biz-Has-More') === 'true';
    page += 1;
  }

  return items;
}

// const printers = await listAll('/printers');
```

## Things to know

- **Print jobs are sorted oldest first.** The `GET /jobs` list starts with your oldest job, so your newest jobs are on the last page. Use `X-Biz-Total-Pages` to go straight to the last page.
- **Lists can change while you read them.** If a new print job is created or a [station](https://docs.getbizprint.com/start-here/glossary/#station) reports a new printer while you are paging, items can move between pages. Treat the list as a snapshot, and remove duplicates by `id` if you need an exact list.
- **Only list what you need.** If you already have a job’s ID, look it up directly with `GET /jobs/{id}` instead of reading the whole list.

## Related pages

- [List printers with the BizPrint Print API](https://docs.getbizprint.com/developers/printers/)
- [Check print job status with the BizPrint Print API](https://docs.getbizprint.com/developers/job-status/)
- [BizPrint Print API error codes and how to fix them](https://docs.getbizprint.com/developers/errors/)
- [Sign BizPrint Print API requests](https://docs.getbizprint.com/developers/authentication/)

Need help? Contact BizPrint support at <https://getbizprint.com/support/>.
