There is same question on stackexchange but the answer to that question does not include the new api on etherscan which, given an address as input, allows you to download source code of that verified smart contract.

But I want to download source code of a random verified contracts without knowing its address.

My ultimate goal is to make folders based on versions of contracts and download 50-100 for each version if available enough. I also want to know how many verified smart contracts are there on etherscan so that i can estimate time of download as only last 500 verified contracts are visible on etherscan.

edit: If I know addresses of verified smart contract then the api will work since i can loop over all addresses. Is there any way to get a list of addresses of all verified smart contracts?


I think your best chance is to build a scraper to harvest the Ethereum address of random smart contracts and if they are verified, then feed the address into the API to grab the source code.

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.