Keep asking for the next
page while has_more is true. That is the entire loop:
There is no total, on purpose
The response tells you whether another page exists, not how many rows exist. Counting the whole set to answer one page is work neither side needs — and for a reconciliation read, “walk untilhas_more is false” is the correct loop anyway. If you need a count,
count as you walk.
Narrowing before paging
Where an endpoint offers filters —from/to on GET /v1/blocks bound the result to
blocks holding a night inside the window — prefer narrowing over walking the whole set.
A block whose check_out equals from holds no night in the window (departure day is
exclusive) and is not returned. Each page is bounded by the same filters, so the
has_more loop composes with them unchanged.