blockchaincryptocurrencynearprotocol

How to get all accounts from near protocol blockchain?


I am currently working on a program within the Near Protocol to generate user-specific Near token ownership statistics. However, I'm not sure how to obtain a list of all user accounts. Is there an indexer or any other method to obtain this?


Solution

  • NEAR recently launched a BigQuery Public Dataset and you could use this query to get a list of active accounts:

    select account_id 
    from `bigquery-public-data.crypto_near_mainnet_us.accounts` 
    where is_active = true;
    

    Here is the documentation that explains how to use the dataset https://docs.near.org/bos/queryapi/big-query