This forum is a read-only archive. Posting, replying and signing in are disabled.

Get amount of transactions for that day

humblefool

AFAIK indexer doesn’t have support to get the transaction count.
You need to write a custom script in node JS or python to get txns in the last 24 hours page by page until the next token is empty.

ncoin

If anybody is interested, I made a transaction counter that counts all the transactions for the current day so far. It’s pretty slow and I don’t know how accurate it is

from algosdk.v2client import indexer
import datetime

indexerclient = indexer.IndexerClient("", "https://algoindexer.algoexplorerapi.io", {"User-Agent": "algosdk"})

count = 0
def getTransactionCount(nextpage):
    global count
    transactionlist = indexerclient.search_transactions(limit=10000000,start_time=datetime.date.today().isoformat(),next_page=nextpage)
    transactionlistlength = len(transactionlist["transactions"])
    if "next-token" in transactionlist:
        next_token = transactionlist["next-token"]
        count = transactionlistlength + count
        print(next_token)
        getTransactionCount(next_token)
    else:
        print("success")


getTransactionCount(None)
print(count)