nft-aggregator
Developed by: Jay Rank
Introduction
nft-aggregator
is a SDK built to fetch NFT metadata from world-renowed NFT marketplaces over EVM-compatible blockchains.
For installation, refer here or run the following command in your node project.
npm install nft-aggregator
How to use
1. Using Rarible Aggregator for fetching MetaData
This class returns the value of NFT MetaData from Rarible NFT Marketplace with respective endpoint requests.
- Use this class when you simply want to fetch any suitable aggregation data from
Rarible
.
const Aggregator = require('nft-aggregator');
let networkName = 'mainnet';
let APIKey = null;
async function getNftMetadata(networkName, APIKey) {
nftMetadata = await new Aggregator(networkName, APIKey).Rarible.getNftItemById('0x6ede7f3c26975aad32a475e1021d8f6f39c89d82:102269783871445009689193659504668254296443359178228669659681116260700662094166');
console.log(nftMetadata);
}
getNftMetadata();
2. Using Opensea Aggregator for fetching MetaData
This class returns the value of NFT MetaData from Opensea NFT Marketplace with respective endpoint requests.
- Use this class when you simply want to fetch any suitable aggregation data from
Opensea
.
const Aggregator = require('nft-aggregator');
let networkName = 'mainnet';
let APIKey = null;
async function getNftMetadata(networkName, APIKey) {
nftMetadata = await new Aggregator(networkName, APIKey).Opensea.getNftItemById('0', '0xa411c4df63bb82d520ea5caca21be754a8290c83');
console.log(nftMetadata);
}
getNftMetadata();