Cursor Pagination
Cursor pagination works by returning a cursor token with each response. You pass that cursor into the next request to fetch the next page.- First request: returns
result+cursor - Next request: send the returned
cursorto get the next page - When there are no more results, the cursor will be
null
Cursor Pagination in Moralis
Moralis returns a cursor with list endpoints. Keep calling the endpoint with the latest cursor until no cursor is returned. Important noteslimitcan only be set on the initial request. You can’t change the limit mid-pagination (because the cursor is tied to the original query settings).- A cursor represents a stable snapshot of the dataset at the time your first request was made (a “point in time”).
Snapshot Behavior (No Duplicates Across Pages)
When you paginate using a cursor, Moralis keeps the ordering consistent across pages for that pagination session. Example: if you’re fetching “latest wallet transactions” and new transactions occur while you’re paging, those new transactions:- will not reshuffle the pages you’re currently fetching
- will not cause items from page 1 to appear again on page 2
- will not be included in the current cursor run
Example: Cursor Pagination
Below is a simple Node.js example showing how to page through all results using a cursor. This example:- Makes an initial request with a
limit - Reuses the returned
cursorto fetch the next page - Stops when no cursor is returned
- Uses plain
fetch

