0

I'm would like to get the number of value transactions (either tokens deposit or withdrawal) for a specific contract (I got its address) in the last 24 hours and also the total so far.

Is it possible? Say using etherscan.io or something similar?

0

You can use etherscan for this. you will get a list of "ERC20 - Token Transfer Events" by Address:

http://api.etherscan.io/api?module=account&action=tokentx&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken

As you can specify the address, start, and end blocks as parameters you can make a simple calculation of the number of blocks expected in 24 hours.

Then you will retrieve the list of transactions during the last 24 hours.

Also notice that each transaction has a timestamp.

Hope this helps.

  • Thanks, but I need transactions when tokens were transferred. I'll make it more clear in the question – forhas May 31 '18 at 7:39
  • @forhas dis you adit the answer by mistake or do you really think your edit works? – Jaime May 31 '18 at 8:01
  • I think this answer will solve your problem, there are only token transfers in terms of value. Once you get the list, you need to read the transactions and filter what you need. I think is too much to expect from a general API to give you a specific output that you want for your application. Let me know – Jaime May 31 '18 at 8:03
  • Ignore my edit. I've tried this link, it only provides a limited amount of transactions where the value equals to 0. Which block numbers should I put exactly? How do I know to calculate how many blocks are 24 hours? Can you provide a more detailed example? Thanks. – forhas May 31 '18 at 8:17
  • Use endblock = latestblock (current) and for startblock do: startblock = endblock - 24*60*60/15. This is an approximation as the average block time is 15 seconds – Jaime May 31 '18 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.