Script to fetch all NFT owners using moralis API. This script output is a data.txt file containing all owner addresses of a given NFT and their balances.

Overview

๐Ÿ”Ž Moralis NFT Snapshot

Moralis NFT API will only return 500 itens at a time when its is called. For that reason, a simple logic is needed to fetch all data from a given NFT collection. This script uses a simple logic to loop through all itens in an NFT collection and write out the balances of each unique holder from that collection.

๐Ÿš€ Quick Start

  1. Sign up at Moralis
  2. Read full docs: https://docs.moralis.io/moralis-server/web3-sdk for more about Moralis' NFT API;

Once you are registered on Moralis.io, you will need two parameters to get the script up and running, Server URL and Application ID, both can be found when a new server is created in the View Details option:

Moralis Server Info

โœ… Install dependencies using Yarn

yarn install

โœ… Create Secrets.json file

Using Moralis' server info, create a secrets.json file:

touch secrets.json

With the following contents:

{
    "serverUrl": "YOUR_SERVER_URL",
    "appId" : "YOUR_APPLICATION_ID"
}

Make sure to hide your secrets.json file in case you plan to publish or share your working directory:

echo secrets.json >> .gitignore

โœ… Configure NFT address and chain ID

Inside snapshot.js, configure the section options:

const options = {
  address: "0xc99c679c50033bbc5321eb88752e89a93e9e83c5",  // Paste the NFT address you want to fetch
  chain: "0x1", // Paste the NFT chain ID (Hexadecimal)
};

A list of all supported chains can be found Here!

โœ… Run the script

You can run the script by writing:

node snapshot.js

the expected output is a data.txt file in the following format:

{
  '0x0ac174b33b70b2deedd944e73798b5aaeaed0d09': 3,
  '0x6c736b2b6b33ad5fd162e85b5ee59ff281d4a66a': 1,
  '0xc8ded7b172c72a6800b01dae272f74c796107366': 1,
  '0x67d67c342bb6cca9844024658931d0bf1c8757f4': 1,
  '0x0a91d55399e0eda82b4d80fbfe57f25ad7a3d25c': 5,
  '0xa0fe85972c662e9ff2773942fa35302327ae0859': 1,
  '0x6c7b6cb24a885fe6a480b1b8edcecb8a7e824876': 1,
  '0x9658a54d4b96a27af82c3960242fc52bf0988f93': 3,
  '0x6899c9154bdbaa0880147ca5e50a32a2cbb2e2ec': 1,
  '0x4708cdc826ca799bb9654df336d32c7df2f5df57': 3,
  '0xad0391bfb7d81a585cea54c6f0c4f782a7d6a441': 5,
  '0x59b5a5c7409f744ad7558b4a1da07b4808150098': 6,
  '0xd15f4230ec4dfc9580a01bf3e5e3b062f6fbc762': 1,
  '0x787695d59e0323498ae500fb1b75e005fc9f9aae': 15,
  '0xa7757c0e82ab1c7d3350b611a7be0921ffb5aaac': 1,
  '0x12527beb47c257a3c3ca4cec83f312ef79119108': 13,
  ...
  '0x8c33502c08fc7ca57ee0d4f416b2da3b703f7d32': 8,
  '0xfc85c6ac6df5f8a3fbe27cb4c575cef5f8f24bbd': 4,
  '0x07b5c013febefa0d810474612a826411eca18931': 4
}
You might also like...

See a banned user's profile, their friends, their favorite games, their followers etc.

Roblox-Banned-User-Viewer AKA BanView See a banned user's profile, their friends, their favorite games, their followers etc. Ever wondered how to view

Nov 18, 2022

Group and sort Eleventyโ€™s verbose output by directory (and show file size with benchmarks)

Group and sort Eleventyโ€™s verbose output by directory (and show file size with benchmarks)

eleventy-plugin-directory-output Group and sort Eleventyโ€™s verbose output by directory (and show file size with benchmarks). Sample output from eleven

Oct 27, 2022

Collection of SEO utilities like sitemap, robots.txt, etc. for a Remix Application

