Skip to main content
Use pagination to limit the number of results per page for a GET /v2/books request with a large book dataset.

Prerequisites

Before you begin, ensure you meet the following prerequisites:
  • Familiarity with BookHub Publisher API v2.
  • A valid JWT for authentication.
  • Access to your codebase that integrates with the BookHub Publisher API v2.

Step 1: Send a paginated request

To implement pagination with the BookHub Publisher API, construct a request that fetches results in pages using the page and limit parameters. The following examples use page and limit only. The endpoint also accepts status, sort, and order parameters — see Get all books for details.
The loop exits when page reaches totalPages. If the API returns fewer items than limit, stop after processing that page. If the response does not include a pagination object, exit immediately.
The response includes a pagination object with the total number of items, total pages, and current page.

Error handling

The page parameter defaults to 1. The limit parameter accepts values between 1 and 100 and defaults to 20.

Step 2: Test your implementation

Call the fetch_all_books function with your API base URL and JWT. Verify that it retrieves all books across multiple pages by checking the length of the returned list against totalItems.

Next steps

Explore related topics:

How-to guides

Reference

  • Release notes — Explore all changes in BookHub Publisher API v2, including any updates related to pagination.

Last modified on August 18, 2026