Get amount of transactions for that day

How can you get the daily transaction count?

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.

Alright, thanks for your help

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)
1 Like