How pagination works
Every paginated response includes apagination object:
Use
page and page_size as query parameters to control which page you receive.
Iterating through all pages
To retrieve all results, loop through pages until you reachtotal_pages:
Choosing a page size
Thepage_size parameter controls how many items are returned per request. The default is 100 and the maximum is 500.
Caching strategies
Some data changes infrequently and benefits from caching:
For data point values, compare
updated_at against your last sync when it is present. If updated_at is null, cache the response for a short interval and store snapshots in your own system if you need change detection.
Common pitfalls
Do not change filters between pages
If you change query parameters (likestate_codes, ahj_ids, or category_ids) between page requests, the result set changes and you may miss items or get duplicates. Always use the same filter parameters across all pages of a single iteration.
Do not assume total is stable
Thetotal count reflects the result set at query time. If data is added or removed between your page requests, total may shift slightly. For most use cases this is not a concern, but if you need an exact snapshot, fetch all pages in a tight loop and use the collected items as your source of truth.
Handle empty pages gracefully
If a filter returns no results, the response hastotal: 0, total_pages: 0, and items: []. Your pagination loop should handle this without entering an infinite loop — always check that total_pages is greater than zero before iterating.
Next steps
Rate limiting
Understand rate limits and how to stay within them during bulk operations.
API Reference
Full pagination parameter documentation.