Read the blockchain

Hi everyone, I’m trying to read from the blockchain. I’m using the Purestake API to connect to the blockchain and read data from it. But I can’t execute more than one call for second with Purestake, and this is a problem for me because with the new Indexer 2 I can’t read all the data that i want but just one small part. There is a way to read all the data but without running a node (or sandbox)? I’m using inside a web site for a project and I need to show some statistics that I elaborate from data that i read from the blockchain.
Thanks, :slight_smile:

Hi Enzo,
You can use AlgoExplorer API, it is free and compatible with Algorand Node, you just need to change the url:
https://algoexplorer.io/api-dev

Best,
Pablo

Thanks Pablo, I have only one question. In which way I can use Indexer with my site?

what are you trying to do?

I would like to show statistics through graphs that I create with recharts.

@Mister_Enzo,
without more details about the content of the graphs, there isn’t much help that I could provide, but maybe the indexer v2 is what you’re looking for ? it will take a while to set up, but after you’ll have it up and running, you’ll be able to create triggers to populate your own tables on the Postgres database with the charts-specific data, and then add some queries around these.

I know that it might not be the easiest thing to set up, but with the indexer running, you’ll have the flexibility of a full-featured database. The APIs, regardless of their flexibility, would always lags behind what you could achieve if you were to build your own data schema.

The problem is that I want create a site not just for me, but for everyone. And for this goal I can’t install Indexer on every PC that want to read my site.

If you use algoexplorer API you can retrieve the information in the way you want, but I don’t get what is exactly the information you need.

1 Like

I would like to know the number of transactions that a particular address have made during a specific amount of time. In which way I can take this data with the Indexer? Is mandatory to have the database on my computer? Is possible for a mobile phone to see this data on my website without have the Indexer installed on the device?

You can call the indexer API directly (https://developer.algorand.org/docs/reference/rest-apis/indexer/) or use one of the SDKs which support it.
You’d use https://developer.algorand.org/docs/reference/rest-apis/indexer/#get-v2accountsaccount-idtransactions

It accepts a number of optional parameters that let you specify a lot of search criteria, including time ranges.

The indexer needs to talk to a full node to populate itself. You could run your own indexer, or use a service that runs one. PureStake offers free developer access if the transaction rates are low.
See https://developer.purestake.io/
You definitely wouldn’t have an indexer on the phone itself, but it could obviously make a connection to any indexer on the internet.

1 Like

Thanks aojjazz,
the only problem is that I can’t use PureStake because they put a limit of 1 request at second. So my question is, in which way I can connect to a node and use the Indexer if I don’t have the Indexer installed on my device (computer, phone, tablet, …)?

You will be able to use AlgoExplorer API with the indexer update soon.

I believe that 1 request per second (actually 4 requests per second) constraint is for the free TestNet version. So a paid version should work there. And I am not sure that constraint applies to the indexer as it may be a node constraint, not indexer, but I am not 100 percent sure on that. If that does not work, they have support https://www.purestake.com/customer-support/ … bottom line, indexer v2 sounds like what you want to accomplish your task anyway. I have several examples on indexer done here: https://developer.algorand.org/docs/features/indexer/ with sample code here: https://github.com/algorand/docs/tree/master/examples/indexer. … you do not need to connect to a node to use indexer.