I am trying to pull out from etherscan api all token transfer from a particular token contract.

Currently, I can pull data by manually going to etherscan token contract page - for ex cvc coin: https://etherscan.io/token/0x41e5560054824ea6b0732e656e3ad64e20e94e45 and then on the bottom of the page ' [ Download CSV Export ' allows me to import the CSV in python to get token transfer list and all transfers info: (Txhash ,Blockno, UnixTimestamp DateTime, From, To, Quantity)

However, I would prefer using an api call to get the exact same data but I can't found out which one. It would be something like this one:

url = 'https://api.etherscan.io/api?module=logs&action=getLogs
&apikey='+apikey_etherscan request = requests.get(url)

But this requests yields a dictionnary of transfers like this:(no exploitable info on quantity)

: address': '0x419d0d8bdd9af5e606ae2232ed285aff190e711b', 'topics': ['0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', '0x00000000000000000000000020363f72700b58ff49690c5f875b30ad7057001a', '0x0000000000000000000000008d12a197cb00d4747a1fe03395095ce2a5cc6819'], 'data': '0x000000000000000000000000000000000000000000000000000000e8d4a51000', 'blockNumber': '0x3cdddf', 'timeStamp': '0x595fbcdd', 'gasPrice': '0x12a05f200', 'gasUsed': '0x196992', 'logIndex': '0x25', 'transactionHash': '0x9cdaebf12c1032c648601ffbe9607e876deaac81ed65931a4952113fa353493d', 'transactionIndex': '0x32'}

I am sure there is a better way to do it directly with python without etherscan? Could someone help?! Thanks!!

  • Hi, did you succeed ? I have same problem – Valentin Garreau Feb 2 at 14:01

Your Answer

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

Browse other questions tagged or ask your own question.