I'm trying to query a contract function that takes uint256 as input via Etherscan's API but I keep getting error messages. The format I've realized should be as follows based on this answer:

http://etherscan.io/api?module=proxy&action=eth_call&to=[address]&data=0x[function hash]000000000000000000000000[read input]

I got the function hash from remix but I can't find what should be added after it for a uint256 input.


1 Answer 1


The argument must be in hex, padded to 32 bytes.

For example, for tokenId 200 (0xc8 in hex):


Correctly returns:


Which is the address of the owner of that token, again padded to 32 bytes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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