[Ethereum] Obtain token transfer data from an address


I would like to obtain token transfer data from an address via Rest API

For example, take this address:

(Etherscan doesn't answer support questions about their API "because its free and presented as is", and they don't seem to have an API endpoint to show that same data.)

That link shows all of the token transfers for that address.

I would like to see all token transfers of X for that address. X being a token of my choice.

What is involved with obtaining that data via API?

Best Answer

How about using Etherscan's Event Log API?

    &address=[Token Contract Address]
    &topic1=[From Address, padded to 32 bytes - optional]
    &topic2=[To Address, padded to 32 bytes - optional]

In the above topic0 is the signature of an ERC20 Transfer event.

For example, the following link shows you all the send transactions of LLL tokens from my account (two transactions).

Here, your X (the token) is represented by the token's contract address, which is easy enough to find out for the various tokens.

As always, the API will return you a maximum of 10000 results, so you may need to manage fromBlock and toBlock accordingly.

Related Topic