0

Trying to connect to the etherscan API to listen for some addresses changing and print the time that the response takes. Doing this in an async loop for 13 addresses.

The code:

url = 'https://api.etherscan.io/api?module=account&action=txlist&address=' + address + '&startblock=0&endblock=99999999&sort=asc&apikey=' + api_token
    response = requests.get(url)
    print("Response received after this much time: " + str(response.elapsed.total_seconds()))

For the overwhelming majority (98%) of the time, this prints an amount between .64 and .66 seconds.

The problem:

of the 2% of the time its not that delay, 80% of the time its between 1.66 and 1.68 seconds. The remaining 20% of the time, it is either ~3.7, ~5.7, or between 129.8 and 130.2 seconds. I am mostly just concerned with the rare 130 second delays, and I'm hoping that the strangely consistent delays are a sign of something.

My rate limits are 5/second and 100k/day.

Any way to diagnose why this would be?

hedgedandlevered
  • 2,314
  • 2
  • 25
  • 54

0 Answers0