Etherscan API – Etherscan API for Ropsten Testnet: A Comprehensive Guide

balanceserc-20etherscanexplorer-apitokens

I found this endpoint is to obtain the token balance from Ethereum blockchain, however, I noticed that this function doesn't work on Rospten network.
Please advise

https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0x6bb495e358d7aab0540d9b38996e715fcc4f1ba2&address=0x63a5f2232a519321237e31d0a79f6c20e0e652d3&tag=latest&apikey=JKXR76EA1NK9XSKES1T2BNYBZ41T3BJ2JH

Possible I could have the same function works on Ropsten network?

Best Answer

According to the docs, you must simply append "-ropsten" to the subdomain. Your URL should look as follows:

https://api-ropsten.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0x6bb495e358d7aab0540d9b38996e715fcc4f1ba2&address=0x63a5f2232a519321237e31d0a79f6c20e0e652d3&tag=latest&apikey=JKXR76EA1NK9XSKES1T2BNYBZ41T3BJ2JH
Related Topic