Links

nft_collectionNfts

Get the NFT information of a collection.
Through nft_collectionNfts, you can fetch all the information of NFTs in that collection, including token ID and token URI, contractAddress is necessary. Using this API, you could have a broad view of the NFTs in certain collection.
Supported on Ethereum and BNB Chain.

Parameters

Object - An object with the following fields (required):
  • contractAddress(hex string, required) - the contract address of the collection. BlockVision currently support both ERC721 and ERC1155.
  • withMetadata(boolean, optional) - indicate the query need NFT's metadata or not.
  • pageSize(integer number, optional, default 20 max 50) - max number of results to return per call.
  • pageIndex(integer number, optional, default 1) - page index.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
    • nextPageIndex(integer number) - next page index.
    • total(integer number) - total mint records.
    • data(array of object, defined below) - response datas.
  • Object schema:
    • tokenID(string) - id of the NFT.
    • ercStandard(string) - ERC standard of NFT, the enumeration value can be erc721, erc1155, or empty.
    • tokenURI(string) - URI of the NFT.
    • imageGatewayURL(string) - The access address of the image resource.
    • lastSaleAmount(string) - Last sale price of the NFT.
    • name(string) - Name of the NFT asset.
    • metadata(object) - metadata object for each NFT asset.
      • image(string) - URL to the NFT asset image. Can be standard URLs pointing to images on conventional servers, IPFS, or Arweave. Most types of images (SVGs, PNGs, JPEGs, etc.) are supported by NFT marketplaces.
      • name(string) - Name of the NFT asset.
      • description(string) - Human-readable description of the NFT asset. (Markdown is supported/rendered on OpenSea and other NFT platforms).
      • external_link(string) - The image URL that appears alongside the asset image on NFT platforms.
      • attributes(array of object) - traits/attributes/characteristics for each NFT asset.
        • trait_type(string) - The name of the trait.
        • value(string) - The value of the trait.

Example

Request

curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_collectionNfts",
"params": {
"contractAddress": "0x1e080Dbe40E4F8eD00d810d0688533a1e597c019",
"withMetaData": true,
"pageSize": 2,
"pageIndex": 1
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
​
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
​
// Access the BlockVision NFT API
bv.getNFTCollectionNfts({
contractAddress: '0x1e080Dbe40E4F8eD00d810d0688533a1e597c019'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"tokenID": "0",
"ercStandard": "erc721",
"tokenURI": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0",
"imageGatewayURL": "http://ipfs.gateway.blockvision.org/ipfs/QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ",
"lastSaleAmount": 0,
"metadata": {
"attributes": [
{
"trait_type": "Earring",
"value": "Silver Hoop"
},
{
"trait_type": "Background",
"value": "Orange"
},
{
"trait_type": "Fur",
"value": "Robot"
},
{
"trait_type": "Clothes",
"value": "Striped Tee"
},
{
"trait_type": "Mouth",
"value": "Discomfort"
},
{
"trait_type": "Eyes",
"value": "X Eyes"
}
],
"image": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ"
},
"name": "#0"
},
{
"tokenID": "1",
"ercStandard": "erc721",
"tokenURI": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1",
"imageGatewayURL": "http://ipfs.gateway.blockvision.org/ipfs/QmPbxeGcXhYQQNgsC6a36dDyYUcHgMLnGKnF8pVFmGsvqi",
"lastSaleAmount": 0,
"metadata": {
"attributes": [
{
"trait_type": "Mouth",
"value": "Grin"
},
{
"trait_type": "Clothes",
"value": "Vietnam Jacket"
},
{
"trait_type": "Background",
"value": "Orange"
},
{
"trait_type": "Eyes",
"value": "Blue Beams"
},
{
"trait_type": "Fur",
"value": "Robot"
}
],
"image": "ipfs://QmPbxeGcXhYQQNgsC6a36dDyYUcHgMLnGKnF8pVFmGsvqi"
},
"name": "#1"
}
],
"nextPageIndex": 2
}
}