TGViewer
TONAPI and TON Console TONAPI and TON Console @tonconsole_com · 12K subscribers
Post #134 1.64K
❗️`/v2/jettons/{addr}/holders` got pagination upgrade. offset parameter will be limited soon.

GetJettonHolders method was always returning holders sorted by their balance (starting from the top). It also had offset parameter that users can use to traverse the top 10k holders.

This approach has two problems:
1) inconsistency. Obviously, balances change constantly. So scanning data with limit+offset will get a lot of gaps due to volatile ordering
2) performance. Request time grows with the offset, because of how databases usually work

We've just made optimization to speed this method ⚡️4x times!

🎚️Introducing cursor

But O(n) is still O(n). So those who need real-time set of jetton holders can use new cursor-based pagination method, which has constant performance no matter what page it is.

So similarly to /v2/jettons, we introduce two new parameters to the GetJettonHolders method: sort_by and last_account_id.

Use /holders like before to get top holders (sort_by=balance is default). Offset can't be more than 9000.

Use /holders?sort_by=address to scan through the whole holders set. Here is how it looks:


# get first page
% time curl -s 'https://tonapi.io/v2/jettons/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs/holders?sort_by=address' | jq -r '.addresses | last | .address'
0:9dfaaafbc46bad3c46d9362d8e5d99f993e953034212c5f34689cac419ea9d2c
curl -s 0.02s user 0.02s system 5% cpu 0.670 total

# get second page
% time curl -s 'https://tonapi.io/v2/jettons/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs/holders?sort_by=address&last_account_id=0:9dfaaafbc46bad3c46d9362d8e5d99f993e953034212c5f34689cac419ea9d2c' | jq -r '.addresses | last | .address'
0:b6a096bdc189790abde43c11041f1f5a72daa92fa0ed24e918e7187515dce53b
curl -s 0.01s user 0.01s system 4% cpu 0.533 total


Have the set of holders of your jettons in real-time with these high-performance updates!
  • 👍 7
  • ❤ 6
  • 🌚 3
  • 🕊 2
More from @tonconsole_com
  1. Sep 9, 2026Get account's NFT history in 80 ms. That's the new baseline we have just released.
  2. Sep 3, 2026Testnet flood, and how we manage it Today testnet is receiving a huge performance benchmar…
  3. Sep 3, 2026photo post
  4. Aug 17, 2026How to get all jettons? And what's changing in TONAPI? In a nutshell There are two main wa…
  5. Jun 15, 2026Toncoin → Gram Following the approved network changes, TONAPI and Tonviewer now support th…
  6. Jun 15, 2026document post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →