I'm trying to do some distribution calculations on a couple of tokens and could use an export of the token holders list that I can find in Etherscan when I search for a specific token. Since Etherscan is showing the list I was hoping the API would have a function for this, but it looks to me like it doesn't. Please bear with me as I am totally new to this and am not able to really build anything. I know how to fiddle with some APIs and that's about it.
Replace Contract with your token contract address
I have created a standalone tool which does the same.
Take a token contract address
Iterate over all
Transferevents for token using
Build a local database of these events
Allow you to use SQL to query any account balance on any point of time (block num)
You can also trivially export this list from SQLite database to CSV file.
There are some quirks here and there: for example detecting mint / creation event for some tokens is not straightforward. Thus, you will may negative balance on the account receiving initial total supply if you rely on
Transfer event only.