Skip to main content

Overview

Borough uses page-based pagination. Pages are 1-indexed (first page is page=1).

Parameters

Pass an explicit perPage (up to your tier max) for larger pages. A perPage above your tier max is not rejected: it is lowered to the max, and meta.perPage and the links reflect the value actually used. Read meta.perPage rather than assuming your requested size was honored.

Response metadata

  • total: Total number of matching results across all pages
  • page: Current page number
  • perPage: Results per page
  • links: Navigation URLs for self, first, last, prev (null on first page), and next (null on last page). Present on search and GET /v1/building/{id}/listings; GET /v1/areas is paginated but its meta has no links, so page it with total, page, and perPage

Max perPage by tier

SDK auto-pagination

The TypeScript SDK supports automatic pagination via async iterators:
Every page the SDK fetches is a separate request and costs one unit of quota, so prefer a larger perPage (up to your tier max) over many small pages. Auto-iteration stops at 100 pages by default. If more pages remain at that point, it throws PaginationLimitError (exported by the SDK) rather than silently returning a partial set; at the default perPage of 10, that is any result set over 1,000 items. toArray({ limit }) does not throw when the limit is reached within the cap. Change the cap with the second argument to search: