liveBook · Manning

Page size

As explained in The Design of Web APIs, Second Edition

Page size is the configured number of items or amount of data returned in one paginated result page.

The maximum page size caps how many items a paginated API response can return. Set it according to consumer needs, transfer time, and infrastructure capacity. section 13.6.1

A limit of 10 transactions forced a banking dashboard to make 10 calls for about 100 transactions. Raising the limit to 100 usually supplied the needed data in one call. section 13.3.2 section 13.3.3

Balance efficiency with consumer control:

  • Increase the limit when consumers commonly need larger result sets and the response remains practical to transmit. section 13.3.3
  • Avoid setting it excessively high: larger pages increase output, download time, and infrastructure costs. section 13.6.1
  • Pair a generous maximum with a smaller default and a minimum of 1, allowing discovery and precise requests. section 13.6.1
Figure 13.4 Due to relevant data additions and larger transaction list pages, the flow is faster and infrastructure-stress-free. However, the process may slow down with more owners and accounts, and the data volume remains substantial.
figure

Compare the slower flow using small transaction pages with the optimized flow using relevant data and larger pages. section 13.3.3

How The Design of Web APIs, Second Edition covers it

How deep it goes
Explains limit selection through transaction volumes, minimums, defaults, and download-cost trade-offs, without specifying an implementation format.
Examples
Uses a banking dashboard, transaction lists, 10-item pages, and a revised 100-item maximum to demonstrate operational effects.
What it assumes
Assumes familiarity with list operations and pagination while relating page-size choices to consumer behavior and API efficiency.
What you can do after
Apply it by choosing maximum, minimum, and default page sizes that match retrieval needs without excessive transfer or infrastructure load.
How it connects
Connects maximum page size with pagination, filtering, defaults, minimum limits, response time, and infrastructure costs.

Also explained in

Compare how 3 books explain page size →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.