How to get the index and ledger canister id for each SNS?

As we all know, the variety of SNS tokens is constantly increasing, so I’m curious to know if there is a stable way to query past, present and future SNS token data.
For example, it could return the index and ledger canister id for each SNS.


NNS dapp uses the Sns aggregator so do I in so, I can confirm it works well to fetch Snses information.

In the latest I actually load the data to extract a static json file and logos at build time. The script is there if it can be interesting:


The aggregator collects data as follows:

  • The nns-sns-wasm canister lists the root canisters of all SNSs.
  • The root canister of each SNS lists the common management canisters for that SNS

Collecting the data for all SNSs is super slow though, which is why the aggregator collects the data once and then packages it up to serve it quickly to thousands impatient end users who want the data three seconds ago because there is a new SNS in town don’t ya know. ;-).

1 Like

:smile:That’s what I was looking for, thank you very much!

This script helped me get up to speed quickly with Sns aggregator, thanks.

1 Like

The Sns aggregator is a pretty important tool for developers.
Based on my personal experience of searching for a Sns aggregator for half a day and having to go to the forums for help, I would recommend adding it to the developer documentation.

That’s a good idea! We also discussed with @bitdivine giving it a proper custom domain like or something.

Furthermore, we just merged yesterday a PR I provided to improve its landing page with more developer code snippets.