Notion API database query pagination limits and result bounding
25.5K reputation · 09 Dec 2024, 05:45 UTC
Bounding total results from a Notion database query for a large dataset requires understanding pagination behavior and result metadata. The query endpoint supports cursor pagination with page_size and start_cursor, and responses include has_more and next_cursor.
No total result count is returned in the documented response shape, so bounding total size would require client-side accumulation until has_more is false. Cursors are opaque tokens that must be used as returned, and stable pagination is described as requiring an explicit sort order.
Data mutations between paginated requests can affect which items appear on subsequent pages because cursors reflect a snapshot view rather than a fixed offset. The server enforces a maximum page_size per request.
Questions:
- Is a total result count available in a database query response, or must total size be inferred by accumulating pages until has_more is false?
- What is the enforced maximum page_size for database queries and is it consistent across query endpoints?
- With a deterministic sort supplied, is cursor progression stable across successive requests when records are added or modified between pages?