Remix SEO Collection of SEO utilities like sitemap, robots.txt, etc. for a Remix Features Generate Sitemap Generate Robots.txt Installation To use it,

Dec 21, 2022

A lightweight (~850 B) library for easy mac/window shortcut notation. kbd-txt convert shortcut text depending on the type of OS (window/linux/mac).

kbd-txt A lightweight (~850 B) library for easy mac/window shortcut notation. kbd-txt convert shortcut text depending on the type of OS (window/linux/

Jan 1, 2023

Master Collection NFT. Mints NFTs on Ethereum containing unique combination of titles for fun.

Master Collection NFT. Mints NFTs on Ethereum containing unique combination of titles for fun.

Master NFT Collection Master NFT Collection is an NFT minting platform that mints NFTs that contain a unique combination of snazzy titles just for fun

Mar 22, 2022

Github action to parse OWNERS files and outputs random reviewers

Get Owners Github Action Do you want to have all the approvers and reviewers without having strange scripts in your actions? Do you want to have rando

Oct 22, 2022

NFTKastle is an NFT marketplace where users can mint their pictures as NFTs, list their NFTs for sale, and buy NFTs from other users.

NFTKastle NFTKastle is an NFT marketplace where users can mint their pictures as NFTs, list their NFTs for sale, and buy NFTs from other users. NFTKas

Oct 31, 2022

A Twitter bot that tweets all ERC-721 NFT sales for a given contract ๐Ÿค–

NFT Sales Twitter Bot ๐Ÿค– This was made to succeed my Opensea Sales Twitter Bot repo; while relying on the OpenSea Events API is simpler, it doesn't in

Jan 2, 2023
Owner
Phill Menezes
Phill Menezes
An online .txt file compressor, de-compressor tool which uses Huffman Coding for Lossless data compression.

Text File Compressor De-compressor Web App This webapp uses Huffman Coding for Text Compression and De-compression. Made with JavaScript, HTML5 and CS

Samir Paul 10 Dec 25, 2022
Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get the profile data.

DecentraGram Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get t

Didier Peran Ganthier 8 Dec 20, 2022
Voting Escrow Snapshots: Historical snapshots of previous voting escrow balances

snapshots Voting Escrow Snapshots: Historical snapshots of previous voting escrow balances. Motivation There are several instances in which one may wa

Saber 13 Jun 7, 2022
Fullstack Dynamic NFT Mini Game built using ๐Ÿ’Ž Diamond Standard [EIP 2535] ๐Ÿƒโ€โ™€๏ธPlayers can use Hero NFT to battle against Thanos โš” Heroes can be Healed by staking their NFT ๐Ÿ›ก

?? Fullstack Dynamic NFT Mini Game ?? ?? Using Diamond Standard Play On ?? ?? โฉ http://diamond-dapp.vercel.app/ Project Description ?? Fullstack Dynam

Shiva Shanmuganathan 21 Dec 23, 2022
Subgraph to query Doodles NFT tokens along with the traits and owners.

Doodles Subgraph API Subgraph to query Doodles NFT tokens along with the traits and owners. How to use the API Try it out here Example query: { toke

J 6 Sep 19, 2022
A time-locked vault that distributes erc-20 tokens to owners of an nft-collection at expiry

A time-locked vault that distributes erc-20 tokens to owners of an nft-collection at expiry

Decent 4 Apr 10, 2022
A script for Obsidian's QuickAdd plugin, to fetch books data using Google Books API.

Books script for Obsidian's Quickadd plugin Demo If this script helped you and you wish to contribute :) Description This script allows you to easily

Elaws 10 Dec 31, 2022
This is a little script that shows how to ddos a website. This is for example purposes only. Don't ddos a website without the consent of his owner

Dddos-Script This is a little script to ddos a website. This is for example purposes only. I am not responsable of what you do with it If you like thi

null 13 Dec 17, 2022
BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book.

Project Name : BookStore CMS BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book. In or

Chris Siku 10 Aug 22, 2022
Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

eznft Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collec

null 3 Sep 21, 2022