There is no such API within TTN. You will have to make it yourself. What you can do is create an endpoint where UDP traffic is duplicated to by a gateway where you will collect and analyse data.
I have made this as A POC on Node Red.
I can get
{“timestamp”:“2020-07-26T08:54:22.038428811Z”,“uplink”:“1378”,“downlink”:“277”,“location”:{},“frequency_plan”:“EU_863_870”,“gps”:{},“time”:“1595753662038428811”,“rx_ok”:1378,“tx_in”:277}
From this I can do a request every hour and the put that in a db and calculate every hour, day, week and monthly amount of packets.
I am interested to see as well the amount of nodes connecting to a gateway, so were interested if there is a AIP for this?
@pe1mew’s answer says it all, and this is just repeating details from the existing forum posts; I’m closing this one. Also, like already noted in a private message before you created this topic: