Is there an API to retrieve all stake pools in Cardano blockchain?

I am still new here, and my question could be a stupid question. But I am trying to find a way that I can get a list of all stake pools in Cardano blockchain. I am not looking for a third-party way. I want to get it directly from the Cardano blockchain.

Hello @TimThabt , welcome to the community!

I don’t consider your question “silly” at all. On the contrary, that question shows a very good interest in one of the most important characteristics that the Cardano ecosystem has.

Perhaps, you can find interesting information about what interests you here:

CardanoScan

Pool Tool

Greetings

Thank you @napoles for your replay. I am aware of pooltool and cardanoscan also adapools.org. But what I want is a way to retrieve pools data from the blockchain itself. In other words I am interested in knowing how these websites are getting their data.

I am interested in knowing how these websites are getting their data.

They get their data by running an instance of cardano-db-sync which follows the chain and inserts data into Postgres.

2 Likes

In addition to what @erikd already mentioned (which I would say is a more recommended way):

  • the Pool IDs for active pools (part of snapshot) can easily be grabbed by CLI (query stake-distribution).
  • Parsing ledger-state (again via CLI) will allow you to parse the ledger for pools along with their owner/reward accounts and chain attributes
  • To automatically retrieve the off-chain metadata attributes, you can use SMASH server
2 Likes

@rdlrt, @erikd and @napoles thank you guys so much for your help. These info are very helpful for me. :slight_smile:

1 Like