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();
-
Reference for available functions under Rarible
getNftItemById(itemID)
getNftItemByOwner(ownerAddress)
getNftItemByCreator(ownerAddress)
getNftItemByCollection(collectionID)
getNftCollectionById(collectionID)
getNftCollectionsByOwner(ownerAddress)
getSellOrderByMakerAndByStatus(ownerAddress)
getSellOrderByItemAndByStatus(itemNumber, contractAddress)
getSellOrderByCollectionAndByStatus(collectionID)
getOrderBidsByMakerAndByStatus(ownerAddress)
getOrderBidsByItemAndByStatus(itemNumber, contractAddress)
getAllCollections(blockchainName)
-
Reference for available paramter schema under Rarible
itemID: String
ownerAddress: String
collectionID: String
itemNumber: String
contractAddress: String
blockchainName: String (ALL CAPITAL LETTERS)
NOTE HERE:> itemID == contractAddress + ':' + itemNumber
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();
-
Reference for available functions under Opensea
getNftItemById(tokenID, assetContractAddress)
getNftItemsById(ownerAddress, tokenId, assetContractAddress, collectionAddress)
getNftItemByCollections(ownerAddress)
getNftItemByCollection(collectionSlug)
getNftStatsByCollection(collectionSlug)
getNftOrdersById(tokenID, assetContractAddress)
getAllCollections()
getNftItemByContract(assetContractAddress)
getNftOffersById(tokenID, assetContractAddress)
getNftOrdersById(tokenID, assetContractAddress)
-
Reference for available paramter schema under Opensea
tokenID: String
assetContractAddress: String
ownerAddress: String
collectionSlug: String
2. Using Mintable Aggregator for fetching MetaData
This class returns the value of NFT MetaData from Mintable NFT Marketplace with respective endpoint requests.
- Use this class when you simply want to fetch any suitable aggregation data from
Mintable
.
const Aggregator = require('nft-aggregator');
let networkName = 'mainnet';
let APIKey = null;
async function getNftMetadata(networkName, APIKey) {
nftMetadata = await new Aggregator(networkName, APIKey).Mintable.getGaslessNftItemByOwner('0x02A522D98EC2D2c3bBe91AcC29ee7fD32ab880ab');
console.log(nftMetadata);
}
getNftMetadata();
-
Reference for available functions under Mintable
getGaslessNftItemByOwner(ownerAddress)
getSellingNftItem(category, ownerAddress, auction, orderByDate, size, network)
getNftItemById(itemID)
getNftAuctionEndingSoon()
getHotNftAuctions()
-
Reference for available paramter schema under Opensea
itemID: String
auction: Boolean
ownerAddress: String
orderByDate: Boolean
size: Integer
network: Integer