Skip to main content
The v2 API uses cursor-based pagination to retrieve large result sets in batches. Instead of specifying a page number, the identifier of the last record received is passed to the API, which returns the next batch starting from that point. Because the cursor points at an existing record instead of a page number, new data inserted at the head of the list does not shift already-seen pages. Three endpoints support pagination: All other v2 endpoints return single objects or fixed results and do not support pagination.

getTransactions

Returns the transaction history of a given account. Results are ordered by logical time in descending order (newest first). Pagination uses lt and hash as a cursor pair. Both must be provided together. These values come from the last transaction in the previous response.

Pagination parameters

All pagination parameters are optional. They are omitted for the first request and included on subsequent pages.

Paginate through transactions

1

Fetch the first page

Send a request with only address and limit. No cursor parameters are needed for the first page.
Response (abbreviated):
2

Extract the cursor from the last transaction

Take the lt and hash from the last transaction in the response. In this case:
  • lt: 66784070000010
  • hash: jYTMpoesWRQ9gs9sbiYcRu+raNOU1Jd3bqCC9V/ntFU=
3

Fetch the next page

Pass the extracted lt and hash as query parameters to get the next batch.
Response (abbreviated):
4

Repeat until the last page

Continue extracting the cursor from the last transaction and fetching the next page.All results have been retrieved when the response returns fewer transactions than the limit. Because the cursor is inclusive, a full subsequent page delivers limit - 1 new transactions (the first item is the cursor duplicate), so a response containing only the cursor transaction (1 item) also counts as an end signal.
Output:

Fetching a specific range

Use to_lt to stop pagination at a specific logical time instead of iterating through the entire history:
This returns only transactions between the two logical times, so a sync job can re-fetch a bounded window rather than walking the full history.

getBlockTransactions

Returns a list of short transaction identifiers for all transactions in a given block. Pagination uses after_lt and after_hash as a cursor pair. Both must be provided together. The response includes an incomplete field that indicates whether more transactions remain in the block.

Pagination parameters

All pagination parameters are optional. They are omitted for the first request and included on subsequent pages.

Paginate through block transactions

1

Fetch the first page

Send a request with the block identifiers (workchain, shard, seqno) and count. No cursor parameters are needed for the first page.
Response:
The incomplete field is true, meaning there are more transactions in this block.
2

Extract the cursor from the last transaction

Take the lt and hash from the last transaction in the response. In this case:
  • lt: 67098924000005
  • hash: hYMkXXLa8SUI7BumkwtWnwge+nH9KB5B/0ICBqdyaKQ=
3

Fetch the next page

Pass the extracted values as after_lt and after_hash to get the next batch.
Response:
The incomplete field is now false, meaning all transactions in this block have been retrieved. Total: 3 + 1 = 4 transactions.
Output:

getBlockTransactionsExt

Returns full transaction details for all transactions in a given block. Pagination works the same way as getBlockTransactions, using after_lt and after_hash as cursors with the incomplete field as the end of results signal. The only difference is that this endpoint returns complete transaction objects instead of short identifiers.

Pagination parameters

Pagination parameters are identical to getBlockTransactions. See the getBlockTransactionsExt reference for all available parameters.

Paginate through extended block transactions

1

Fetch the first page

Response (abbreviated):
2

Extract the cursor from the last transaction

Take the lt and hash from the last transaction’s transaction_id. In this case:
  • lt: 67098924000005
  • hash: hYMkXXLa8SUI7BumkwtWnwge+nH9KB5B/0ICBqdyaKQ=
3

Fetch the next page

Response (abbreviated):
The incomplete field is false. All transactions in this block have been retrieved.
Output: