#!/usr/bin/env python from requests import get tokens = [ '2jY7jnS3xQQjwtkQxQtjQRqwmTixMZnYhFT5vJJgX23P', "BPBXQ39C7g6LLSRWHwnrz4xmhL5WUo1hZn9PozgXAepN", "DuSGvALuHGma64NWVivkcUm9caQ56NLaBxL7h2BJM7U6", "2QobG8dg9hHSFWezCYpKKw4cnorPoymEuQUSP4ncCvXX", "8ATf4ZAfUhipXtXarSgsg7U1MiWXCbeGLCZB1B5XJjsX", ] holders = {} for token in tokens: result = get( 'https://public-api.solscan.io/token/holders', params={ 'tokenAddress': token, 'offset': 0, 'limit': 10, }, headers={ 'Accept': 'application/json', }, ) for holder in result.json()['data']: holders\ .setdefault(holder['owner'], [])\ .append({ 'token': token, 'amount': holder['amount'] }) for holder, tokens in holders.items(): print(f'HOLDER {holder}') for token in tokens: print(f" - {token['token']} ({token['amount']})")