Get all transfers of a NFT collection
If you’re interested in tracking the transfers of an NFT collection, there are a few steps you can take to easily access this information. First, you need to find the contract address of the NFT collection you’re interested in. You can usually find this on the collection’s website or on a marketplace where the collection is listed. After you get the contract address, you can use Chainbase to view all the transactions related to that collection. With Chainbase API, you can easily access all the transfers of an NFT collection and gain valuable insights into the collection’s activity.
Once you have these results, you can analyze the data to see who owns each NFT and when it was transferred. This can be useful for tracking the value of a particular NFT or for understanding the buying and selling patterns of a collection’s community.
Overview - Tools you need to work with Chainbase
- A free account at Chainbase with an API key.
- An IDE. Our examples are shown in JavaScript, you can use VS Code as your IDE for example.
- An NFT contract address as your input.
Step 1: Set up a free account at Chainbase
To better leverage the ability that Chainbase provides, you can register here for a free account and access to different APIs and data cloud.
After logging into Chainbase, visit the dashboard to get an overview. Create a new project in the console and get an API key.
Step 2: Write script using Chainbase API
- Using
fetch
in JavaScript.
- Using
axios
in JavaScript. You need to installaxios
usingnpm install axios --save
in the terminal first.
Step 3: Print all transfers of an NFT collection
Chainbase API Get NFT owners by collection takes the chain id and contract address as parameters, and returns all transfers of an NFT collection. You can also filter the results using constraints like block number and timestamp.
To get data printed, run command node <filename>.js
in the terminal. In this case, the first five transfers of Azuki on Ethereum are as follows by the time of Mar. 23rd, 2023.
API Reference
If you want to know more details on the endpoint and optional parameters, check out:
Support
If you meet any trouble following the tutorial, feel free to reach out to us in our Discord to get 24/7 community support.