Alchemy SDK V2 vs. V3 Method Differences

Detailed differences between Alchemy SDK V2 and V3 methods

Detailed Method Mappings

This page aims to provide a comprehensive and detailed mapping of the changes that have occurred in each endpoint between Alchemy SDK V2 and V3. For each method, we will outline any changes in the method name, provide example requests in both V2 and V3, and present a mapping table highlighting the differences in the response structure (where applicable). Additionally, we will include examples of the V2 and V3 responses to help illustrate the changes.


getFloorPrice - SDK

Returns the floor prices of an NFT contract by marketplace.

Overview of Changes

  • An error field has been added to both openSea and looksRare objects in the response structure in V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address
15 const address = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
16
17 //Call the method to check the contract floor price
18 const response = await alchemy.nft.getFloorPrice(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
openSea.floorPriceopenSea.floorPrice
openSea.priceCurrencyopenSea.priceCurrency
openSea.collectionUrlopenSea.collectionUrl
openSea.retrievedAtopenSea.retrievedAt
openSea.error (New in V3)
looksRare.floorPricelooksRare.floorPrice
looksRare.priceCurrencylooksRare.priceCurrency
looksRare.collectionUrllooksRare.collectionUrl
looksRare.retrievedAtlooksRare.retrievedAt
looksRare.error (New in V3)

Example Responses

V2 Example Response

json
1{
2 openSea: {
3 floorPrice: 44.5,
4 priceCurrency: 'ETH',
5 collectionUrl: 'https://opensea.io/collection/boredapeyachtclub',
6 retrievedAt: '2023-06-19T00:07:11.601Z'
7 },
8 looksRare: {
9 floorPrice: 43.65,
10 priceCurrency: 'ETH',
11 collectionUrl: 'https://looksrare.org/collections/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
12 retrievedAt: '2023-06-19T00:07:11.639Z'
13 }
14}

V3 Example Response

json
1{
2 "openSea": {
3 "floorPrice": 24.979951,
4 "priceCurrency": "ETH",
5 "collectionUrl": "https://opensea.io/collection/boredapeyachtclub",
6 "retrievedAt": "2023-09-21T15:22:06.168Z",
7 "error": undefined
8 },
9 "looksRare": {
10 "floorPrice": 24.98,
11 "priceCurrency": "ETH",
12 "collectionUrl": "https://looksrare.org/collections/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
13 "retrievedAt": "2023-09-21T15:22:06.097Z",
14 "error": undefined
15 }
16}

getNftsForOwner - SDK

Get all NFTs for an owner.

This method returns the full NFTs in the contract. To get all NFTs without their associated metadata, use the options parameter by setting omitMetadata to true in the body of the request.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to an optional name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The blockHash parameter has been removed in V3.
  • The metadataError in V2 has been replaced with the raw.error parameter in the V3 response.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in V3.
  • The isSpam and classifications parameters for spamInfo on V2 has been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The validAt object has been added to the V3 response. It contains the blockNumber, blockHash, and blockTimestamp parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 let owner = "vitalik.eth";
15
16 //Call the method to get the nfts owned by this address
17 let response = await alchemy.nft.getNftsForOwner(owner)
18
19 //Logging the response to the console
20 console.log(response)
21};
22
23main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
metadataErrorraw.error
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
-raw.tokenUri
mediaimage
spamInfo(Removed in V3 and moved to contract)
-collection (New in V3)
-mint(New in V3)
balancebalance
timeLastUpdatedtimeLastUpdated
-validAt.blockNumber(New in V3)
-validAt.blockHash(New in V3)
-validAt.blockTimestamp(New in V3)
pageKeypageKey
totalCounttotalCount
blockHash(Removed in V3)
-acquiredAt(New in V3)

Example Responses

V2 Example Response

json
1{
2 "ownedNfts": [
3 {
4 "contract": {
5 "address": "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
6 "name": "Bored Ape Nike Club",
7 "symbol": "BANC",
8 "tokenType": "ERC721",
9 "openSea": {
10 "collectionName": "BoredApeNikeClub",
11 "safelistRequestStatus": "not_requested",
12 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
13 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
14 "externalUrl": "https://nikemetaverse.xyz",
15 "lastIngestedAt": "2023-07-15T19:05:35.000Z"
16 },
17 "contractDeployer": "0x51d7d428041e23ef51422e110dfeff906e821cfe",
18 "deployedBlockNumber": 14276343
19 },
20 "tokenId": "1",
21 "tokenType": "ERC721",
22 "title": "",
23 "description": "",
24 "timeLastUpdated": "2023-07-19T10:54:51.000Z",
25 "metadataError": "Contract returned a broken token uri",
26 "rawMetadata": {
27 "metadata": [],
28 "attributes": []
29 },
30 "tokenUri": {
31 "gateway": "http://api.nikeapenft.xyz/ipfs/1",
32 "raw": "http://api.nikeapenft.xyz/ipfs/1"
33 },
34 "media": [],
35 "spamInfo": {
36 "isSpam": true,
37 "classifications": [
38 "OwnedByMostHoneyPots",
39 "Erc721TooManyOwners",
40 "Erc721TooManyTokens",
41 "NoSalesActivity",
42 "HighAirdropPercent",
43 "HighHoneyPotPercent",
44 "HoneyPotsOwnMultipleTokens"
45 ]
46 },
47 "balance": 26
48 },
49 {
50 "contract": {
51 "address": "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
52 "name": "Bored Ape Nike Club",
53 "symbol": "BANC",
54 "tokenType": "ERC721",
55 "openSea": {
56 "collectionName": "BoredApeNikeClub",
57 "safelistRequestStatus": "not_requested",
58 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
59 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
60 "externalUrl": "https://nikemetaverse.xyz",
61 "lastIngestedAt": "2023-07-15T19:05:35.000Z"
62 },
63 "contractDeployer": "0x51d7d428041e23ef51422e110dfeff906e821cfe",
64 "deployedBlockNumber": 14276343
65 },
66 "tokenId": "2",
67 "tokenType": "ERC721",
68 "title": "",
69 "description": "",
70 "timeLastUpdated": "2023-07-19T10:54:50.978Z",
71 "metadataError": "Contract returned a broken token uri",
72 "rawMetadata": {
73 "metadata": [],
74 "attributes": []
75 },
76 "tokenUri": {
77 "gateway": "http://api.nikeapenft.xyz/ipfs/2",
78 "raw": "http://api.nikeapenft.xyz/ipfs/2"
79 },
80 "media": [],
81 "spamInfo": {
82 "isSpam": true,
83 "classifications": [
84 "OwnedByMostHoneyPots",
85 "Erc721TooManyOwners",
86 "Erc721TooManyTokens",
87 "NoSalesActivity",
88 "HighAirdropPercent",
89 "HighHoneyPotPercent",
90 "HoneyPotsOwnMultipleTokens"
91 ]
92 },
93 "balance": 31
94 },
95 {
96 "contract": {
97 "address": "0x00703f9b11f2ac02d391a11e7b97c6ee80cd8563",
98 "name": "Elon Musk",
99 "symbol": "MUSK",
100 "tokenType": "ERC721",
101 "openSea": {
102 "collectionName": "ELON MUSK LICENSE",
103 "safelistRequestStatus": "not_requested",
104 "imageUrl": "https://i.seadn.io/gae/7O8H5tVTUPfi03LBY3xI29wkuzp8sSsRvr_BjOxXUfsU7mrkV7WxhOMedXKBp-dqDtCLjSfLwzWEMg6_yrxw8YPXC7OY9TqelDm9?w=500&auto=format",
105 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://elonmusknftworld.shop)",
106 "externalUrl": "https://elonmusknftworld.shop",
107 "lastIngestedAt": "2023-07-15T19:21:16.000Z"
108 },
109 "contractDeployer": "0x69a3c97428bad2c431a70b886d4d03b042df5670",
110 "deployedBlockNumber": 14268680
111 },
112 "tokenId": "5",
113 "tokenType": "ERC721",
114 "title": "",
115 "description": "",
116 "timeLastUpdated": "2023-07-19T10:54:51.011Z",
117 "metadataError": "Contract returned a broken token uri",
118 "rawMetadata": {
119 "metadata": [],
120 "attributes": []
121 },
122 "tokenUri": {
123 "gateway": "http://api.elonmusknfts.xyz/ipfs/5",
124 "raw": "http://api.elonmusknfts.xyz/ipfs/5"
125 },
126 "media": [],
127 "spamInfo": {
128 "isSpam": true,
129 "classifications": [
130 "OwnedByMostHoneyPots",
131 "Erc721TooManyOwners",
132 "Erc721TooManyTokens",
133 "NoSalesActivity",
134 "HighAirdropPercent",
135 "HighHoneyPotPercent",
136 "HoneyPotsOwnMultipleTokens"
137 ]
138 },
139 "balance": 11
140 }
141 ],
142 "pageKey": "MHgwMDcwM2Y5YjExZjJhYzAyZDM5MWExMWU3Yjk3YzZlZTgwY2Q4NTYzOjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNTpmYWxzZQ==",
143 "totalCount": 26525,
144 "blockHash": "0x7f9574679a4ee645fc34683464ee4c038cb968112c912cb7ddce46d5abdeac94"
145}

V3 Example Response

json
1{
2 "ownedNfts": [
3 {
4 "contract": {
5 "address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
6 "name": "Bored Ape Nike Club",
7 "symbol": "BANC",
8 "tokenType": "ERC721",
9 "contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
10 "deployedBlockNumber": 14276343,
11 "openSeaMetadata": {
12 "collectionName": "BoredApeNikeClub",
13 "collectionSlug": "bored-ape-nike-club-v2",
14 "safelistRequestStatus": "not_requested",
15 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
16 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
17 "externalUrl": "https://nikemetaverse.xyz",
18 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
19 "lastIngestedAt": "2023-09-11T13:59:53.000Z"
20 },
21 "isSpam": true,
22 "spamClassifications": [
23 "OwnedByMostHoneyPots",
24 "Erc721TooManyOwners",
25 "Erc721TooManyTokens",
26 "NoSalesActivity",
27 "HighAirdropPercent",
28 "HighHoneyPotPercent",
29 "HoneyPotsOwnMultipleTokens"
30 ]
31 },
32 "tokenId": "1",
33 "tokenType": "ERC721",
34 "tokenUri": "http://api.nikeapenft.xyz/ipfs/1",
35 "image": {},
36 "raw": {
37 "tokenUri": "http://api.nikeapenft.xyz/ipfs/1",
38 "metadata": {}
39 },
40 "collection": {
41 "name": "BoredApeNikeClub",
42 "slug": "bored-ape-nike-club-v2",
43 "externalUrl": "https://nikemetaverse.xyz",
44 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
45 },
46 "mint": {},
47 "timeLastUpdated": "2023-09-20T12:18:35.890Z",
48 "balance": "26",
49 "acquiredAt": {}
50 },
51 {
52 "contract": {
53 "address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
54 "name": "Bored Ape Nike Club",
55 "symbol": "BANC",
56 "tokenType": "ERC721",
57 "contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
58 "deployedBlockNumber": 14276343,
59 "openSeaMetadata": {
60 "collectionName": "BoredApeNikeClub",
61 "collectionSlug": "bored-ape-nike-club-v2",
62 "safelistRequestStatus": "not_requested",
63 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
64 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
65 "externalUrl": "https://nikemetaverse.xyz",
66 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
67 "lastIngestedAt": "2023-09-11T13:59:53.000Z"
68 },
69 "isSpam": true,
70 "spamClassifications": [
71 "OwnedByMostHoneyPots",
72 "Erc721TooManyOwners",
73 "Erc721TooManyTokens",
74 "NoSalesActivity",
75 "HighAirdropPercent",
76 "HighHoneyPotPercent",
77 "HoneyPotsOwnMultipleTokens"
78 ]
79 },
80 "tokenId": "2",
81 "tokenType": "ERC721",
82 "tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
83 "image": {},
84 "raw": {
85 "tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
86 "metadata": {},
87 "error": "Contract returned a broken token uri"
88 },
89 "collection": {
90 "name": "BoredApeNikeClub",
91 "slug": "bored-ape-nike-club-v2",
92 "externalUrl": "https://nikemetaverse.xyz",
93 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
94 },
95 "mint": {},
96 "timeLastUpdated": "2023-09-20T13:13:54.798Z",
97 "balance": "31",
98 "acquiredAt": {}
99 },
100 {
101 "contract": {
102 "address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
103 "name": "Bored Ape Nike Club",
104 "symbol": "BANC",
105 "tokenType": "ERC721",
106 "contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
107 "deployedBlockNumber": 14276343,
108 "openSeaMetadata": {
109 "collectionName": "BoredApeNikeClub",
110 "collectionSlug": "bored-ape-nike-club-v2",
111 "safelistRequestStatus": "not_requested",
112 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
113 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
114 "externalUrl": "https://nikemetaverse.xyz",
115 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
116 "lastIngestedAt": "2023-09-11T13:59:53.000Z"
117 },
118 "isSpam": true,
119 "spamClassifications": [
120 "OwnedByMostHoneyPots",
121 "Erc721TooManyOwners",
122 "Erc721TooManyTokens",
123 "NoSalesActivity",
124 "HighAirdropPercent",
125 "HighHoneyPotPercent",
126 "HoneyPotsOwnMultipleTokens"
127 ]
128 },
129 "tokenId": "2",
130 "tokenType": "ERC721",
131 "tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
132 "image": {},
133 "raw": {
134 "tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
135 "metadata": {}
136 },
137 "collection": {
138 "name": "BoredApeNikeClub",
139 "slug": "bored-ape-nike-club-v2",
140 "externalUrl": "https://nikemetaverse.xyz",
141 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
142 },
143 "mint": {},
144 "timeLastUpdated": "2023-09-18T11:02:14.698Z",
145 "balance": "31",
146 "acquiredAt": {}
147 },
148 ],
149 "pageKey": "MHgwMDcwM2Y5YjExZjJhYzAyZDM5MWExMWU3Yjk3YzZlZTgwY2Q4NTYzOjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNTpmYWxzZQ==",
150 "totalCount": 26585,
151 "validAt": {
152 "blockNumber": 18162406,
153 "blockHash": "0x670957987df0a8d0838a05a25d8a1945fbeea24f547a4e59e748c42a12d7cfce",
154 "blockTimestamp": "2023-09-18T11:02:47Z"
155 }
156}

getNftMetadata - SDK

Get the NFT metadata associated with the provided parameters.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The contract object in the V3 response now includes new parameters called isSpam and spamClassifications.
  • The isSpam and classifications parameters for spamInfo on V2 has been added to the contract object in V3.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to an optional name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadata.attributes parameter has been removed and changed to raw.metadata.attributes in the V3 response.
  • The rawMetadataobject parameter has been changed to a raw object in V3 response, which contains the tokenUri, error and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 let owner = "0xe785E82358879F061BC3dcAC6f0444462D4b5330";
15 let tokenId = 44;
16
17 //Call the method to get the nfts owned by this address
18 let response = await alchemy.nft.getNftMetadata(owner, tokenId)
19
20 //Logging the response to the console
21 console.log(response)
22};
23
24main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.floorPricecontract.openSeaMetadata.floorPrice
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
rawMetadata.errorraw.error
-raw.tokenUri
mediaimage
-collection (New in V3)
-mint(New in V3)
timeLastUpdatedtimeLastUpdated

Example Responses

V2 Example Response

json
1{
2 "contract": {
3 "address": "0xe785e82358879f061bc3dcac6f0444462d4b5330",
4 "name": "World Of Women",
5 "symbol": "WOW",
6 "totalSupply": "10000",
7 "tokenType": "ERC721",
8 "openSea": {
9 "floorPrice": 0.7999,
10 "collectionName": "World of Women",
11 "safelistRequestStatus": "verified",
12 "imageUrl": "https://i.seadn.io/gcs/files/8604de2d9aaec98dd389e3af1b1a14b6.gif?w=500&auto=format",
13 "description": "World of Women is a collection of 10,000 NFTs that gives you full access to our network of artists, creators, entrepreneurs, and executives who are championing diversity and equal opportunity on the blockchain.\n\nCreated and illustrated by Yam Karkai (@ykarkai), World of Women has made prominent appearances at Christie's, The New Yorker and Billboard.\n\nJoin us to receive exclusive access to NFT drops, experiences, and much more.\n\nThe Time is WoW.",
14 "externalUrl": "http://worldofwomen.art",
15 "twitterUsername": "worldofwomennft",
16 "discordUrl": "https://discord.gg/worldofwomen",
17 "lastIngestedAt": "2023-07-11T11:58:25.000Z"
18 },
19 "contractDeployer": "0xc9b6321dc216d91e626e9baa61b06b0e4d55bdb1",
20 "deployedBlockNumber": 12907782
21 },
22 "tokenId": "44",
23 "tokenType": "ERC721",
24 "title": "WoW #44",
25 "description": "",
26 "timeLastUpdated": "2023-07-13T08:14:36.601Z",
27 "rawMetadata": {
28 "name": "WoW #44",
29 "image": "ipfs://QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi",
30 "attributes": [
31 {
32 "value": "Green Orange",
33 "trait_type": "Background"
34 },
35 {
36 "value": "Medium Gold",
37 "trait_type": "Skin Tone"
38 },
39 {
40 "value": "Green To The Left",
41 "trait_type": "Eyes"
42 },
43 {
44 "value": "Freckles",
45 "trait_type": "Facial Features"
46 },
47 {
48 "value": "Boy Cut",
49 "trait_type": "Hairstyle"
50 },
51 {
52 "value": "Tunic",
53 "trait_type": "Clothes"
54 },
55 {
56 "value": "Spikes",
57 "trait_type": "Earrings"
58 },
59 {
60 "value": "Slight Smile",
61 "trait_type": "Mouth"
62 },
63 {
64 "value": "Purple",
65 "trait_type": "Lips Color"
66 }
67 ]
68 },
69 "tokenUri": {
70 "gateway": "https://alchemy.mypinata.cloud/ipfs/QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44",
71 "raw": "ipfs://QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44"
72 },
73 "media": [
74 {
75 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
76 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
77 "raw": "ipfs://QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi",
78 "format": "png",
79 "bytes": 105117
80 }
81 ]
82}

V3 Example Response

json
1{
2 "contract": {
3 "address": "0xe785E82358879F061BC3dcAC6f0444462D4b5330",
4 "name": "World Of Women",
5 "symbol": "WOW",
6 "totalSupply": "10000",
7 "tokenType": "ERC721",
8 "contractDeployer": "0xc9b6321dc216D91E626E9BAA61b06B0E4d55bdb1",
9 "deployedBlockNumber": 12907782,
10 "openSeaMetadata": {
11 "floorPrice": 0.6021,
12 "collectionName": "World of Women",
13 "collectionSlug": "world-of-women-nft",
14 "safelistRequestStatus": "verified",
15 "imageUrl": "https://i.seadn.io/gcs/files/8604de2d9aaec98dd389e3af1b1a14b6.gif?w=500&auto=format",
16 "description": "World of Women is a collection of 10,000 NFTs that gives you full access to our network of artists, creators, entrepreneurs, and executives who are championing diversity and equal opportunity on the blockchain.\n\nCreated and illustrated by Yam Karkai (@ykarkai), World of Women has made prominent appearances at Christie's, The New Yorker and Billboard.\n\nJoin us to receive exclusive access to NFT drops, experiences, and much more.\n\nThe Time is WoW.",
17 "externalUrl": "http://worldofwomen.art",
18 "twitterUsername": "worldofwomennft",
19 "discordUrl": "https://discord.gg/worldofwomen",
20 "bannerImageUrl": "https://i.seadn.io/gae/GHhptRLebBOWOy8kfXpYCVqsqdes-1-6I_jbuRnGTHHW6TD63CtciH75Dotfu2u8v6EmkWt-tjhkFRVLxRUwgMfKqqy5W24AolJayeo?w=500&auto=format",
21 "lastIngestedAt": "2023-09-18T12:28:27.000Z"
22 },
23 "spamClassifications": []
24 },
25 "tokenId": "44",
26 "tokenType": "ERC721",
27 "name": "WoW #44",
28 "tokenUri": "https://alchemy.mypinata.cloud/ipfs/QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44",
29 "image": {
30 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
31 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
32 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
33 "contentType": "image/png",
34 "size": 105117,
35 "originalUrl": "https://ipfs.io/ipfs/QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi"
36 },
37 "raw": {
38 "tokenUri": "ipfs://QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44",
39 "metadata": {
40 "name": "WoW #44",
41 "image": "ipfs://QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi",
42 "attributes": [
43 {
44 "value": "Green Orange",
45 "trait_type": "Background"
46 },
47 {
48 "value": "Medium Gold",
49 "trait_type": "Skin Tone"
50 },
51 {
52 "value": "Slight Smile",
53 "trait_type": "Mouth"
54 },
55 {
56 "value": "Purple",
57 "trait_type": "Lips Color"
58 }
59 ]
60 }
61 },
62 "collection": {
63 "name": "World of Women",
64 "slug": "world-of-women-nft",
65 "externalUrl": "http://worldofwomen.art",
66 "bannerImageUrl": "https://i.seadn.io/gae/GHhptRLebBOWOy8kfXpYCVqsqdes-1-6I_jbuRnGTHHW6TD63CtciH75Dotfu2u8v6EmkWt-tjhkFRVLxRUwgMfKqqy5W24AolJayeo?w=500&auto=format"
67 },
68 "mint": {},
69 "timeLastUpdated": "2023-09-18T13:25:41.833Z"
70}

getNftMetadataBatch - SDK

Gets the NFT metadata for multiple NFT tokens.

Overview of Changes

  • The getNftMetadataBatch method now returns an nft array in the V3 response instead of an array of NFTs in V2.
  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The isSpam and classifications parameters for spamInfo on V2 has been added to the contract object in V3.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to an optional name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadata.attributes parameter has been changed to raw.metadata.attributes in the V3 response.
  • The rawMetadataobject parameter has been changed to a raw object in V3 response, which contains the tokenUri and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14
15 //Call the method
16 let response = await alchemy.nft.getNftMetadataBatch(
17 [
18 {
19 contractAddress: "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
20 tokenId: "3",
21 tokenType: "ERC721"
22 },
23 {
24 contractAddress: "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
25 tokenId: "4",
26 tokenType: "ERC721"
27 }
28 ],
29 {
30 tokenUriTimeoutInMs: 5000,
31 refreshCache: true
32 }
33 )
34
35 //Logging the response to the console
36 console.log(response)
37};
38
39main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.floorPricecontract.openSeaMetadata.floorPrice
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
rawMetadata.errorraw.error
-raw.tokenUri
mediaimage
-collection (New in V3)
-mint(New in V3)
timeLastUpdatedtimeLastUpdated

Example Responses

V2 Example Response

json
1[
2 {
3 "contract": {
4 "address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
5 "name": "BoredApeYachtClub",
6 "symbol": "BAYC",
7 "totalSupply": "10000",
8 "tokenType": "ERC721",
9 "openSea": {
10 "floorPrice": 34.5,
11 "collectionName": "Bored Ape Yacht Club",
12 "safelistRequestStatus": "verified",
13 "imageUrl": "https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format",
14 "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
15 "externalUrl": "http://www.boredapeyachtclub.com/",
16 "twitterUsername": "BoredApeYC",
17 "discordUrl": "https://discord.gg/3P5K3dzgdB",
18 "lastIngestedAt": "2023-07-10T01:34:04.000Z"
19 },
20 "contractDeployer": "0xaba7161a7fb69c88e16ed9f455ce62b791ee4d03",
21 "deployedBlockNumber": 12287507
22 },
23 "tokenId": "3",
24 "tokenType": "ERC721",
25 "title": "",
26 "description": "",
27 "timeLastUpdated": "2023-07-19T19:18:42.867Z",
28 "rawMetadata": {
29 "image": "ipfs://QmYxT4LnK8sqLupjbS6eRvu1si7Ly2wFQAqFebxhWntcf6",
30 "attributes": [
31 {
32 "trait_type": "Background",
33 "value": "Purple"
34 },
35 {
36 "trait_type": "Eyes",
37 "value": "Bored"
38 },
39 {
40 "trait_type": "Mouth",
41 "value": "Tongue Out"
42 },
43 {
44 "trait_type": "Clothes",
45 "value": "Bone Necklace"
46 },
47 {
48 "trait_type": "Fur",
49 "value": "Cheetah"
50 }
51 ]
52 },
53 "tokenUri": {
54 "gateway": "https://ipfs.io/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/3",
55 "raw": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/3"
56 },
57 "media": [
58 {
59 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/e93ceab748985031d68b8ac5a3e38ed1",
60 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/e93ceab748985031d68b8ac5a3e38ed1",
61 "raw": "ipfs://QmYxT4LnK8sqLupjbS6eRvu1si7Ly2wFQAqFebxhWntcf6",
62 "format": "png",
63 "bytes": 208822
64 }
65 ]
66 }
67]

V3 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
6 "name": "BoredApeYachtClub",
7 "symbol": "BAYC",
8 "totalSupply": "10000",
9 "tokenType": "ERC721",
10 "contractDeployer": "0xaBA7161A7fb69c88e16ED9f455CE62B791EE4D03",
11 "deployedBlockNumber": 12287507,
12 "openSeaMetadata": {
13 "floorPrice": 24.76,
14 "collectionName": "Bored Ape Yacht Club",
15 "collectionSlug": "boredapeyachtclub",
16 "safelistRequestStatus": "verified",
17 "imageUrl": "https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format",
18 "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
19 "externalUrl": "http://www.boredapeyachtclub.com/",
20 "twitterUsername": "BoredApeYC",
21 "discordUrl": "https://discord.gg/3P5K3dzgdB",
22 "bannerImageUrl": "https://i.seadn.io/gae/i5dYZRkVCUK97bfprQ3WXyrT9BnLSZtVKGJlKQ919uaUB0sxbngVCioaiyu9r6snqfi2aaTyIvv6DHm4m2R3y7hMajbsv14pSZK8mhs?w=500&auto=format",
23 "lastIngestedAt": "2023-09-18T09:58:23.000Z"
24 },
25 "spamClassifications": []
26 },
27 "tokenId": "3",
28 "tokenType": "ERC721",
29 "tokenUri": "https://ipfs.io/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/3",
30 "image": {
31 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/e93ceab748985031d68b8ac5a3e38ed1",
32 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/e93ceab748985031d68b8ac5a3e38ed1",
33 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/e93ceab748985031d68b8ac5a3e38ed1",
34 "contentType": "image/png",
35 "size": 208822,
36 "originalUrl": "https://ipfs.io/ipfs/QmYxT4LnK8sqLupjbS6eRvu1si7Ly2wFQAqFebxhWntcf6"
37 },
38 "raw": {
39 "tokenUri": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/3",
40 "metadata": {
41 "image": "ipfs://QmYxT4LnK8sqLupjbS6eRvu1si7Ly2wFQAqFebxhWntcf6",
42 "attributes": [
43 {
44 "trait_type": "Background",
45 "value": "Purple"
46 },
47 {
48 "trait_type": "Fur",
49 "value": "Cheetah"
50 }
51 ]
52 }
53 },
54 "collection": {
55 "name": "Bored Ape Yacht Club",
56 "slug": "boredapeyachtclub",
57 "externalUrl": "http://www.boredapeyachtclub.com/",
58 "bannerImageUrl": "https://i.seadn.io/gae/i5dYZRkVCUK97bfprQ3WXyrT9BnLSZtVKGJlKQ919uaUB0sxbngVCioaiyu9r6snqfi2aaTyIvv6DHm4m2R3y7hMajbsv14pSZK8mhs?w=500&auto=format"
59 },
60 "mint": {},
61 "timeLastUpdated": "2023-09-18T18:14:22.829Z"
62 },
63 {
64 "contract": {
65 "address": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
66 "name": "Doodles",
67 "symbol": "DOODLE",
68 "totalSupply": "10000",
69 "tokenType": "ERC721",
70 "contractDeployer": "0x2B3Ab8e7BB14988616359B78709538b10900AB7D",
71 "deployedBlockNumber": 13430097,
72 "openSeaMetadata": {
73 "floorPrice": 1.55,
74 "collectionName": "Doodles",
75 "collectionSlug": "doodles-official",
76 "safelistRequestStatus": "verified",
77 "imageUrl": "https://i.seadn.io/gae/7B0qai02OdHA8P_EOVK672qUliyjQdQDGNrACxs7WnTgZAkJa_wWURnIFKeOh5VTf8cfTqW3wQpozGedaC9mteKphEOtztls02RlWQ?w=500&auto=format",
78 "description": "A community-driven collectibles project featuring art by Burnt Toast. Doodles come in a joyful range of colors, traits and sizes with a collection size of 10,000. Each Doodle allows its owner to vote for experiences and activations paid for by the Doodles Community Treasury.",
79 "externalUrl": "https://doodles.app",
80 "twitterUsername": "doodles",
81 "discordUrl": "https://discord.gg/doodles",
82 "bannerImageUrl": "https://i.seadn.io/gae/svc_rQkHVGf3aMI14v3pN-ZTI7uDRwN-QayvixX-nHSMZBgb1L1LReSg1-rXj4gNLJgAB0-yD8ERoT-Q2Gu4cy5AuSg-RdHF9bOxFDw?w=500&auto=format",
83 "lastIngestedAt": "2023-09-10T05:19:20.000Z"
84 },
85 "spamClassifications": []
86 },
87 "tokenId": "4",
88 "tokenType": "ERC721",
89 "name": "Doodle #4",
90 "description": "A community-driven collectibles project featuring art by Burnt Toast. Doodles come in a joyful range of colors, traits and sizes with a collection size of 10,000. Each Doodle allows its owner to vote for experiences and activations paid for by the Doodles Community Treasury. Burnt Toast is the working alias for Scott Martin, a Canadian–based illustrator, designer, animator and muralist.",
91 "tokenUri": "https://ipfs.io/ipfs/QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/4",
92 "image": {
93 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/f1fa2cc9dd6ddfc0449c5c30fb30fca4",
94 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/f1fa2cc9dd6ddfc0449c5c30fb30fca4",
95 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/f1fa2cc9dd6ddfc0449c5c30fb30fca4",
96 "contentType": "image/png",
97 "size": 129566,
98 "originalUrl": "https://ipfs.io/ipfs/QmcyuFVLbfBmSeQ9ynu4dk67r97nB1abEekotuVuRGWedm"
99 },
100 "raw": {
101 "tokenUri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/4",
102 "metadata": {
103 "name": "Doodle #4",
104 "image": "ipfs://QmcyuFVLbfBmSeQ9ynu4dk67r97nB1abEekotuVuRGWedm",
105 "description": "A community-driven collectibles project featuring art by Burnt Toast. Doodles come in a joyful range of colors, traits and sizes with a collection size of 10,000. Each Doodle allows its owner to vote for experiences and activations paid for by the Doodles Community Treasury. Burnt Toast is the working alias for Scott Martin, a Canadian–based illustrator, designer, animator and muralist.",
106 "attributes": [
107 {
108 "value": "happy",
109 "trait_type": "face"
110 },
111 {
112 "value": "purple",
113 "trait_type": "head"
114 }
115 ]
116 }
117 },
118 "collection": {
119 "name": "Doodles",
120 "slug": "doodles-official",
121 "externalUrl": "https://doodles.app",
122 "bannerImageUrl": "https://i.seadn.io/gae/svc_rQkHVGf3aMI14v3pN-ZTI7uDRwN-QayvixX-nHSMZBgb1L1LReSg1-rXj4gNLJgAB0-yD8ERoT-Q2Gu4cy5AuSg-RdHF9bOxFDw?w=500&auto=format"
123 },
124 "mint": {},
125 "timeLastUpdated": "2023-09-18T08:18:52.566Z"
126 }
127 ]
128}

refreshNftMetadata - SDK

Refreshes the cached metadata for a provided NFT contract address and token id. Returns a boolean value indicating whether the metadata was refreshed.

Overview of Changes

  • There are no changes in the request structure or method name between V2 and V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 const contractAddress = "0x06012c8cf97bead5deae237070f9587f8e7a266d";
15 const tokenId = "1";
16 //Call the method
17 let response = await alchemy.nft.refreshNftMetadata(contractAddress, tokenId)
18
19 //Logging the response to the console
20 console.log(response)
21};
22
23main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
booleanboolean

Example Responses

V2 Example Response

shell
$false

V3 Example Response

json
1true

getNftSales - SDK

Returns NFT sales that have happened through on-chain marketplaces.

Overview of Changes

  • The marketplaceAddress parameter has been added to the V3 response.
  • The marketplaceFee has been removed from the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 //Call the method to return the nft sales data
15 const response = await alchemy.nft.getNftSales()
16
17 //Logging the response to the console
18 console.log(response)
19};
20
21main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
marketplacemarketplace
-marketplaceAddress(New in V3)
contractAddresscontractAddress
tokenIdtokenId
quantityquantity
buyerAddressbuyerAddress
sellerAddresssellerAddress
takertaker
sellerFeesellerFee
marketplaceFee(Removed in V3)
protocolFeeprotocolFee
royaltyFeeroyaltyFee
blockNumberblockNumber
logIndexlogIndex
bundleIndexbundleIndex
transactionHashtransactionHash
validAtvalidAt
validAt.blockNumbervalidAt.blockNumber
validAt.blockHashvalidAt.blockHash
validAt.blockTimestampvalidAt.blockTimestamp
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "nftSales": [
3 {
4 "marketplace": "cryptopunks",
5 "contractAddress": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
6 "tokenId": "544",
7 "quantity": "1",
8 "buyerAddress": "0x5b098b00621eda6a96b7a476220661ad265f083f",
9 "sellerAddress": "0xc352b534e8b987e036a93539fd6897f53488e56a",
10 "taker": "seller",
11 "sellerFee": {
12 "amount": "10000000000000000",
13 "tokenAddress": "0x0000000000000000000000000000000000000000",
14 "symbol": "ETH",
15 "decimals": 18
16 },
17 "marketplaceFee": {},
18 "protocolFee": {},
19 "royaltyFee": {},
20 "blockNumber": 3919706,
21 "logIndex": 25,
22 "bundleIndex": 0,
23 "transactionHash": "0xb28b5f2c186bf534e4fc4b8604b1496c9632e42269424f70ef1bdce61ea8ba52"
24 },
25 {
26 "marketplace": "cryptopunks",
27 "contractAddress": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
28 "tokenId": "3134",
29 "quantity": "1",
30 "buyerAddress": "0xc352b534e8b987e036a93539fd6897f53488e56a",
31 "sellerAddress": "0x5b098b00621eda6a96b7a476220661ad265f083f",
32 "taker": "buyer",
33 "sellerFee": {
34 "amount": "10000000000000000",
35 "tokenAddress": "0x0000000000000000000000000000000000000000",
36 "symbol": "ETH",
37 "decimals": 18
38 },
39 "marketplaceFee": {},
40 "protocolFee": {},
41 "royaltyFee": {},
42 "blockNumber": 3919721,
43 "logIndex": 9,
44 "bundleIndex": 0,
45 "transactionHash": "0x65579455ac3227e7b3db72b4e359e988bb16cae6d26c88818d1a6991b478b274"
46 },
47 {
48 "marketplace": "cryptopunks",
49 "contractAddress": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
50 "tokenId": "5056",
51 "quantity": "1",
52 "buyerAddress": "0x00bd9fd57c423a1b1c969823d409156d90974d77",
53 "sellerAddress": "0xc352b534e8b987e036a93539fd6897f53488e56a",
54 "taker": "buyer",
55 "sellerFee": {
56 "amount": "100000000000000000",
57 "tokenAddress": "0x0000000000000000000000000000000000000000",
58 "symbol": "ETH",
59 "decimals": 18
60 },
61 "marketplaceFee": {},
62 "protocolFee": {},
63 "royaltyFee": {},
64 "blockNumber": 3919847,
65 "logIndex": 35,
66 "bundleIndex": 0,
67 "transactionHash": "0xd79cca9282c06a0edb8f9426aae734119f0f2ed0d9683dfe3723dc7814f5fccd"
68 },
69 {
70 "marketplace": "cryptopunks",
71 "contractAddress": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
72 "tokenId": "5719",
73 "quantity": "1",
74 "buyerAddress": "0x00bd3a6660309fb9e0129b9b777a9ccb9c2869dc",
75 "sellerAddress": "0x5b098b00621eda6a96b7a476220661ad265f083f",
76 "taker": "buyer",
77 "sellerFee": {
78 "amount": "40000000000000000",
79 "tokenAddress": "0x0000000000000000000000000000000000000000",
80 "symbol": "ETH",
81 "decimals": 18
82 },
83 "marketplaceFee": {},
84 "protocolFee": {},
85 "royaltyFee": {},
86 "blockNumber": 4367925,
87 "logIndex": 71,
88 "bundleIndex": 0,
89 "transactionHash": "0xe6e1885bd2dd142c63b79df6aca0ad3213e37c3a9f01a550c30fa1b234d3c7f2"
90 }
91 ],
92 "validAt": {
93 "blockNumber": 17736688,
94 "blockHash": "0x09c001045ba91210c239bf53948ce23329306cd64fe9c1618d6b9459ff283817",
95 "blockTimestamp": "2023-07-20T20:13:35Z"
96 },
97 "pageKey": "NDM2ODAyNSw3Miww"
98}

V3 Example Response

json
1{
2 "nftSales": [
3 {
4 "marketplace": "cryptopunks",
5 "marketplaceAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
6 "contractAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
7 "tokenId": "544",
8 "quantity": "1",
9 "buyerAddress": "0x5b098b00621EDa6a96b7a476220661ad265F083f",
10 "sellerAddress": "0xC352B534e8b987e036A93539Fd6897F53488e56a",
11 "taker": "seller",
12 "sellerFee": {
13 "amount": "10000000000000000",
14 "tokenAddress": "0x0000000000000000000000000000000000000000",
15 "symbol": "ETH",
16 "decimals": 18
17 },
18 "protocolFee": {},
19 "royaltyFee": {},
20 "blockNumber": 3919706,
21 "logIndex": 25,
22 "bundleIndex": 0,
23 "transactionHash": "0xb28b5f2c186bf534e4fc4b8604b1496c9632e42269424f70ef1bdce61ea8ba52"
24 },
25 {
26 "marketplace": "cryptopunks",
27 "marketplaceAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
28 "contractAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
29 "tokenId": "3134",
30 "quantity": "1",
31 "buyerAddress": "0xC352B534e8b987e036A93539Fd6897F53488e56a",
32 "sellerAddress": "0x5b098b00621EDa6a96b7a476220661ad265F083f",
33 "taker": "buyer",
34 "sellerFee": {
35 "amount": "10000000000000000",
36 "tokenAddress": "0x0000000000000000000000000000000000000000",
37 "symbol": "ETH",
38 "decimals": 18
39 },
40 "protocolFee": {},
41 "royaltyFee": {},
42 "blockNumber": 3919721,
43 "logIndex": 9,
44 "bundleIndex": 0,
45 "transactionHash": "0x65579455ac3227e7b3db72b4e359e988bb16cae6d26c88818d1a6991b478b274"
46 },
47 {
48 "marketplace": "cryptopunks",
49 "marketplaceAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
50 "contractAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
51 "tokenId": "5445",
52 "quantity": "1",
53 "buyerAddress": "0x0f4023208058ecfFCb22A7409Df11F6D6013FE8A",
54 "sellerAddress": "0x0B30fD3a500608413837Bb025c2018933130F9DB",
55 "taker": "buyer",
56 "sellerFee": {
57 "amount": "130000000000000000",
58 "tokenAddress": "0x0000000000000000000000000000000000000000",
59 "symbol": "ETH",
60 "decimals": 18
61 },
62 "protocolFee": {},
63 "royaltyFee": {},
64 "blockNumber": 4367925,
65 "logIndex": 71,
66 "bundleIndex": 0,
67 "transactionHash": "0xe6e1885bd2dd142c63b79df6aca0ad3213e37c3a9f01a550c30fa1b234d3c7f2"
68 }
69 ],
70 "validAt": {
71 "blockNumber": 18213475,
72 "blockHash": "0xc839e3f01f73b8818899bad0d043b39c6ca0c9ec2150c62a9d195796b39c61a9",
73 "blockTimestamp": "2023-09-25T14:44:35Z"
74 },
75 "pageKey": "NDM2ODAyNSw3Miww"
76}

summarizeNftAttributes - SDK

Get a summary of attribute prevalence for an NFT collection.

Overview of Changes

  • There are no changes in the method’s request, response format, or parameter names/structures between V2 and V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 const collection = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
15
16 //Call the method to fetch a summary a attribute prevalence for an NFT collection.
17 const response = await alchemy.nft.summarizeNftAttributes(collection)
18
19 //Logging the response to the console
20 console.log(response)
21};
22
23main();

V3 Example Request

javascript
1// Same as V2.

Overview of Changes

  • No changes have been made to the request or response structure in the transition from V2 to V3.

V2 <> V3 Mapping

V2 ParameterV3 Parameter
totalSupplytotalSupply
contractAddresscontractAddress
summarysummary

Example Responses

V2 Example Response

json
1{
2 "summary": {
3 "Fur": {
4 "Tan": 626,
5 "Death Bot": 175,
6 "Trippy": 77,
7 "Brown": 1370,
8 "Gray": 496,
9 "Golden Brown": 778,
10 "Blue": 490,
11 "Noise": 155,
12 "Zombie": 302,
13 "Cream": 636,
14 "Solid Gold": 46,
15 "Dmt": 215,
16 "Black": 1229,
17 "Cheetah": 406,
18 "Dark Brown": 1352,
19 "Red": 474,
20 "Pink": 511,
21 "White": 397,
22 "Robot": 265
23 },
24 "Eyes": {
25 "Heart": 394,
26 "Sleepy": 751,
27 "Eyepatch": 333,
28 "X Eyes": 243,
29 "Zombie": 308,
30 "Angry": 432,
31 "Coins": 479,
32 "Blue Beams": 49,
33 "Wide Eyed": 549,
34 "Hypnotized": 220,
35 "Bloodshot": 846,
36 "Blindfold": 264,
37 "Sunglasses": 352,
38 "3d": 487,
39 "Bored": 1714,
40 "Laser Eyes": 69,
41 "Cyborg": 108,
42 "Crazy": 407,
43 "Closed": 710,
44 "Sad": 551,
45 "Scumbag": 233,
46 "Robot": 350,
47 "Holographic": 151
48 },
49 "Background": {
50 "Gray": 1170,
51 "Aquamarine": 1266,
52 "Blue": 1242,
53 "Purple": 1291,
54 "Yellow": 1283,
55 "New Punk Blue": 1232,
56 "Army Green": 1243,
57 "Orange": 1273
58 },
59 "Mouth": {
60 "Phoneme Vuh": 333,
61 "Discomfort": 208,
62 "Bored Unshaven Pipe": 101,
63 "Bored Cigarette": 710,
64 "Rage": 266,
65 "Bored Bubblegum": 119,
66 "Bored Pizza": 50,
67 "Grin": 713,
68 "Bored Party Horn": 88,
69 "Bored": 2272,
70 "Bored Unshaven Bubblegum": 65,
71 "Bored Unshaven Cigarette": 438,
72 "Jovial": 296,
73 "Tongue Out": 202,
74 "Grin Multicolored": 116,
75 "Small Grin": 272,
76 "Bored Unshaven Party horn": 45,
77 "Phoneme ooo": 255,
78 "Bored Unshaven": 1551,
79 "Bored Unshaven Pizza": 26,
80 "Bored Unshaven Dagger": 28,
81 "Phoneme Wah": 163,
82 "Phoneme Oh": 237,
83 "Dumbfounded": 505,
84 "Bored Pipe": 132,
85 "Grin Gold Grill": 91,
86 "Bored Unshaven Cigar": 94,
87 "Phoneme L": 241,
88 "Bored Unshaven Kazoo": 61,
89 "Grin Diamond Grill": 78,
90 "Bored Dagger": 49,
91 "Bored Cigar": 121,
92 "Bored Kazoo": 74
93 },
94 "Clothes": {
95 "Smoking Jacket": 221,
96 "Bone Necklace": 203,
97 "Leather Jacket": 206,
98 "Striped Tee": 412,
99 "Bone Tee": 230,
100 "Tweed Suit": 141,
101 "Puffy Vest": 227,
102 "Vietnam Jacket": 224,
103 "Toga": 202,
104 "Black Holes T": 205,
105 "Prom Dress": 103,
106 "Work Vest": 188,
107 "Sleeveless Logo T": 144,
108 "Tanktop": 235,
109 "Hawaiian": 283,
110 "Bayc T Black": 215,
111 "Lumberjack Shirt": 213,
112 "Hip Hop": 128,
113 "Admirals Coat": 64,
114 "Lab Coat": 144,
115 "Pimp Coat": 80,
116 "Prison Jumpsuit": 235,
117 "Black Suit": 42,
118 "Service": 142,
119 "Blue Dress": 95,
120 "Caveman Pelt": 163,
121 "Sleeveless T": 252,
122 "Guayabera": 232,
123 "Sailor Shirt": 284,
124 "Bayc T Red": 140,
125 "Bandolier": 163,
126 "Rainbow Suspenders": 135,
127 "Tie Dye": 144,
128 "Biker Vest": 253,
129 "Space Suit": 105,
130 "Cowboy Shirt": 119,
131 "Navy Striped Tee": 334,
132 "Stunt Jacket": 178,
133 "Kings Robe": 68,
134 "Wool Turtleneck": 240,
135 "Leather Punk Jacket": 153,
136 "Black T": 334,
137 "Tuxedo Tee": 235
138 },
139 "Earring": {
140 "Gold Hoop": 462,
141 "Silver Hoop": 882,
142 "Silver Stud": 823,
143 "Gold Stud": 439,
144 "Cross": 149,
145 "Diamond Stud": 222
146 },
147 "Hat": {
148 "Trippy Captain's Hat": 65,
149 "Bayc Flipped Brim": 231,
150 "Short Mohawk": 318,
151 "Safari": 182,
152 "Cowboy Hat": 354,
153 "Sea Captain's Hat": 304,
154 "Vietnam Era Helmet": 223,
155 "Sushi Chef Headband": 187,
156 "Irish Boho": 225,
157 "Girl's Hair Short": 150,
158 "Laurel Wreath": 72,
159 "Girl's Hair Pink": 105,
160 "Bayc Hat Red": 119,
161 "Horns": 252,
162 "Fisherman's Hat": 345,
163 "Bowler": 262,
164 "Spinner Hat": 181,
165 "Faux Hawk": 136,
166 "Seaman's Hat": 420,
167 "Ww2 Pilot Helm": 110,
168 "Party Hat 1": 120,
169 "Party Hat 2": 107,
170 "Beanie": 578,
171 "King's Crown": 77,
172 "Army Hat": 294,
173 "Commie Hat": 304,
174 "Bunny Ears": 195,
175 "S&m Hat": 235,
176 "Stuntman Helmet": 157,
177 "Fez": 377,
178 "Bandana Blue": 89,
179 "Bayc Hat Black": 228,
180 "Halo": 324,
181 "Police Motorcycle Helmet": 130,
182 "Prussian Helmet": 130,
183 "Baby's Bonnet": 158
184 }
185 },
186 "totalSupply": 10000,
187 "contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
188}

V3 Example Response

json
1{
2 "summary": {
3 "Fur": {
4 "Tan": 626,
5 "Death Bot": 175,
6 "Trippy": 77,
7 "Brown": 1370,
8 "Gray": 496,
9 "Golden Brown": 778,
10 "Blue": 490,
11 "Noise": 155,
12 "Zombie": 302,
13 "Cream": 636,
14 "Solid Gold": 46,
15 "Dmt": 215,
16 "Black": 1229,
17 "Cheetah": 406,
18 "Dark Brown": 1352,
19 "Red": 474,
20 "Pink": 511,
21 "White": 397,
22 "Robot": 265
23 },
24 "Eyes": {
25 "Heart": 394,
26 "Sleepy": 751,
27 "Eyepatch": 333,
28 "X Eyes": 243,
29 "Zombie": 308,
30 "Angry": 432,
31 "Coins": 479,
32 "Blue Beams": 49,
33 "Wide Eyed": 549,
34 "Hypnotized": 220,
35 "Bloodshot": 846,
36 "Blindfold": 264,
37 "Sunglasses": 352,
38 "3d": 487,
39 "Bored": 1714,
40 "Laser Eyes": 69,
41 "Cyborg": 108,
42 "Crazy": 407,
43 "Closed": 710,
44 "Sad": 551,
45 "Scumbag": 233,
46 "Robot": 350,
47 "Holographic": 151
48 },
49 "Background": {
50 "Gray": 1170,
51 "Aquamarine": 1266,
52 "Blue": 1242,
53 "Purple": 1291,
54 "Yellow": 1283,
55 "New Punk Blue": 1232,
56 "Army Green": 1243,
57 "Orange": 1273
58 },
59 "Mouth": {
60 "Phoneme Vuh": 333,
61 "Discomfort": 208,
62 "Bored Unshaven Pipe": 101,
63 "Bored Cigarette": 710,
64 "Rage": 266,
65 "Bored Bubblegum": 119,
66 "Bored Pizza": 50,
67 "Grin": 713,
68 "Bored Party Horn": 88,
69 "Bored": 2272,
70 "Bored Unshaven Bubblegum": 65,
71 "Bored Unshaven Cigarette": 438,
72 "Jovial": 296,
73 "Tongue Out": 202,
74 "Grin Multicolored": 116,
75 "Small Grin": 272,
76 "Bored Unshaven Party horn": 45,
77 "Phoneme ooo": 255,
78 "Bored Unshaven": 1551,
79 "Bored Unshaven Pizza": 26,
80 "Bored Unshaven Dagger": 28,
81 "Phoneme Wah": 163,
82 "Phoneme Oh": 237,
83 "Dumbfounded": 505,
84 "Bored Pipe": 132,
85 "Grin Gold Grill": 91,
86 "Bored Unshaven Cigar": 94,
87 "Phoneme L": 241,
88 "Bored Unshaven Kazoo": 61,
89 "Grin Diamond Grill": 78,
90 "Bored Dagger": 49,
91 "Bored Cigar": 121,
92 "Bored Kazoo": 74
93 },
94 "Clothes": {
95 "Smoking Jacket": 221,
96 "Bone Necklace": 203,
97 "Leather Jacket": 206,
98 "Striped Tee": 412,
99 "Bone Tee": 230,
100 "Tweed Suit": 141,
101 "Puffy Vest": 227,
102 "Vietnam Jacket": 224,
103 "Toga": 202,
104 "Black Holes T": 205,
105 "Prom Dress": 103,
106 "Work Vest": 188,
107 "Sleeveless Logo T": 144,
108 "Tanktop": 235,
109 "Hawaiian": 283,
110 "Bayc T Black": 215,
111 "Lumberjack Shirt": 213,
112 "Hip Hop": 128,
113 "Admirals Coat": 64,
114 "Lab Coat": 144,
115 "Pimp Coat": 80,
116 "Prison Jumpsuit": 235,
117 "Black Suit": 42,
118 "Service": 142,
119 "Blue Dress": 95,
120 "Caveman Pelt": 163,
121 "Sleeveless T": 252,
122 "Guayabera": 232,
123 "Sailor Shirt": 284,
124 "Bayc T Red": 140,
125 "Bandolier": 163,
126 "Rainbow Suspenders": 135,
127 "Tie Dye": 144,
128 "Biker Vest": 253,
129 "Space Suit": 105,
130 "Cowboy Shirt": 119,
131 "Navy Striped Tee": 334,
132 "Stunt Jacket": 178,
133 "Kings Robe": 68,
134 "Wool Turtleneck": 240,
135 "Leather Punk Jacket": 153,
136 "Black T": 334,
137 "Tuxedo Tee": 235
138 },
139 "Earring": {
140 "Gold Hoop": 462,
141 "Silver Hoop": 882,
142 "Silver Stud": 823,
143 "Gold Stud": 439,
144 "Cross": 149,
145 "Diamond Stud": 222
146 },
147 "Hat": {
148 "Trippy Captain's Hat": 65,
149 "Bayc Flipped Brim": 231,
150 "Short Mohawk": 318,
151 "Safari": 182,
152 "Cowboy Hat": 354,
153 "Sea Captain's Hat": 304,
154 "Vietnam Era Helmet": 223,
155 "Sushi Chef Headband": 187,
156 "Irish Boho": 225,
157 "Girl's Hair Short": 150,
158 "Laurel Wreath": 72,
159 "Girl's Hair Pink": 105,
160 "Bayc Hat Red": 119,
161 "Horns": 252,
162 "Fisherman's Hat": 345,
163 "Bowler": 262,
164 "Spinner Hat": 181,
165 "Faux Hawk": 136,
166 "Seaman's Hat": 420,
167 "Ww2 Pilot Helm": 110,
168 "Party Hat 1": 120,
169 "Party Hat 2": 107,
170 "Beanie": 578,
171 "King's Crown": 77,
172 "Army Hat": 294,
173 "Commie Hat": 304,
174 "Bunny Ears": 195,
175 "S&m Hat": 235,
176 "Stuntman Helmet": 157,
177 "Fez": 377,
178 "Bandana Blue": 89,
179 "Bayc Hat Black": 228,
180 "Halo": 324,
181 "Police Motorcycle Helmet": 130,
182 "Prussian Helmet": 130,
183 "Baby's Bonnet": 158
184 }
185 },
186 "totalSupply": 10000,
187 "contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
188}

searchContractMetadata - SDK

Search for a keyword across the metadata of all ERC-721 and ERC-1155 smart contracts.

Overview of Changes

  • The V3 response now lists the metadata objects within a contracts Array.
  • The openSea object in the V2 response has been changed to openSeaMetadata in the V3 response.
  • The openSeaMetadataobject in the V3 response now contains the collectionSlug and bannerImageUrl parameters.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 const kw = "hair"
15
16 //Call the method to fetch metadata
17 const response = await alchemy.nft.searchContractMetadata(kw)
18
19 //Logging the response to the console
20 console.log(response)
21};
22
23main();

V3 Example Request

javascript
1// Same as V2.

V2 <> V3 Mapping

V2 ParameterV3 Parameter
addressaddress
namename
symbolsymbol
totalSupplytotalSupply
tokenTypetokenType
openSea.floorPriceopenSeaMetadata.floorPrice
openSea.collectionNameopenSeaMetadata.collectionName
-openSeaMetadata.collectionSlug(New in V3)
openSea.safelistRequestStatusopenSeaMetadata.safelistRequestStatus
openSea.imageUrlopenSeaMetadata.imageUrl
openSea.descriptionopenSeaMetadata.description
openSea.externalUrlopenSeaMetadata.externalUrl
openSea.twitterUsernameopenSeaMetadata.twitterUsername
openSea.discordUrlopenSeaMetadata.discordUrl
openSea.lastIngestedAtopenSeaMetadata.lastIngestedAt
-openSeaMetada.bannerImageUrl(New in V3)
contractDeployercontractDeployer
deployedBlockNumberdeployedBlockNumber

Example Responses

V2 Example Response

json
1[
2 {
3 "address": "0x1eac31a0b93e81bd093d116f5d36a83be08f381b",
4 "name": "Sneakr Token",
5 "symbol": "SNKR",
6 "totalSupply": "326",
7 "tokenType": "ERC721",
8 "openSea": {
9 "floorPrice": 0,
10 "collectionName": "SneakrCred Drop 1: EthAIReum",
11 "safelistRequestStatus": "verified",
12 "imageUrl": "https://i.seadn.io/gae/7JKgjQsQP6PNiuuT6J7upfs4Iq3btwg1zFMxpzvW9ZFpGFWrf0i2H08vbG-1glj9ZY9HDUxco5z_xMWc7e_f5myd5A?w=500&auto=format",
13 "description": "The first official Sneakr Drop.",
14 "externalUrl": "https://www.sneakrcred.com",
15 "lastIngestedAt": "2023-07-12T23:18:43.000Z"
16 },
17 "contractDeployer": "0xccb74148d315b0397da4e3c7482036dbadd762e5",
18 "deployedBlockNumber": 9458121
19 },
20 {
21 "address": "0x7e2a853626d75321d2b6ed060f6320324d31b7e8",
22 "name": "Happy Little Hairdos",
23 "symbol": "HLHD",
24 "totalSupply": "240",
25 "tokenType": "ERC721",
26 "openSea": {
27 "floorPrice": 0.05,
28 "collectionName": "Happy Little Hairdos",
29 "safelistRequestStatus": "approved",
30 "imageUrl": "https://i.seadn.io/gae/bx3ZIky25jfqxG_ield-BWVNuWvoOLJsqm-1TPN90xVuzyLrEjROQAX_Qf2jgMb5OrCsF_OKaRWq3DEpWztPRK2DriuRMN997kar?w=500&auto=format",
31 "description": "Happy Little Hairdos is a parody collection of 10,000 unique NFTs celebrating the man we all know as the painter with a Fro. Straight from the imagination & hand of artist J.J. Weinberg, what began as a Prismacolor illustration on paper in 2014 & an idea of a ☕ table ???? has found its way onto the blockchain. Weinberg is determined to push the envelope on the connection of the metaverse & the physical world. Let the #FROMO begin!\r\n\r\nDetails - www.happylittlehairdos.com\r\n\r\nHighlights\r\n\r\nArt / Print quality images 3000x3000k (Set to print at 10”x10” 300 dpi)\r\nCoffee table book featuring “Curated Cuts” & randomly chosen HLHD’s\r\nInfinite “Bob”jects\r\nEarly access to merch via the Fromo Boutique\r\n“Curated Cuts for a Cause” the rarity’s for charity on these special tokens outside of the 10K\r\nAccess to Alexander Bill’s “ART”cade\r\nSpecial token access to commissioned work by the artist & derivative license\r\nJoy of Minting mini-series\r\nSpecial thanks @cheforche - IG @jjweinberg - IG",
32 "externalUrl": "https://www.happylittlehairdos.com",
33 "twitterUsername": "happylittlehair",
34 "discordUrl": "https://discord.gg/kWFU5xP74W",
35 "lastIngestedAt": "2023-07-12T23:20:03.000Z"
36 },
37 "contractDeployer": "0x5582809dd5d7b8848397c6033d8a41e4b06f8ded",
38 "deployedBlockNumber": 12885162
39 },
40 {
41 "address": "0x82cb9d20862641301c987f0b096086d32bc11b65",
42 "name": "AStrandOfHair",
43 "symbol": "ASOH",
44 "totalSupply": "10358",
45 "tokenType": "ERC721",
46 "openSea": {
47 "floorPrice": 0,
48 "collectionName": "AStrandOfHair",
49 "safelistRequestStatus": "approved",
50 "imageUrl": "https://i.seadn.io/gcs/files/5aa37f4f867ad6f1d5ab710f67f6cfdd.jpg?w=500&auto=format",
51 "description": "It's a metaverse built by wizards. From just a strand of hair to the entire world. We are not just a meme, we are a culture strongly rooted by our community. ",
52 "externalUrl": "https://astrandofhair.xyz/",
53 "twitterUsername": "Hair_xyz",
54 "lastIngestedAt": "2023-07-13T04:09:33.000Z"
55 },
56 "contractDeployer": "0xc4c2a776a352a8994be83d2ef2bb4a9604dc6e97",
57 "deployedBlockNumber": 15210942
58 },
59 {
60 "address": "0xbd5bd01e9445d24d83e8607ac0a64d71c9d36933",
61 "name": "Queens+KingsHair",
62 "symbol": "Q+KTH",
63 "totalSupply": "3623",
64 "tokenType": "ERC721",
65 "openSea": {
66 "floorPrice": 0.0045,
67 "collectionName": "Queens+Kings Traits",
68 "safelistRequestStatus": "approved",
69 "imageUrl": "https://i.seadn.io/gae/0OkPiJqvKO7oAJYU7pNGp3Y2nGgCm98itXBnCa12xpEttaVw9HuUFhFNXmE0lfaQjZGpxa6N8KrZtHcX1InpNzNtaBkW8kslTwYwAQ?w=500&auto=format",
70 "description": "Queens+Kings overthrow hierarchies in contemporary art and re-mint your CryptoRealm:\nCreated by Hackatao and NFT Studios, supported by Sotheby’s\n\n6,900 Queens+Kings: interchangeable NFT traits, randomly allocated and algorithmically generated. The avatars can then be hacked by the collectors, customized, disassembled and assembled on the [dedicated website](http://queenskings.hackatao.com) builder. In the cryptoverse, a non-hierarchical community is in charge, traditional roles of the art world are subverted. Hack the Royals, let the Self-Crowning begin. ",
71 "externalUrl": "https://queenskings.hackatao.com/",
72 "twitterUsername": "Hackatao",
73 "discordUrl": "https://discord.gg/hackatao",
74 "lastIngestedAt": "2023-07-14T19:19:37.000Z"
75 },
76 "contractDeployer": "0x139c8919ce2b7fb8a04f929d83b8c54c116c692b",
77 "deployedBlockNumber": 13984623
78 },
79 {
80 "address": "0xcba843509a832131eb6f72845482abd440f75dc7",
81 "name": "Wind In Her Hair ",
82 "symbol": "PHOTO",
83 "totalSupply": "1",
84 "tokenType": "ERC721",
85 "openSea": {
86 "floorPrice": 0,
87 "collectionName": "Wind In Her Hair.",
88 "safelistRequestStatus": "requested",
89 "imageUrl": "https://i.seadn.io/gae/zZvfeMVYtZRk92TFIb7-ytogC7D7kbG50V_V_35yFBilinbVoZNEzHJ_wuqAzFK59BvejB0gM2SlFsVpiwWKJZNjWc0Xoytc2H-2?w=500&auto=format",
90 "description": "Stories about loneliness on a lost island",
91 "twitterUsername": "xeniiau",
92 "lastIngestedAt": "2023-07-15T01:43:37.000Z"
93 },
94 "contractDeployer": "0x56e6b5de6a4e680e49bf1de3e14b2d49e51103ff",
95 "deployedBlockNumber": 14423329
96 },
97 {
98 "address": "0x55fd148b0b0df020b5cc49d00bc9b1464afd85dd",
99 "name": "A Portrait Study of Hair",
100 "symbol": "HAIR",
101 "totalSupply": "4",
102 "tokenType": "ERC721",
103 "openSea": {
104 "floorPrice": 0,
105 "collectionName": "A Portrait Study of Hair",
106 "safelistRequestStatus": "not_requested",
107 "lastIngestedAt": "2023-07-09T22:59:19.000Z"
108 },
109 "contractDeployer": "0x3ae33a926a69aeb1ca977cec976b9e53fa84fc25",
110 "deployedBlockNumber": 14230101
111 }
112]

V3 Example Response

json
1{
2 "contracts": [
3 {
4 "address": "0x1EaC31A0B93E81bd093d116f5D36a83Be08f381B",
5 "name": "Sneakr Token",
6 "symbol": "SNKR",
7 "totalSupply": "326",
8 "tokenType": "ERC721",
9 "contractDeployer": "0xccB74148D315B0397dA4e3C7482036dbaDD762e5",
10 "deployedBlockNumber": 9458121,
11 "openSeaMetadata": {
12 "floorPrice": 0,
13 "collectionName": "SneakrCred Drop 1: EthAIReum",
14 "collectionSlug": "sneakr-token",
15 "safelistRequestStatus": "verified",
16 "imageUrl": "https://i.seadn.io/gae/7JKgjQsQP6PNiuuT6J7upfs4Iq3btwg1zFMxpzvW9ZFpGFWrf0i2H08vbG-1glj9ZY9HDUxco5z_xMWc7e_f5myd5A?w=500&auto=format",
17 "description": "The first official Sneakr Drop.",
18 "externalUrl": "https://www.sneakrcred.com",
19 "lastIngestedAt": "2023-09-09T23:18:24.000Z"
20 }
21 },
22 {
23 "address": "0x7E2A853626D75321d2B6eD060f6320324D31b7e8",
24 "name": "Happy Little Hairdos",
25 "symbol": "HLHD",
26 "totalSupply": "241",
27 "tokenType": "ERC721",
28 "contractDeployer": "0x5582809Dd5d7b8848397C6033D8a41e4b06F8dEd",
29 "deployedBlockNumber": 12885162,
30 "openSeaMetadata": {
31 "floorPrice": 0.05,
32 "collectionName": "Happy Little Hairdos",
33 "collectionSlug": "hlhd",
34 "safelistRequestStatus": "approved",
35 "imageUrl": "https://i.seadn.io/gae/bx3ZIky25jfqxG_ield-BWVNuWvoOLJsqm-1TPN90xVuzyLrEjROQAX_Qf2jgMb5OrCsF_OKaRWq3DEpWztPRK2DriuRMN997kar?w=500&auto=format",
36 "description": "Happy Little Hairdos is a parody collection of 10,000 unique NFTs celebrating the man we all know as the painter with a Fro. Straight from the imagination & hand of artist J.J. Weinberg, what began as a Prismacolor illustration on paper in 2014 & an idea of a ☕ table ???? has found its way onto the blockchain. Weinberg is determined to push the envelope on the connection of the metaverse & the physical world. Let the #FROMO begin!\r\n\r\nDetails - www.happylittlehairdos.com\r\n\r\nHighlights\r\n\r\nArt / Print quality images 3000x3000k (Set to print at 10”x10” 300 dpi)\r\nCoffee table book featuring “Curated Cuts” & randomly chosen HLHD’s\r\nInfinite “Bob”jects\r\nEarly access to merch via the Fromo Boutique\r\n“Curated Cuts for a Cause” the rarity’s for charity on these special tokens outside of the 10K\r\nAccess to Alexander Bill’s “ART”cade\r\nSpecial token access to commissioned work by the artist & derivative license\r\nJoy of Minting mini-series\r\nSpecial thanks @cheforche - IG @jjweinberg - IG",
37 "externalUrl": "https://www.happylittlehairdos.com",
38 "twitterUsername": "happylittlehair",
39 "discordUrl": "https://discord.gg/kWFU5xP74W",
40 "bannerImageUrl": "https://i.seadn.io/gae/WhmKRaraSN-sWNMtKm6BIiZ95ikkJ9Ey9Q6KaVtwxpAmI7MmaOi8D6X_JrBsJBU0bY4VRmNaRDXP7jnSpBnCvrtMevqJL6UJGjhByg?w=500&auto=format",
41 "lastIngestedAt": "2023-09-09T23:19:57.000Z"
42 }
43 },
44 {
45 "address": "0x82Cb9D20862641301C987f0b096086d32bC11B65",
46 "name": "AStrandOfHair",
47 "symbol": "ASOH",
48 "totalSupply": "10358",
49 "tokenType": "ERC721",
50 "contractDeployer": "0xC4c2a776A352A8994be83D2ef2Bb4A9604DC6E97",
51 "deployedBlockNumber": 15210942,
52 "openSeaMetadata": {
53 "floorPrice": 0,
54 "collectionName": "AStrandOfHair",
55 "collectionSlug": "astrandofhair",
56 "safelistRequestStatus": "approved",
57 "imageUrl": "https://i.seadn.io/gcs/files/5aa37f4f867ad6f1d5ab710f67f6cfdd.jpg?w=500&auto=format",
58 "description": "It's a metaverse built by wizards. From just a strand of hair to the entire world. We are not just a meme, we are a culture strongly rooted by our community. ",
59 "externalUrl": "https://astrandofhair.xyz/",
60 "twitterUsername": "Hair_xyz",
61 "bannerImageUrl": "https://i.seadn.io/gcs/files/3e75adaed1ac45184ea446175e8856d9.jpg?w=500&auto=format",
62 "lastIngestedAt": "2023-09-10T01:35:01.000Z"
63 }
64 },
65 {
66 "address": "0xBd5BD01e9445d24D83E8607Ac0a64D71C9D36933",
67 "name": "Queens+KingsHair",
68 "symbol": "Q+KTH",
69 "totalSupply": "3638",
70 "tokenType": "ERC721",
71 "contractDeployer": "0x139C8919Ce2B7fb8A04F929d83b8C54C116c692b",
72 "deployedBlockNumber": 13984623,
73 "openSeaMetadata": {
74 "floorPrice": 0.003,
75 "collectionName": "Queens+Kings Traits",
76 "collectionSlug": "queenskings-traits",
77 "safelistRequestStatus": "approved",
78 "imageUrl": "https://i.seadn.io/gae/0OkPiJqvKO7oAJYU7pNGp3Y2nGgCm98itXBnCa12xpEttaVw9HuUFhFNXmE0lfaQjZGpxa6N8KrZtHcX1InpNzNtaBkW8kslTwYwAQ?w=500&auto=format",
79 "description": "Queens+Kings overthrow hierarchies in contemporary art and re-mint your CryptoRealm:\nCreated by Hackatao and NFT Studios, supported by Sotheby’s\n\n6,900 Queens+Kings: interchangeable NFT traits, randomly allocated and algorithmically generated. The avatars can then be hacked by the collectors, customized, disassembled and assembled on the [dedicated website](http://queenskings.hackatao.com) builder. In the cryptoverse, a non-hierarchical community is in charge, traditional roles of the art world are subverted. Hack the Royals, let the Self-Crowning begin. ",
80 "externalUrl": "https://queenskings.hackatao.com/",
81 "twitterUsername": "Hackatao",
82 "discordUrl": "https://discord.gg/hackatao",
83 "bannerImageUrl": "https://i.seadn.io/gae/k8DXM0eWdF14zud9pr7RURMhC0_zwuEigV_oG3hy5A9HlnKkjoH4lYaPVU5-2O4qC0g46HTWTwUQhKM3ZElgaIJJgqCGcgusGWWIK8Q?w=500&auto=format",
84 "lastIngestedAt": "2023-09-10T18:44:05.000Z"
85 }
86 },
87 {
88 "address": "0x57e876FaEFD30bCEF9B154812Ba4d29396308C38",
89 "name": "A CHAIR IN THE SKY",
90 "symbol": "SKYCHAIR",
91 "totalSupply": "5",
92 "tokenType": "ERC721",
93 "contractDeployer": "0xaB3627317c43D394eb171170f818153B976D28A3",
94 "deployedBlockNumber": 16288864,
95 "openSeaMetadata": {
96 "floorPrice": 0,
97 "collectionName": "A CHAIR IN THE SKY",
98 "collectionSlug": "a-chair-in-the-sky",
99 "safelistRequestStatus": "not_requested",
100 "lastIngestedAt": "2023-09-18T10:20:33.000Z"
101 }
102 }
103 ]
104}

getNftsForOwnerIterator - SDK

Fetches all NFTs for a given owner and yields them in an async iterable.

This method returns the full NFT for the owner and pages through all page keys until all NFTs have been fetched. To get all NFTs without their associated metadata, use the options parameter in the request’s body.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in V3.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadata.attributes parameter has been changed to raw.metadata.attributes in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters for spamInfo in V2 have been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the owner address whose NFTs you want to fetch
15 const owner = "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8";
16
17 // create an async generator function that uses the getNftsForOwnerIterator method
18 async function getNftsForOwner() {
19 try {
20 let nfts = [];
21 // Get the async iterable for the owner's NFTs.
22 const nftsIterable = alchemy.nft.getNftsForOwnerIterator(owner);
23
24 // Iterate over the NFTs and add them to the nfts array.
25 for await (const nft of nftsIterable) {
26 nfts.push(nft);
27 }
28
29 // Log the NFTs.
30 console.log(nfts);
31 } catch (error) {
32 console.log(error);
33 }
34 }
35
36 getNftsForOwner();
37};
38
39main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
rawMetadata.errorraw.error
-raw.tokenUri
mediaimage
-collection (New in V3)
-mint(New in V3)
balancebalance
timeLastUpdatedtimeLastUpdated
-acquiredAt

Example Responses

V2 Example Response

json
1[
2 {
3 "contract": {
4 "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
5 "name": "CryptoKitties",
6 "symbol": "CK",
7 "totalSupply": "2022876",
8 "tokenType": "ERC721",
9 "openSea": {
10 "floorPrice": 0.0039,
11 "collectionName": "CryptoKitties",
12 "safelistRequestStatus": "verified",
13 "imageUrl": "https://i.seadn.io/gae/C272ZRW1RGGef9vKMePFSCeKc1Lw6U40wl9ofNVxzUxFdj84hH9xJRQNf-7wgs7W8qw8RWe-1ybKp-VKuU5D-tg?w=500&auto=format",
14 "description": "CryptoKitties is a game centered around breedable, collectible, and oh-so-adorable creatures we call CryptoKitties! Each cat is one-of-a-kind and 100% owned by you; it cannot be replicated, taken away, or destroyed.",
15 "externalUrl": "https://www.cryptokitties.co/",
16 "twitterUsername": "CryptoKitties",
17 "discordUrl": "https://discord.gg/cryptokitties",
18 "lastIngestedAt": "2023-07-15T21:20:09.000Z"
19 },
20 "contractDeployer": "0xba52c75764d6f594735dc735be7f1830cdf58ddf",
21 "deployedBlockNumber": 4605167
22 },
23 "tokenId": "1289657",
24 "tokenType": "ERC721",
25 "title": "Nala",
26 "description": "",
27 "timeLastUpdated": "2023-07-10T19:05:02.342Z",
28 "rawMetadata": {
29 "birthday": "2018-12-16T00:00:00.000Z",
30 "hatched": true,
31 "enhanced_cattributes": [
32 {
33 "description": "spock",
34 "position": 5850,
35 "type": "pattern",
36 "kittyId": 680104
37 },
38 {
39 "description": "soserious",
40 "type": "mouth",
41 "kittyId": 1289657
42 },
43 {
44 "description": "chronic",
45 "position": 87,
46 "type": "eyes",
47 "kittyId": 468466
48 },
49 {
50 "description": "fox",
51 "position": 28,
52 "type": "body",
53 "kittyId": 916054
54 },
55 {
56 "description": "mauveover",
57 "position": 13,
58 "type": "colorprimary",
59 "kittyId": 11610
60 },
61 {
62 "description": "se7",
63 "position": -1,
64 "type": "secret",
65 "kittyId": 1289657
66 }
67 ],
68 "color": "cyan",
69 "created_at": "2018-12-16T08:12:41.000Z",
70 "bio": "En Taro Adun! I'm Nala. I am currently trying to start my own company making berets for tripod kitties. I combine the best qualities of Ryan Gosling, Benjamin Franklin, and Raekwon. I can tell you like to get into trouble.",
71 "language": "en",
72 "auction": {},
73 "offer": {},
74 "children": [
75 {
76 "generation": 14,
77 "owner": {
78 "address": "0x002781a27becd321d831d815e3fa386944b329c8"
79 },
80 "hatched": true,
81 "enhanced_cattributes": [],
82 "color": "cyan",
83 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
84 "is_exclusive": false,
85 "created_at": "2018-12-16T10:31:23.000Z",
86 "is_special_edition": false,
87 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
88 "kitty_type": "fancy",
89 "fancy_type": "Pawrula",
90 "name": "Pawrula The Bright",
91 "owner_wallet_address": "0x002781a27becd321d831d815e3fa386944b329c8",
92 "id": 1290051,
93 "is_fancy": true,
94 "wrapped": true,
95 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
96 "status": {
97 "is_ready": true,
98 "cooldown": 1527648022509,
99 "is_gestating": false
100 }
101 },
102 {
103 "generation": 14,
104 "owner": {
105 "address": "0x65e10a29e0bf9bfda353ab3d44fe127bf2e09a4b"
106 },
107 "hatched": true,
108 "enhanced_cattributes": [
109 {
110 "description": "soserious",
111 "position": -1,
112 "type": "mouth",
113 "kittyId": 1903269
114 },
115 {
116 "description": "chronic",
117 "position": 87,
118 "type": "eyes",
119 "kittyId": 468466
120 },
121 {
122 "description": "camo",
123 "position": 1001,
124 "type": "pattern",
125 "kittyId": 680201
126 },
127 {
128 "description": "koladiviya",
129 "position": 31,
130 "type": "body",
131 "kittyId": 744561
132 },
133 {
134 "description": "mauveover",
135 "position": 13,
136 "type": "colorprimary",
137 "kittyId": 11610
138 },
139 {
140 "description": "coffee",
141 "position": -1,
142 "type": "colorsecondary",
143 "kittyId": 1903269
144 },
145 {
146 "description": "sandalwood",
147 "position": 60,
148 "type": "colortertiary",
149 "kittyId": 337860
150 },
151 {
152 "description": "doridnudibranch",
153 "position": 132,
154 "type": "coloreyes",
155 "kittyId": 680079
156 }
157 ],
158 "color": "doridnudibranch",
159 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.svg",
160 "is_exclusive": false,
161 "created_at": "2020-04-23T22:10:56.000Z",
162 "is_special_edition": false,
163 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.png",
164 "name": "Fressbert",
165 "owner_wallet_address": "0x65e10a29e0bf9bfda353ab3d44fe127bf2e09a4b",
166 "id": 1903269,
167 "is_fancy": false,
168 "wrapped": false,
169 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.svg",
170 "status": {
171 "is_ready": true,
172 "cooldown": 1607028977617,
173 "is_gestating": false
174 }
175 }
176 ],
177 "id": 1289657,
178 "is_fancy": false,
179 "wrapped": true,
180 "generation": 13,
181 "owner": {
182 "address": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
183 "hasDapper": false
184 },
185 "genes": "508101394017420297960203117038449397458346282085579186181678174847507224",
186 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg",
187 "is_prestige": false,
188 "is_exclusive": false,
189 "is_special_edition": false,
190 "purrs": {
191 "count": 1,
192 "is_purred": false
193 },
194 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.png",
195 "hatcher": {
196 "image": "5",
197 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
198 "hasDapper": false,
199 "nickname": "Kitten Mittens LLC 10D 10K 10H"
200 },
201 "background_color": "#c5eefa",
202 "name": "Nala",
203 "matron": {
204 "generation": 12,
205 "owner": {
206 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f"
207 },
208 "hatched": true,
209 "enhanced_cattributes": [
210 {
211 "description": "soserious",
212 "position": -1,
213 "type": "mouth",
214 "kittyId": 1289248
215 },
216 {
217 "description": "chronic",
218 "position": 87,
219 "type": "eyes",
220 "kittyId": 468466
221 },
222 {
223 "description": "camo",
224 "position": 1001,
225 "type": "pattern",
226 "kittyId": 680201
227 },
228 {
229 "description": "manul",
230 "position": 36,
231 "type": "body",
232 "kittyId": 803032
233 },
234 {
235 "description": "martian",
236 "position": 72,
237 "type": "colorprimary",
238 "kittyId": 916364
239 },
240 {
241 "description": "butterscotch",
242 "position": 13,
243 "type": "colorsecondary",
244 "kittyId": 750763
245 },
246 {
247 "description": "purplehaze",
248 "position": 28,
249 "type": "colortertiary",
250 "kittyId": 484303
251 },
252 {
253 "description": "topaz",
254 "position": -1,
255 "type": "coloreyes",
256 "kittyId": 1289248
257 }
258 ],
259 "color": "topaz",
260 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.svg",
261 "is_exclusive": false,
262 "created_at": "2018-12-16T05:37:33.000Z",
263 "is_special_edition": false,
264 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.png",
265 "name": "Sergeant Delibinky",
266 "owner_wallet_address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
267 "id": 1289248,
268 "is_fancy": false,
269 "wrapped": false,
270 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.svg",
271 "status": {
272 "is_ready": true,
273 "cooldown": 1521350296999,
274 "is_gestating": false
275 }
276 },
277 "sire": {
278 "generation": 12,
279 "owner": {
280 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f"
281 },
282 "hatched": true,
283 "enhanced_cattributes": [],
284 "color": "topaz",
285 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
286 "is_exclusive": false,
287 "created_at": "2018-12-16T06:15:48.000Z",
288 "is_special_edition": false,
289 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
290 "kitty_type": "fancy",
291 "fancy_type": "Pawrula",
292 "name": "Pawrula The Bright",
293 "owner_wallet_address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
294 "id": 1289336,
295 "is_fancy": true,
296 "wrapped": false,
297 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
298 "status": {
299 "is_ready": true,
300 "cooldown": 1521366384221,
301 "is_gestating": false
302 }
303 },
304 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg",
305 "watchlist": {
306 "count": 0,
307 "is_watchlisted": false
308 },
309 "status": {
310 "is_ready": true,
311 "cooldown_end_block": 9932251,
312 "cooldown": 1571707809089,
313 "dynamic_cooldown": 1595199834562,
314 "cooldown_index": 8,
315 "is_gestating": false
316 }
317 },
318 "tokenUri": {
319 "gateway": "https://api.cryptokitties.co/v3/kitties/1289657",
320 "raw": "https://api.cryptokitties.co/v3/kitties/1289657"
321 },
322 "media": [
323 {
324 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/5bd85609cdacb4214faab3d08e13bd9f",
325 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/5bd85609cdacb4214faab3d08e13bd9f",
326 "raw": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg",
327 "format": "svg+xml",
328 "bytes": 63131
329 }
330 ],
331 "balance": 1
332 }
333 ]

V3 Example Response

json
1[
2 {
3 "contract": {
4 "address": "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d",
5 "name": "CryptoKitties",
6 "symbol": "CK",
7 "totalSupply": "2023232",
8 "tokenType": "ERC721",
9 "contractDeployer": "0xba52c75764d6F594735dc735Be7F1830CDf58dDf",
10 "deployedBlockNumber": 4605167,
11 "openSeaMetadata": {
12 "floorPrice": 0.006,
13 "collectionName": "CryptoKitties",
14 "collectionSlug": "cryptokitties",
15 "safelistRequestStatus": "verified",
16 "imageUrl": "https://i.seadn.io/gae/C272ZRW1RGGef9vKMePFSCeKc1Lw6U40wl9ofNVxzUxFdj84hH9xJRQNf-7wgs7W8qw8RWe-1ybKp-VKuU5D-tg?w=500&auto=format",
17 "description": "CryptoKitties is a game centered around breedable, collectible, and oh-so-adorable creatures we call CryptoKitties! Each cat is one-of-a-kind and 100% owned by you; it cannot be replicated, taken away, or destroyed.",
18 "externalUrl": "https://www.cryptokitties.co/",
19 "twitterUsername": "CryptoKitties",
20 "discordUrl": "https://discord.gg/cryptokitties",
21 "bannerImageUrl": "https://i.seadn.io/gcs/static/banners/cryptokitties-banner2.png?w=500&auto=format",
22 "lastIngestedAt": "2023-09-18T00:29:33.000Z"
23 },
24 "spamClassifications": []
25 },
26 "tokenId": "1289657",
27 "tokenType": "ERC721",
28 "name": "Nala",
29 "tokenUri": "https://api.cryptokitties.co/v3/kitties/1289657",
30 "image": {
31 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/5bd85609cdacb4214faab3d08e13bd9f",
32 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/5bd85609cdacb4214faab3d08e13bd9f",
33 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/5bd85609cdacb4214faab3d08e13bd9f",
34 "contentType": "image/svg+xml",
35 "size": 63131,
36 "originalUrl": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg"
37 },
38 "raw": {
39 "tokenUri": "https://api.cryptokitties.co/v3/kitties/1289657",
40 "metadata": {
41 "birthday": "2018-12-16T00:00:00.000Z",
42 "hatched": true,
43 "enhanced_cattributes": [
44 {
45 "description": "spock",
46 "position": 5850,
47 "type": "pattern",
48 "kittyId": 680104
49 },
50 {
51 "description": "se7",
52 "position": -1,
53 "type": "secret",
54 "kittyId": 1289657
55 }
56 ],
57 "color": "cyan",
58 "created_at": "2018-12-16T08:12:41.000Z",
59 "bio": "En Taro Adun! I'm Nala. I am currently trying to start my own company making berets for tripod kitties. I combine the best qualities of Ryan Gosling, Benjamin Franklin, and Raekwon. I can tell you like to get into trouble.",
60 "language": "en",
61 "auction": {},
62 "offer": {},
63 "children": [
64 {
65 "generation": 14,
66 "owner": {
67 "address": "0x002781a27becd321d831d815e3fa386944b329c8"
68 },
69 "hatched": true,
70 "enhanced_cattributes": [],
71 "color": "cyan",
72 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
73 "is_exclusive": false,
74 "created_at": "2018-12-16T10:31:23.000Z",
75 "is_special_edition": false,
76 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
77 "kitty_type": "fancy",
78 "fancy_type": "Pawrula",
79 "name": "Pawrula The Bright",
80 "owner_wallet_address": "0x002781a27becd321d831d815e3fa386944b329c8",
81 "id": 1290051,
82 "is_fancy": true,
83 "wrapped": true,
84 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1290051.png",
85 "status": {
86 "is_ready": true,
87 "cooldown": 1527648022509,
88 "is_gestating": false
89 }
90 },
91 {
92 "generation": 14,
93 "owner": {
94 "address": "0x65e10a29e0bf9bfda353ab3d44fe127bf2e09a4b"
95 },
96 "hatched": true,
97 "enhanced_cattributes": [
98 {
99 "description": "soserious",
100 "position": -1,
101 "type": "mouth",
102 "kittyId": 1903269
103 },
104 {
105 "description": "doridnudibranch",
106 "position": 132,
107 "type": "coloreyes",
108 "kittyId": 680079
109 }
110 ],
111 "color": "doridnudibranch",
112 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.svg",
113 "is_exclusive": false,
114 "created_at": "2020-04-23T22:10:56.000Z",
115 "is_special_edition": false,
116 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.png",
117 "name": "Fressbert",
118 "owner_wallet_address": "0x65e10a29e0bf9bfda353ab3d44fe127bf2e09a4b",
119 "id": 1903269,
120 "is_fancy": false,
121 "wrapped": false,
122 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1903269.svg",
123 "status": {
124 "is_ready": true,
125 "cooldown": 1607028977617,
126 "is_gestating": false
127 }
128 }
129 ],
130 "id": 1289657,
131 "is_fancy": false,
132 "wrapped": true,
133 "generation": 13,
134 "owner": {
135 "address": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
136 "hasDapper": false
137 },
138 "genes": "508101394017420297960203117038449397458346282085579186181678174847507224",
139 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg",
140 "is_prestige": false,
141 "is_exclusive": false,
142 "is_special_edition": false,
143 "purrs": {
144 "count": 1,
145 "is_purred": false
146 },
147 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.png",
148 "hatcher": {
149 "image": "5",
150 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
151 "hasDapper": false,
152 "nickname": "Kitten Mittens LLC 10D 10K 10H"
153 },
154 "background_color": "#c5eefa",
155 "name": "Nala",
156 "matron": {
157 "generation": 12,
158 "owner": {
159 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f"
160 },
161 "hatched": true,
162 "enhanced_cattributes": [
163 {
164 "description": "soserious",
165 "position": -1,
166 "type": "mouth",
167 "kittyId": 1289248
168 },
169 {
170 "description": "chronic",
171 "position": 87,
172 "type": "eyes",
173 "kittyId": 468466
174 },
175 {
176 "description": "topaz",
177 "position": -1,
178 "type": "coloreyes",
179 "kittyId": 1289248
180 }
181 ],
182 "color": "topaz",
183 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.svg",
184 "is_exclusive": false,
185 "created_at": "2018-12-16T05:37:33.000Z",
186 "is_special_edition": false,
187 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.png",
188 "name": "Sergeant Delibinky",
189 "owner_wallet_address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
190 "id": 1289248,
191 "is_fancy": false,
192 "wrapped": false,
193 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289248.svg",
194 "status": {
195 "is_ready": true,
196 "cooldown": 1521350296999,
197 "is_gestating": false
198 }
199 },
200 "sire": {
201 "generation": 12,
202 "owner": {
203 "address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f"
204 },
205 "hatched": true,
206 "enhanced_cattributes": [],
207 "color": "topaz",
208 "image_url": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
209 "is_exclusive": false,
210 "created_at": "2018-12-16T06:15:48.000Z",
211 "is_special_edition": false,
212 "image_url_png": "https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
213 "kitty_type": "fancy",
214 "fancy_type": "Pawrula",
215 "name": "Pawrula The Bright",
216 "owner_wallet_address": "0x68b42e44079d1d0a4a037e8c6ecd62c48967e69f",
217 "id": 1289336,
218 "is_fancy": true,
219 "wrapped": false,
220 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289336.png",
221 "status": {
222 "is_ready": true,
223 "cooldown": 1521366384221,
224 "is_gestating": false
225 }
226 },
227 "image_url_cdn": "https://img.cn.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/1289657.svg",
228 "watchlist": {
229 "count": 0,
230 "is_watchlisted": false
231 },
232 "status": {
233 "is_ready": true,
234 "cooldown_end_block": 9932251,
235 "cooldown": 1571707809089,
236 "dynamic_cooldown": 1595681023241,
237 "cooldown_index": 8,
238 "is_gestating": false
239 }
240 }
241 },
242 "collection": {
243 "name": "CryptoKitties",
244 "slug": "cryptokitties",
245 "externalUrl": "https://www.cryptokitties.co/",
246 "bannerImageUrl": "https://i.seadn.io/gcs/static/banners/cryptokitties-banner2.png?w=500&auto=format"
247 },
248 "mint": {},
249 "timeLastUpdated": "2023-09-18T19:21:52.169Z",
250 "balance": "1",
251 "acquiredAt": {}
252 },
253 {
254 "contract": {
255 "address": "0xEA67b4DD7BaCAE340Bc4E43652044B5CDED1963c",
256 "name": "Moonkys",
257 "symbol": "MOONK",
258 "totalSupply": "8968",
259 "tokenType": "ERC721",
260 "contractDeployer": "0x94f65107EB422c67E61588682Fcf9D85AaC940B8",
261 "deployedBlockNumber": 14045176,
262 "openSeaMetadata": {
263 "floorPrice": 0.0019,
264 "collectionName": "The MoonkysNFT",
265 "collectionSlug": "the-moonkysnft",
266 "safelistRequestStatus": "approved",
267 "imageUrl": "https://i.seadn.io/gae/HagE-EZ6Wrf5Odw56FjtlSmfFvyEAz5Vg1p76yH-ARh_erNiiWMknrktD7mphF_9QRP_SOzx_Gmm1HrgFv9reHr6eMBxh4FWUg2j5A?w=500&auto=format",
268 "description": "A collection of 9000 Moonkys!\r\nAll different, all endearing, from the jungle to the moon and beyond.",
269 "externalUrl": "https://www.moonkys.art",
270 "twitterUsername": "MoonkysNFT",
271 "discordUrl": "https://discord.gg/8sZyt3SNUY",
272 "bannerImageUrl": "https://i.seadn.io/gae/NwDkjH5GU0DsDmQUUnkHk0i6gQcil-pNMPs9su9r2V_mgsTjgBhbg1YM9450riZYsxTAE9HlbDd0R269vfTDVrCZDkN4S_m5hH-5qQ?w=500&auto=format",
273 "lastIngestedAt": "2023-09-18T05:52:19.000Z"
274 },
275 "spamClassifications": []
276 },
277 "tokenId": "2378",
278 "tokenType": "ERC721",
279 "name": "Moonky #2378",
280 "description": "A collection of 9000 randomly generated Moonkys, living on ETH Blockchain. All different, All endearing.",
281 "tokenUri": "https://ipfs.io/ipfs/QmThsntJV1wZuF3HdvYWG9QkVVSW1WwU5TZrCH36skCe21/2378",
282 "image": {
283 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/a29980483f4257bde13a28906ca87267",
284 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/a29980483f4257bde13a28906ca87267",
285 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/a29980483f4257bde13a28906ca87267",
286 "contentType": "image/png",
287 "size": 233824,
288 "originalUrl": "https://ipfs.io/ipfs/QmRmquSbLpiYRd8nCURUmP2fJ9LbaEtG3tJLGGscFp1WAT"
289 },
290 "raw": {
291 "tokenUri": "https://ipfs.io/ipfs/QmThsntJV1wZuF3HdvYWG9QkVVSW1WwU5TZrCH36skCe21/2378",
292 "metadata": {
293 "name": "Moonky #2378",
294 "description": "A collection of 9000 randomly generated Moonkys, living on ETH Blockchain. All different, All endearing.",
295 "image": "https://ipfs.io/ipfs/QmRmquSbLpiYRd8nCURUmP2fJ9LbaEtG3tJLGGscFp1WAT",
296 "attributes": [
297 {
298 "value": "Orange",
299 "trait_type": "Background"
300 },
301 {
302 "value": "Cobra Kai",
303 "trait_type": "Hat"
304 }
305 ],
306 "external_link": "https://www.moonkys.art"
307 }
308 },
309 "collection": {
310 "name": "The MoonkysNFT",
311 "slug": "the-moonkysnft",
312 "externalUrl": "https://www.moonkys.art",
313 "bannerImageUrl": "https://i.seadn.io/gae/NwDkjH5GU0DsDmQUUnkHk0i6gQcil-pNMPs9su9r2V_mgsTjgBhbg1YM9450riZYsxTAE9HlbDd0R269vfTDVrCZDkN4S_m5hH-5qQ?w=500&auto=format"
314 },
315 "mint": {
316 "mintAddress": "0xffa6c931719cf546df7e48010bde2b0fd0bfc431",
317 "blockNumber": 15108732,
318 "timestamp": "2022-07-09T13:47:51Z",
319 "transactionHash": "0xce02924d42c0d6f1e5144bbfea8a49fc4fb0330a42782ac8c7c00b7d10b8a4c4"
320 },
321 "timeLastUpdated": "2023-08-01T07:40:39.116Z",
322 "balance": "1",
323 "acquiredAt": {}
324 }
325]

getNftsForContractIterator -SDK

Fetches all NFTs for a given contract address and yields them in an async iterable.

This method returns the full NFTs in the contract and pages through all page keys until all NFTs have been fetched.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in V3.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri, error, and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters for spamInfo in V2 have been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address whose NFTs you want to fetch
15 const contractAddress = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
16
17 // create an async generator function that uses the getNftsForContractIterator method
18 async function getNftsForContract() {
19 try {
20 let nfts = [];
21 // Get the async iterable for the contract's NFTs.
22 const nftsIterable = alchemy.nft.getNftsForContractIterator(contractAddress);
23
24 // Iterate over the NFTs and add them to the nfts array.
25 for await (const nft of nftsIterable) {
26 nfts.push(nft);
27 }
28
29 // Log the NFTs.
30 console.log(nfts);
31 } catch (error) {
32 console.log(error);
33 }
34 }
35
36 // call the async generator function
37 getNftsForContract();
38
39};
40
41main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
rawMetadata.errorraw.error
-raw.tokenUri
mediaimage
-collection (New in V3)
-mint(New in V3)
timeLastUpdatedtimeLastUpdated
-acquiredAt

Example Responses

V2 Example Response

json
1[
2 {
3 "contract": {
4 "address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
5 "name": "BoredApeYachtClub",
6 "symbol": "BAYC",
7 "totalSupply": "10000",
8 "tokenType": "ERC721",
9 "openSea": {
10 "floorPrice": 33.92,
11 "collectionName": "Bored Ape Yacht Club",
12 "safelistRequestStatus": "verified",
13 "imageUrl": "https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format",
14 "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
15 "externalUrl": "http://www.boredapeyachtclub.com/",
16 "twitterUsername": "BoredApeYC",
17 "discordUrl": "https://discord.gg/3P5K3dzgdB",
18 "lastIngestedAt": "2023-07-21T02:53:34.000Z"
19 },
20 "contractDeployer": "0xaba7161a7fb69c88e16ed9f455ce62b791ee4d03",
21 "deployedBlockNumber": 12287507
22 },
23 "tokenId": "0",
24 "tokenType": "ERC721",
25 "title": "",
26 "description": "",
27 "timeLastUpdated": "2023-07-20T00:59:03.382Z",
28 "rawMetadata": {
29 "image": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ",
30 "attributes": [
31 {
32 "value": "Silver Hoop",
33 "trait_type": "Earring"
34 },
35 {
36 "value": "X Eyes",
37 "trait_type": "Eyes"
38 }
39 ]
40 },
41 "tokenUri": {
42 "gateway": "https://alchemy.mypinata.cloud/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0",
43 "raw": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0"
44 },
45 "media": [
46 {
47 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/415d618f5fef7bfe683e02d4653c4289",
48 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/415d618f5fef7bfe683e02d4653c4289",
49 "raw": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ",
50 "format": "png",
51 "bytes": 133270
52 }
53 ]
54 },
55 {
56 "contract": {
57 "address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
58 "name": "BoredApeYachtClub",
59 "symbol": "BAYC",
60 "totalSupply": "10000",
61 "tokenType": "ERC721",
62 "openSea": {
63 "floorPrice": 33.92,
64 "collectionName": "Bored Ape Yacht Club",
65 "safelistRequestStatus": "verified",
66 "imageUrl": "https://i.seadn.io/gae/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB?w=500&auto=format",
67 "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
68 "externalUrl": "http://www.boredapeyachtclub.com/",
69 "twitterUsername": "BoredApeYC",
70 "discordUrl": "https://discord.gg/3P5K3dzgdB",
71 "lastIngestedAt": "2023-07-21T02:53:34.000Z"
72 },
73 "contractDeployer": "0xaba7161a7fb69c88e16ed9f455ce62b791ee4d03",
74 "deployedBlockNumber": 12287507
75 },
76 "tokenId": "9999",
77 "tokenType": "ERC721",
78 "title": "",
79 "description": "",
80 "timeLastUpdated": "2023-07-18T12:25:10.309Z",
81 "rawMetadata": {
82 "image": "ipfs://QmejYePrutbfWEV8wA3ogTHi2cf2j6hoaPhZSc6vNE43nH",
83 "attributes": [
84 {
85 "value": "Army Hat",
86 "trait_type": "Hat"
87 },
88 {
89 "value": "Scumbag",
90 "trait_type": "Eyes"
91 }
92 ]
93 },
94 "tokenUri": {
95 "gateway": "https://ipfs.io/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/9999",
96 "raw": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/9999"
97 },
98 "media": [
99 {
100 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/4b5307d8d2a9d044b659f4eecf3e018e",
101 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/4b5307d8d2a9d044b659f4eecf3e018e",
102 "raw": "ipfs://QmejYePrutbfWEV8wA3ogTHi2cf2j6hoaPhZSc6vNE43nH",
103 "format": "png",
104 "bytes": 135967
105 }
106 ]
107 }
108]

V3 Example Response

json
1[
2 {
3 "contract": {
4 "address": "0xe785E82358879F061BC3dcAC6f0444462D4b5330",
5 "name": "World Of Women",
6 "symbol": "WOW",
7 "totalSupply": "10000",
8 "tokenType": "ERC721",
9 "contractDeployer": "0xc9b6321dc216D91E626E9BAA61b06B0E4d55bdb1",
10 "deployedBlockNumber": 12907782,
11 "openSeaMetadata": {
12 "floorPrice": 0.6021,
13 "collectionName": "World of Women",
14 "collectionSlug": "world-of-women-nft",
15 "safelistRequestStatus": "verified",
16 "imageUrl": "https://i.seadn.io/gcs/files/8604de2d9aaec98dd389e3af1b1a14b6.gif?w=500&auto=format",
17 "description": "World of Women is a collection of 10,000 NFTs that gives you full access to our network of artists, creators, entrepreneurs, and executives who are championing diversity and equal opportunity on the blockchain.\n\nCreated and illustrated by Yam Karkai (@ykarkai), World of Women has made prominent appearances at Christie's, The New Yorker and Billboard.\n\nJoin us to receive exclusive access to NFT drops, experiences, and much more.\n\nThe Time is WoW.",
18 "externalUrl": "http://worldofwomen.art",
19 "twitterUsername": "worldofwomennft",
20 "discordUrl": "https://discord.gg/worldofwomen",
21 "bannerImageUrl": "https://i.seadn.io/gae/GHhptRLebBOWOy8kfXpYCVqsqdes-1-6I_jbuRnGTHHW6TD63CtciH75Dotfu2u8v6EmkWt-tjhkFRVLxRUwgMfKqqy5W24AolJayeo?w=500&auto=format",
22 "lastIngestedAt": "2023-09-18T12:28:27.000Z"
23 },
24 "spamClassifications": []
25 },
26 "tokenId": "44",
27 "tokenType": "ERC721",
28 "name": "WoW #44",
29 "tokenUri": "https://alchemy.mypinata.cloud/ipfs/QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44",
30 "image": {
31 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
32 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
33 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/9316855d8f60a32cd44aa71f07cd7dc1",
34 "contentType": "image/png",
35 "size": 105117,
36 "originalUrl": "https://ipfs.io/ipfs/QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi"
37 },
38 "raw": {
39 "tokenUri": "ipfs://QmTNBQDbggLZdKF1fRgWnXsnRikd52zL5ciNu769g9JoUP/44",
40 "metadata": {
41 "name": "WoW #44",
42 "image": "ipfs://QmUkdJKCsV8ixm2eDLJGosH8Bntwwx942YXxfuF9yXPBzi",
43 "attributes": [
44 {
45 "value": "Green Orange",
46 "trait_type": "Background"
47 },
48 {
49 "value": "Purple",
50 "trait_type": "Lips Color"
51 }
52 ]
53 }
54 },
55 "collection": {
56 "name": "World of Women",
57 "slug": "world-of-women-nft",
58 "externalUrl": "http://worldofwomen.art",
59 "bannerImageUrl": "https://i.seadn.io/gae/GHhptRLebBOWOy8kfXpYCVqsqdes-1-6I_jbuRnGTHHW6TD63CtciH75Dotfu2u8v6EmkWt-tjhkFRVLxRUwgMfKqqy5W24AolJayeo?w=500&auto=format"
60 },
61 "mint": {},
62 "timeLastUpdated": "2023-09-18T13:25:41.833Z"
63 }
64]

getContractMetadata - SDK

Get the NFT collection metadata associated with the provided parameters.

Overview of Changes

  • The openSea object in the response structure has been renamed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl have been added to the openSeaMetadata object in the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the address whose contract metadata you want to fetch
15 const address = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";
16
17 //Call the method to fetch metadata
18 const response = await alchemy.nft.getContractMetadata(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
addressaddress
namename
symbolsymbol
totalSupplytotalSupply
tokenTypetokenType
openSea.floorPriceopenSeaMetadata.floorPrice
openSea.collectionNameopenSeaMetadata.collectionName
-openSeaMetadata.collectionSlug(New in V3)
openSea.safelistRequestStatusopenSeaMetadata.safelistRequestStatus
openSea.imageUrlopenSeaMetadata.imageUrl
openSea.descriptionopenSeaMetadata.description
openSea.externalUrlopenSeaMetadata.externalUrl
openSea.twitterUsernameopenSeaMetadata.twitterUsername
openSea.discordUrlopenSeaMetadata.discordUrl
-openSeaMetadata.bannerImageUrl(New in V3)
openSea.lastIngestedAtopenSeaMetadata.lastIngestedAt
contractDeployercontractDeployer
deployedBlockNumberdeployedBlockNumber

Example Responses

V2 Example Response

json
1{
2 "address": "0x61fce80d72363b731425c3a2a46a1a5fed9814b2",
3 "name": "CyborgMercenariesCm",
4 "symbol": "CYBORG",
5 "totalSupply": "8039",
6 "tokenType": "ERC1155",
7 "openSea": {
8 "floorPrice": 0.001,
9 "collectionName": "Undead Warriors",
10 "safelistRequestStatus": "verified",
11 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
12 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Freedom | https://opensea.io/Xc4libur\nUndead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.\n\n",
13 "externalUrl": "http://undeadwarriors.io",
14 "twitterUsername": "undead_warriors",
15 "discordUrl": "https://discord.gg/qjZbJMPS86",
16 "lastIngestedAt": "2023-07-21T11:02:08.000Z"
17 },
18 "contractDeployer": "0xd32bb311467060cec58cd6e9b37134ca6d81377f",
19 "deployedBlockNumber": 13950908
20}

V3 Example Response

json
1{
2 "address": "0x61fcE80D72363B731425c3A2A46a1A5fed9814B2",
3 "name": "CyborgMercenariesCm",
4 "symbol": "CYBORG",
5 "totalSupply": "8039",
6 "tokenType": "ERC1155",
7 "contractDeployer": "0xd32bB311467060ceC58Cd6e9b37134CA6d81377F",
8 "deployedBlockNumber": 13950908,
9 "openSeaMetadata": {
10 "floorPrice": 0.001,
11 "collectionName": "Undead Warriors",
12 "collectionSlug": "undeadwarriors",
13 "safelistRequestStatus": "verified",
14 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
15 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Freedom | https://opensea.io/Xc4libur\nUndead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.\n\n",
16 "externalUrl": "http://undeadwarriors.io",
17 "twitterUsername": "undead_warriors",
18 "discordUrl": "https://discord.gg/qjZbJMPS86",
19 "bannerImageUrl": "https://i.seadn.io/gcs/files/bbb358656434031a1b9c27873a72b13e.png?w=500&auto=format",
20 "lastIngestedAt": "2023-09-17T10:13:28.000Z"
21 }
22}

getNftsForContract - SDK

Get all NFTs for a given contract address.

This method returns the full NFTs in the contract. To get all NFTs without their associated metadata, use the options parameter.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri, metadata, and error parameters.
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters for spamInfo in V2 has been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address whose NFTs you want to fetch
15 const address = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";
16
17 //Call the method to fetch metadata
18 const response = await alchemy.nft.getNftsForContract(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.tokenTypecontract.tokenType
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug (New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
-contract.openSeaMetadata.bannerImageUrl (New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
tokenIdtokenId
tokenTypetokenType
tokenUritokenUri
titlename
descriptiondescription
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.attributesraw.metadata.attributes
rawMetadata.errorraw.error
-raw.tokenUri
mediaimage
-collection (New in V3)
-mint(New in V3)
timeLastUpdatedtimeLastUpdated
-acquiredAt
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x61fce80d72363b731425c3a2a46a1a5fed9814b2",
6 "name": "CyborgMercenariesCm",
7 "symbol": "CYBORG",
8 "totalSupply": "8039",
9 "tokenType": "ERC1155",
10 "openSea": {
11 "floorPrice": 0.001,
12 "collectionName": "Undead Warriors",
13 "safelistRequestStatus": "verified",
14 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
15 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Freedom | https://opensea.io/Xc4libur\nUndead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.\n\n",
16 "externalUrl": "http://undeadwarriors.io",
17 "twitterUsername": "undead_warriors",
18 "discordUrl": "https://discord.gg/qjZbJMPS86",
19 "lastIngestedAt": "2023-07-21T11:02:08.000Z"
20 },
21 "contractDeployer": "0xd32bb311467060cec58cd6e9b37134ca6d81377f",
22 "deployedBlockNumber": 13950908
23 },
24 "tokenId": "0",
25 "tokenType": "ERC1155",
26 "title": "Undead Warrior #0",
27 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
28 "timeLastUpdated": "2023-07-12T06:28:38.764Z",
29 "rawMetadata": {
30 "date": 1659652582322,
31 "image": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/0.png",
32 "website": "https://undeadwarriors.io",
33 "dna": "d297klq0913j20c9l51nw51m2h68hgvfa539ut10",
34 "name": "Undead Warrior #0",
35 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
36 "edition": 0,
37 "attributes": [
38 {
39 "value": "PastHistory",
40 "trait_type": "Background"
41 },
42 {
43 "value": "Security",
44 "trait_type": "Rank"
45 }
46 ],
47 "compiler": "Black Badge: V.01A"
48 },
49 "tokenUri": {
50 "gateway": "https://ipfs.io/ipfs/QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/0",
51 "raw": "ipfs://QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/0"
52 },
53 "media": [
54 {
55 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/a31b9e2703540f70e3c15478d449162b",
56 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/a31b9e2703540f70e3c15478d449162b",
57 "raw": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/0.png",
58 "format": "png",
59 "bytes": 1458749
60 }
61 ]
62 },
63 {
64 "contract": {
65 "address": "0x61fce80d72363b731425c3a2a46a1a5fed9814b2",
66 "name": "CyborgMercenariesCm",
67 "symbol": "CYBORG",
68 "totalSupply": "8039",
69 "tokenType": "ERC1155",
70 "openSea": {
71 "floorPrice": 0.001,
72 "collectionName": "Undead Warriors",
73 "safelistRequestStatus": "verified",
74 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
75 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Fr,\n\n",
76 "externalUrl": "http://undeadwarriors.io",
77 "twitterUsername": "undead_warriors",
78 "discordUrl": "https://discord.gg/qjZbJMPS86",
79 "lastIngestedAt": "2023-07-21T11:02:08.000Z"
80 },
81 "contractDeployer": "0xd32bb311467060cec58cd6e9b37134ca6d81377f",
82 "deployedBlockNumber": 13950908
83 },
84 "tokenId": "353",
85 "tokenType": "ERC1155",
86 "title": "Undead Warrior #353",
87 "description": "Undead Warriors in the E-Gaming and Web 3 space.",
88 "timeLastUpdated": "2023-07-12T06:32:38.722Z",
89 "rawMetadata": {
90 "date": 1659653043027,
91 "image": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/353.png",
92 "website": "https://undeadwarriors.io",
93 "dna": "aa09f30b73d7fa23c636ff2734f9e7b48d2ce1b1",
94 "name": "Undead Warrior #353",
95 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
96 "edition": 353,
97 "attributes": [
98 {
99 "value": "LaunchBay",
100 "trait_type": "Background"
101 },
102 {
103 "value": "Warrior",
104 "trait_type": "Rank"
105 }
106 ],
107 "compiler": "Black Badge: V.01A"
108 },
109 "tokenUri": {
110 "gateway": "https://ipfs.io/ipfs/QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/353",
111 "raw": "ipfs://QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/353"
112 },
113 "media": [
114 {
115 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/f72c8a8a4aa69dc8ac340a619289451f",
116 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/f72c8a8a4aa69dc8ac340a619289451f",
117 "raw": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/353.png",
118 "format": "png",
119 "bytes": 1645083
120 }
121 ]
122 }
123 ],
124 "pageKey": "0x0162"
125}

V3 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x61fcE80D72363B731425c3A2A46a1A5fed9814B2",
6 "name": "CyborgMercenariesCm",
7 "symbol": "CYBORG",
8 "totalSupply": "8039",
9 "tokenType": "ERC1155",
10 "contractDeployer": "0xd32bB311467060ceC58Cd6e9b37134CA6d81377F",
11 "deployedBlockNumber": 13950908,
12 "openSeaMetadata": {
13 "floorPrice": 0.001,
14 "collectionName": "Undead Warriors",
15 "collectionSlug": "undeadwarriors",
16 "safelistRequestStatus": "verified",
17 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
18 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Freedom | https://opensea.io/Xc4libur\nUndead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.\n\n",
19 "externalUrl": "http://undeadwarriors.io",
20 "twitterUsername": "undead_warriors",
21 "discordUrl": "https://discord.gg/qjZbJMPS86",
22 "bannerImageUrl": "https://i.seadn.io/gcs/files/bbb358656434031a1b9c27873a72b13e.png?w=500&auto=format",
23 "lastIngestedAt": "2023-09-17T10:13:28.000Z"
24 },
25 "spamClassifications": []
26 },
27 "tokenId": "0",
28 "tokenType": "ERC1155",
29 "name": "Undead Warrior #0",
30 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
31 "tokenUri": "https://ipfs.io/ipfs/QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/0",
32 "image": {
33 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/a31b9e2703540f70e3c15478d449162b",
34 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/a31b9e2703540f70e3c15478d449162b",
35 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/a31b9e2703540f70e3c15478d449162b",
36 "contentType": "image/png",
37 "size": 1458749,
38 "originalUrl": "https://ipfs.io/ipfs/QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/0.png"
39 },
40 "raw": {
41 "tokenUri": "ipfs://QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/0",
42 "metadata": {
43 "date": 1659652582322,
44 "image": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/0.png",
45 "website": "https://undeadwarriors.io",
46 "dna": "d297klq0913j20c9l51nw51m2h68hgvfa539ut10",
47 "name": "Undead Warrior #0",
48 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
49 "edition": 0,
50 "attributes": [
51 {
52 "value": "PastHistory",
53 "trait_type": "Background"
54 },
55 {
56 "value": "Security",
57 "trait_type": "Rank"
58 }
59 ],
60 "compiler": "Black Badge: V.01A"
61 }
62 },
63 "collection": {
64 "name": "Undead Warriors",
65 "slug": "undeadwarriors",
66 "externalUrl": "http://undeadwarriors.io",
67 "bannerImageUrl": "https://i.seadn.io/gcs/files/bbb358656434031a1b9c27873a72b13e.png?w=500&auto=format"
68 },
69 "mint": {},
70 "timeLastUpdated": "2023-09-17T09:58:57.133Z"
71 },
72 {
73 "contract": {
74 "address": "0x61fcE80D72363B731425c3A2A46a1A5fed9814B2",
75 "name": "CyborgMercenariesCm",
76 "symbol": "CYBORG",
77 "totalSupply": "8039",
78 "tokenType": "ERC1155",
79 "contractDeployer": "0xd32bB311467060ceC58Cd6e9b37134CA6d81377F",
80 "deployedBlockNumber": 13950908,
81 "openSeaMetadata": {
82 "floorPrice": 0.001,
83 "collectionName": "Undead Warriors",
84 "collectionSlug": "undeadwarriors",
85 "safelistRequestStatus": "verified",
86 "imageUrl": "https://i.seadn.io/gcs/files/6cd7bec4ad4b280adb53c33c815bd3dc.png?w=500&auto=format",
87 "description": "Core Team\nhttps://opensea.io/theseansneed | https://opensea.io/W3-Freedom | https://opensea.io/Xc4libur\nUndead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.\n\n",
88 "externalUrl": "http://undeadwarriors.io",
89 "twitterUsername": "undead_warriors",
90 "discordUrl": "https://discord.gg/qjZbJMPS86",
91 "bannerImageUrl": "https://i.seadn.io/gcs/files/bbb358656434031a1b9c27873a72b13e.png?w=500&auto=format",
92 "lastIngestedAt": "2023-09-17T10:13:28.000Z"
93 },
94 "spamClassifications": []
95 },
96 "tokenId": "353",
97 "tokenType": "ERC1155",
98 "name": "Undead Warrior #353",
99 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
100 "tokenUri": "https://ipfs.io/ipfs/QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/353",
101 "image": {
102 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/f72c8a8a4aa69dc8ac340a619289451f",
103 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/f72c8a8a4aa69dc8ac340a619289451f",
104 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/f72c8a8a4aa69dc8ac340a619289451f",
105 "contentType": "image/png",
106 "size": 1645083,
107 "originalUrl": "https://ipfs.io/ipfs/QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/353.png"
108 },
109 "raw": {
110 "tokenUri": "ipfs://QmSodrnHXf2sd3Cd61tzNdn7MpaHqe116KvGx2NS8Qzg1i/353",
111 "metadata": {
112 "date": 1659653043027,
113 "image": "ipfs://QmeNdyrTRGyVr6YvXPZHy1DPtwq3V8zZGzkzU145r5xcqa/353.png",
114 "website": "https://undeadwarriors.io",
115 "dna": "aa09f30b73d7fa23c636ff2734f9e7b48d2ce1b1",
116 "name": "Undead Warrior #353",
117 "description": "Undead Warriors are a collection of NFTs powered by the Undead Coin (UDC) battling the most difficult challenges in the E-Gaming and Web 3 space.",
118 "edition": 353,
119 "attributes": [
120 {
121 "value": "LaunchBay",
122 "trait_type": "Background"
123 },
124 {
125 "value": "Warrior",
126 "trait_type": "Rank"
127 }
128 ],
129 "compiler": "Black Badge: V.01A"
130 }
131 },
132 "collection": {
133 "name": "Undead Warriors",
134 "slug": "undeadwarriors",
135 "externalUrl": "http://undeadwarriors.io",
136 "bannerImageUrl": "https://i.seadn.io/gcs/files/bbb358656434031a1b9c27873a72b13e.png?w=500&auto=format"
137 },
138 "mint": {},
139 "timeLastUpdated": "2023-09-21T12:33:14.542Z"
140 }
141 ],
142 "pageKey": "0x0162"
143}

getTransfersForOwner - SDK

The getTransfersForOwner method gets all NFT transfers for a given owner address.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri, error, and metadata parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters for spamInfo in V2 has been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "demo", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13// Example of using the new getTransfersForOwner method
14const main = async () => {
15 // The owner address to get transfers for
16 let address = "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8";
17
18 // Whether to get transfers TO or FROM the owner address. (Optional)
19 let category = "FROM";
20
21 // Additional options for the request. (Optional)
22 let options = {
23 /**
24 * List of NFT contract addresses to filter mints by. If omitted, defaults to
25 * all contract addresses.
26 */
27 contractAddresses: ["0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734"],
28 /**
29 * Filter mints by ERC721 vs ERC1155 contracts. If omitted, defaults to all
30 * NFTs.
31 */
32 tokenType: "ERC721",
33 };
34
35 // Calling the getTransfersForOwner method
36 let transfers = await alchemy.nft.getTransfersForOwner(
37 address,
38 category,
39 options
40 );
41
42 // Logging the response to the console
43 console.log(transfers);
44};
45
46main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.totalSupplycontract.totalSupply
contract.tokenTypecontract.tokenType
contract.openSea.floorPricecontract.openSeaMetadata.floorPrice
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug(New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
contract.openSea.twitterUsernamecontract.openSeaMetadata.twitterUsername
contract.openSea.discordUrlcontract.openSeaMetadata.discordUrl
-contract.openSeaMetadata.bannerImageUrl(New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
tokenIdtokenId
tokenTypetokenType
titlename
descriptiondescription
timeLastUpdatedtimeLastUpdated
rawMetadataraw
rawMetadata.attributesraw.metadata.attributes
rawMetadata.tokenUriraw.tokenUri
rawMetadata.errorraw.error
tokenUritokenUri
mediaimage
fromfrom
toto
transactionHashtransactionHash
blockNumberblockNumber
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x1f02bf9dde7c79137a08b2dd4fc964bfd2499734",
6 "name": "Elephants",
7 "symbol": "ELENFT",
8 "totalSupply": "7778",
9 "tokenType": "ERC721",
10 "openSea": {
11 "floorPrice": 0.0031,
12 "collectionName": "3L3Phants Official",
13 "safelistRequestStatus": "verified",
14 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
15 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
16 "externalUrl": "http://3l3phants.io",
17 "twitterUsername": "3L3NFT",
18 "discordUrl": "https://discord.gg/3L3phantsnft",
19 "lastIngestedAt": "2023-07-12T23:25:34.000Z"
20 },
21 "contractDeployer": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
22 "deployedBlockNumber": 15140845
23 },
24 "tokenId": "890",
25 "tokenType": "ERC721",
26 "title": "3L3PHANTS #890",
27 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
28 "timeLastUpdated": "2023-07-15T10:06:39.607Z",
29 "rawMetadata": {
30 "name": "3L3PHANTS #890",
31 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
32 "image": "ipfs://QmTvmGSL6cFxRyoam2vBRgVL8vjcLrzdum14K9qMQ7MP2b",
33 "attributes": [
34 {
35 "value": "Red",
36 "trait_type": "Background"
37 },
38 {
39 "value": "Tie Dye",
40 "trait_type": "Outfit"
41 },
42 {
43 "value": "Double",
44 "trait_type": "Tusks"
45 }
46 ]
47 },
48 "tokenUri": {
49 "gateway": "https://ipfs.io/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/890",
50 "raw": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/890"
51 },
52 "media": [
53 {
54 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/121fdb0563b1917179c9ad7d97ae081f",
55 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/121fdb0563b1917179c9ad7d97ae081f",
56 "raw": "ipfs://QmTvmGSL6cFxRyoam2vBRgVL8vjcLrzdum14K9qMQ7MP2b",
57 "format": "png",
58 "bytes": 199542
59 }
60 ],
61 "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
62 "to": "0x84561625814e1c7e882c1ae20a9d722a8c301f04",
63 "transactionHash": "0x43ff4418ca88d94857f3b687e8ac7450e107c2a36517e8d59a5308dba4acec94",
64 "blockNumber": "0xec8125"
65 },
66 {
67 "contract": {
68 "address": "0x1f02bf9dde7c79137a08b2dd4fc964bfd2499734",
69 "name": "Elephants",
70 "symbol": "ELENFT",
71 "totalSupply": "7778",
72 "tokenType": "ERC721",
73 "openSea": {
74 "floorPrice": 0.0031,
75 "collectionName": "3L3Phants Official",
76 "safelistRequestStatus": "verified",
77 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
78 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
79 "externalUrl": "http://3l3phants.io",
80 "twitterUsername": "3L3NFT",
81 "discordUrl": "https://discord.gg/3L3phantsnft",
82 "lastIngestedAt": "2023-07-12T23:25:34.000Z"
83 },
84 "contractDeployer": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
85 "deployedBlockNumber": 15140845
86 },
87 "tokenId": "3990",
88 "tokenType": "ERC721",
89 "title": "3L3PHANTS #3990",
90 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
91 "timeLastUpdated": "2023-02-28T17:51:29.181Z",
92 "rawMetadata": {
93 "name": "3L3PHANTS #3990",
94 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
95 "image": "ipfs://QmaL3UbrR8T1tz7j8SuYmQxkQJoPXYZeU49YC5DCHphKDg",
96 "attributes": [
97 {
98 "value": "Pink Checkerboard",
99 "trait_type": "Background"
100 },
101 {
102 "value": "Nubs",
103 "trait_type": "Tusks"
104 }
105 ]
106 },
107 "tokenUri": {
108 "gateway": "https://alchemy.mypinata.cloud/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/3990",
109 "raw": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/3990"
110 },
111 "media": [
112 {
113 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/8e8706cbd7f6f2b46576dd386410b805",
114 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/8e8706cbd7f6f2b46576dd386410b805",
115 "raw": "ipfs://QmaL3UbrR8T1tz7j8SuYmQxkQJoPXYZeU49YC5DCHphKDg",
116 "format": "png",
117 "bytes": 198447
118 }
119 ],
120 "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
121 "to": "0x6a3623db71c1b3442a94e3fd4655334b48114693",
122 "transactionHash": "0x13f33287ac95893e06cda2cd30c08003808ac46867382d8c92e1c864e4895ec6",
123 "blockNumber": "0xec8131"
124 }
125 ]
126}

V3 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734",
6 "name": "Elephants",
7 "symbol": "ELENFT",
8 "totalSupply": "7778",
9 "tokenType": "ERC721",
10 "contractDeployer": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
11 "deployedBlockNumber": 15140845,
12 "openSeaMetadata": {
13 "floorPrice": 0.0032,
14 "collectionName": "3L3Phants Official",
15 "collectionSlug": "3l3phants-official",
16 "safelistRequestStatus": "verified",
17 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
18 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
19 "externalUrl": "http://3l3phants.io",
20 "twitterUsername": "3L3NFT",
21 "discordUrl": "https://discord.gg/3L3phantsnft",
22 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format",
23 "lastIngestedAt": "2023-09-19T22:06:03.000Z"
24 },
25 "spamClassifications": []
26 },
27 "tokenId": "890",
28 "tokenType": "ERC721",
29 "name": "3L3PHANTS #890",
30 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
31 "tokenUri": "https://ipfs.io/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/890",
32 "image": {
33 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/121fdb0563b1917179c9ad7d97ae081f",
34 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/121fdb0563b1917179c9ad7d97ae081f",
35 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/121fdb0563b1917179c9ad7d97ae081f",
36 "contentType": "image/png",
37 "size": 199542,
38 "originalUrl": "https://ipfs.io/ipfs/QmTvmGSL6cFxRyoam2vBRgVL8vjcLrzdum14K9qMQ7MP2b"
39 },
40 "raw": {
41 "tokenUri": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/890",
42 "metadata": {
43 "name": "3L3PHANTS #890",
44 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
45 "image": "ipfs://QmTvmGSL6cFxRyoam2vBRgVL8vjcLrzdum14K9qMQ7MP2b",
46 "attributes": [
47 {
48 "value": "Red",
49 "trait_type": "Background"
50 },
51 {
52 "value": "Double",
53 "trait_type": "Tusks"
54 }
55 ]
56 }
57 },
58 "collection": {
59 "name": "3L3Phants Official",
60 "slug": "3l3phants-official",
61 "externalUrl": "http://3l3phants.io",
62 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format"
63 },
64 "mint": {
65 "mintAddress": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
66 "blockNumber": 15143441,
67 "timestamp": "2022-07-14T22:17:44Z",
68 "transactionHash": "0x317dfdacec0ae4cbe0a1f7ee394f9cc7c6d4ae9985a5202fcfef28b3a19ce899"
69 },
70 "timeLastUpdated": "2023-08-13T03:40:39.232Z",
71 "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
72 "to": "0x84561625814e1c7e882c1ae20a9d722a8c301f04",
73 "transactionHash": "0x43ff4418ca88d94857f3b687e8ac7450e107c2a36517e8d59a5308dba4acec94",
74 "blockNumber": "0xec8125"
75 },
76 {
77 "contract": {
78 "address": "0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734",
79 "name": "Elephants",
80 "symbol": "ELENFT",
81 "totalSupply": "7778",
82 "tokenType": "ERC721",
83 "contractDeployer": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
84 "deployedBlockNumber": 15140845,
85 "openSeaMetadata": {
86 "floorPrice": 0.0032,
87 "collectionName": "3L3Phants Official",
88 "collectionSlug": "3l3phants-official",
89 "safelistRequestStatus": "verified",
90 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
91 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
92 "externalUrl": "http://3l3phants.io",
93 "twitterUsername": "3L3NFT",
94 "discordUrl": "https://discord.gg/3L3phantsnft",
95 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format",
96 "lastIngestedAt": "2023-09-19T22:06:03.000Z"
97 },
98 "spamClassifications": []
99 },
100 "tokenId": "3990",
101 "tokenType": "ERC721",
102 "name": "3L3PHANTS #3990",
103 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
104 "tokenUri": "https://alchemy.mypinata.cloud/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/3990",
105 "image": {
106 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/8e8706cbd7f6f2b46576dd386410b805",
107 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/8e8706cbd7f6f2b46576dd386410b805",
108 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/8e8706cbd7f6f2b46576dd386410b805",
109 "contentType": "image/png",
110 "size": 198447,
111 "originalUrl": "https://ipfs.io/ipfs/QmaL3UbrR8T1tz7j8SuYmQxkQJoPXYZeU49YC5DCHphKDg"
112 },
113 "raw": {
114 "tokenUri": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/3990",
115 "metadata": {
116 "name": "3L3PHANTS #3990",
117 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
118 "image": "ipfs://QmaL3UbrR8T1tz7j8SuYmQxkQJoPXYZeU49YC5DCHphKDg",
119 "attributes": [
120 {
121 "value": "Pink Checkerboard",
122 "trait_type": "Background"
123 },
124 {
125 "value": "Nubs",
126 "trait_type": "Tusks"
127 }
128 ]
129 }
130 },
131 "collection": {
132 "name": "3L3Phants Official",
133 "slug": "3l3phants-official",
134 "externalUrl": "http://3l3phants.io",
135 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format"
136 },
137 "mint": {
138 "mintAddress": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
139 "blockNumber": 15214264,
140 "timestamp": "2022-07-25T22:02:43Z",
141 "transactionHash": "0x343e4697e0e834acb61c23268a63ddddb29e29ce6bcaf652b08430f7c0fdc934"
142 },
143 "timeLastUpdated": "2023-02-28T17:51:29.181Z",
144 "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
145 "to": "0x6a3623db71c1b3442a94e3fd4655334b48114693",
146 "transactionHash": "0x13f33287ac95893e06cda2cd30c08003808ac46867382d8c92e1c864e4895ec6",
147 "blockNumber": "0xec8131"
148 }
149 ]
150}

getTransfersForContract - SDK

The getTransfersForContract method gets all NFT transfers for a given NFT contract address.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri, metadata, and error parameters.
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters for spamInfo in V2 has been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "demo", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13// Example of using the new getTransfersForContract method
14const main = async () => {
15 // The nft contract address to get transfers for
16 let contractAddress = "0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734";
17
18 // Additional options for the request. (Optional)
19 let options = {
20 /** Starting block (inclusive) to get transfers from. */
21 fromBlock: 16564734,
22 /** Ending block (inclusive) to get transfers from. */
23 toBlock: 16567427,
24 /**
25 * Whether to return results in ascending or descending order by block number.
26 * Defaults to ascending if omitted.
27 */
28 order: "desc",
29 };
30
31 // Calling the getTransfersForContract method
32 let transfers = await alchemy.nft.getTransfersForContract(
33 contractAddress,
34 options
35 );
36
37 // Logging the response to the console
38 console.log(transfers);
39};
40
41main();

V3 Example Request

javascript
1// Same with V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.totalSupplycontract.totalSupply
contract.tokenTypecontract.tokenType
contract.openSea.floorPricecontract.openSeaMetadata.floorPrice
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug(New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
contract.openSea.twitterUsernamecontract.openSeaMetadata.twitterUsername
contract.openSea.discordUrlcontract.openSeaMetadata.discordUrl
-contract.openSeaMetadata.bannerImageUrl(New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
tokenIdtokenId
tokenTypetokenType
titlename
descriptiondescription
timeLastUpdatedtimeLastUpdated
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.tokenUriraw.tokenUri
rawMetadata.errorraw.error
rawMetadata.attributesraw.metadata.attributes
tokenUritokenUri
mediaimage
fromfrom
toto
transactionHashtransactionHash
blockNumberblockNumber
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x1f02bf9dde7c79137a08b2dd4fc964bfd2499734",
6 "name": "Elephants",
7 "symbol": "ELENFT",
8 "totalSupply": "7778",
9 "tokenType": "ERC721",
10 "openSea": {
11 "floorPrice": 0.0031,
12 "collectionName": "3L3Phants Official",
13 "safelistRequestStatus": "verified",
14 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
15 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
16 "externalUrl": "http://3l3phants.io",
17 "twitterUsername": "3L3NFT",
18 "discordUrl": "https://discord.gg/3L3phantsnft",
19 "lastIngestedAt": "2023-07-12T23:25:34.000Z"
20 },
21 "contractDeployer": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
22 "deployedBlockNumber": 15140845
23 },
24 "tokenId": "5447",
25 "tokenType": "ERC721",
26 "title": "3L3PHANTS #5447",
27 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
28 "timeLastUpdated": "2023-02-18T18:43:33.104Z",
29 "rawMetadata": {
30 "name": "3L3PHANTS #5447",
31 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
32 "image": "ipfs://QmWS5E2YK9rEWUuvkZkicSTZ9Fbck9z1aZTKYLAcmkmdTx",
33 "attributes": [
34 {
35 "value": "Green",
36 "trait_type": "Background"
37 },
38 {
39 "value": "Gold",
40 "trait_type": "Tusks"
41 }
42 ]
43 },
44 "tokenUri": {
45 "gateway": "https://alchemy.mypinata.cloud/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/5447",
46 "raw": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/5447"
47 },
48 "media": [
49 {
50 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/34233c43dee24fc5748d48867d5a61e8",
51 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/34233c43dee24fc5748d48867d5a61e8",
52 "raw": "ipfs://QmWS5E2YK9rEWUuvkZkicSTZ9Fbck9z1aZTKYLAcmkmdTx",
53 "format": "png",
54 "bytes": 211149
55 }
56 ],
57 "from": "0x93ab7195dc4dd4a098efb10b47fe48c7893b8864",
58 "to": "0xad2596f9506309ea64e81605aaa4e898134ac1f2",
59 "transactionHash": "0xcec76b5c70c1dc71c09a2f383a4ae5a93331a0d4dea690171041263ae416c05c",
60 "blockNumber": "0xfccb9e"
61 },
62 {
63 "contract": {
64 "address": "0x1f02bf9dde7c79137a08b2dd4fc964bfd2499734",
65 "name": "Elephants",
66 "symbol": "ELENFT",
67 "totalSupply": "7778",
68 "tokenType": "ERC721",
69 "openSea": {
70 "floorPrice": 0.0031,
71 "collectionName": "3L3Phants Official",
72 "safelistRequestStatus": "verified",
73 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
74 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
75 "externalUrl": "http://3l3phants.io",
76 "twitterUsername": "3L3NFT",
77 "discordUrl": "https://discord.gg/3L3phantsnft",
78 "lastIngestedAt": "2023-07-12T23:25:34.000Z"
79 },
80 "contractDeployer": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",
81 "deployedBlockNumber": 15140845
82 },
83 "tokenId": "372",
84 "tokenType": "ERC721",
85 "title": "3L3PHANTS #372",
86 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
87 "timeLastUpdated": "2023-03-15T08:33:25.446Z",
88 "rawMetadata": {
89 "name": "3L3PHANTS #372",
90 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
91 "image": "ipfs://QmXvc2DMgg9ZJWGuAV1DTRn3HFS2oFtHbyo2am2LsSuguY",
92 "attributes": [
93 {
94 "value": "Red",
95 "trait_type": "Background"
96 },
97 "value": "Brown",
98 "trait_type": "Tusks"
99 }
100 ]
101 },
102 "tokenUri": {
103 "gateway": "https://ipfs.io/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/372",
104 "raw": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/372"
105 },
106 "media": [
107 {
108 "gateway": "https://nft-cdn.alchemy.com/eth-mainnet/5da1c73b64d3fc6dc1c986ac8e4f76f8",
109 "thumbnail": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/5da1c73b64d3fc6dc1c986ac8e4f76f8",
110 "raw": "ipfs://QmXvc2DMgg9ZJWGuAV1DTRn3HFS2oFtHbyo2am2LsSuguY",
111 "format": "png",
112 "bytes": 189584
113 }
114 ],
115 "from": "0xb7dded5be42790543096fd7d765155de658530f8",
116 "to": "0x4209859ae2992f581d2678392b4ac80c13d5eed4",
117 "transactionHash": "0xb89d383a80ead28c4ec00d985dd5f25989c02d945bb84b55261e07ce34d4406f",
118 "blockNumber": "0xfcc202"
119 }
120 ]
121}

V3 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734",
6 "name": "Elephants",
7 "symbol": "ELENFT",
8 "totalSupply": "7778",
9 "tokenType": "ERC721",
10 "contractDeployer": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
11 "deployedBlockNumber": 15140845,
12 "openSeaMetadata": {
13 "floorPrice": 0.0032,
14 "collectionName": "3L3Phants Official",
15 "collectionSlug": "3l3phants-official",
16 "safelistRequestStatus": "verified",
17 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
18 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
19 "externalUrl": "http://3l3phants.io",
20 "twitterUsername": "3L3NFT",
21 "discordUrl": "https://discord.gg/3L3phantsnft",
22 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format",
23 "lastIngestedAt": "2023-09-19T22:06:03.000Z"
24 },
25 "spamClassifications": []
26 },
27 "tokenId": "5447",
28 "tokenType": "ERC721",
29 "name": "3L3PHANTS #5447",
30 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
31 "tokenUri": "https://alchemy.mypinata.cloud/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/5447",
32 "image": {
33 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/34233c43dee24fc5748d48867d5a61e8",
34 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/34233c43dee24fc5748d48867d5a61e8",
35 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/34233c43dee24fc5748d48867d5a61e8",
36 "contentType": "image/png",
37 "size": 211149,
38 "originalUrl": "https://ipfs.io/ipfs/QmWS5E2YK9rEWUuvkZkicSTZ9Fbck9z1aZTKYLAcmkmdTx"
39 },
40 "raw": {
41 "tokenUri": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/5447",
42 "metadata": {
43 "name": "3L3PHANTS #5447",
44 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
45 "image": "ipfs://QmWS5E2YK9rEWUuvkZkicSTZ9Fbck9z1aZTKYLAcmkmdTx",
46 "attributes": [
47 {
48 "value": "Green",
49 "trait_type": "Background"
50 },
51 {
52 "value": "Red Hoodie",
53 "trait_type": "Outfit"
54 },
55 {
56 "value": "Gold",
57 "trait_type": "Tusks"
58 }
59 ]
60 }
61 },
62 "collection": {
63 "name": "3L3Phants Official",
64 "slug": "3l3phants-official",
65 "externalUrl": "http://3l3phants.io",
66 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format"
67 },
68 "mint": {
69 "mintAddress": "0xfd279644adb28043ee10111f2971b3e4fb655e86",
70 "blockNumber": 15260123,
71 "timestamp": "2022-08-02T01:18:08Z",
72 "transactionHash": "0x7cfdf3018a244529c6b1c6b85171f5c1cbf355c78b5f4faa80bd2fcfaf0d4429"
73 },
74 "timeLastUpdated": "2023-02-18T18:43:33.104Z",
75 "from": "0x93ab7195dc4dd4a098efb10b47fe48c7893b8864",
76 "to": "0xad2596f9506309ea64e81605aaa4e898134ac1f2",
77 "transactionHash": "0xcec76b5c70c1dc71c09a2f383a4ae5a93331a0d4dea690171041263ae416c05c",
78 "blockNumber": "0xfccb9e"
79 },
80 {
81 "contract": {
82 "address": "0x1F02bF9dDe7C79137a08B2Dd4FC964BfD2499734",
83 "name": "Elephants",
84 "symbol": "ELENFT",
85 "totalSupply": "7778",
86 "tokenType": "ERC721",
87 "contractDeployer": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8",
88 "deployedBlockNumber": 15140845,
89 "openSeaMetadata": {
90 "floorPrice": 0.0032,
91 "collectionName": "3L3Phants Official",
92 "collectionSlug": "3l3phants-official",
93 "safelistRequestStatus": "verified",
94 "imageUrl": "https://i.seadn.io/gcs/files/71dfb6cacb894a713d91f493917fa1b5.png?w=500&auto=format",
95 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. From the mind of Ic3cream and designed by World Renowned Artist Tornado Toad. Join the Herd today!\n\nEarn $NUT token in our discord now!\n\nhttps://discord.gg/3l3phantsnft",
96 "externalUrl": "http://3l3phants.io",
97 "twitterUsername": "3L3NFT",
98 "discordUrl": "https://discord.gg/3L3phantsnft",
99 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format",
100 "lastIngestedAt": "2023-09-19T22:06:03.000Z"
101 },
102 "spamClassifications": []
103 },
104 "tokenId": "372",
105 "tokenType": "ERC721",
106 "name": "3L3PHANTS #372",
107 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
108 "tokenUri": "https://ipfs.io/ipfs/QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/372",
109 "image": {
110 "cachedUrl": "https://nft-cdn.alchemy.com/eth-mainnet/5da1c73b64d3fc6dc1c986ac8e4f76f8",
111 "thumbnailUrl": "https://res.cloudinary.com/alchemyapi/image/upload/thumbnailv2/eth-mainnet/5da1c73b64d3fc6dc1c986ac8e4f76f8",
112 "pngUrl": "https://res.cloudinary.com/alchemyapi/image/upload/convert-png/eth-mainnet/5da1c73b64d3fc6dc1c986ac8e4f76f8",
113 "contentType": "image/png",
114 "size": 189584,
115 "originalUrl": "https://ipfs.io/ipfs/QmXvc2DMgg9ZJWGuAV1DTRn3HFS2oFtHbyo2am2LsSuguY"
116 },
117 "raw": {
118 "tokenUri": "ipfs://QmcpMnvcmUvn3EsQ6QmV1J7QwouBKimrhbHpEV5Db9gFgy/372",
119 "metadata": {
120 "name": "3L3PHANTS #372",
121 "description": "3L3Phants NFT is a collection of 7,777 Elephants stampeding on the Ethereum blockchain. Saving 3L3Phants & Wildlife one NFT at a time",
122 "image": "ipfs://QmXvc2DMgg9ZJWGuAV1DTRn3HFS2oFtHbyo2am2LsSuguY",
123 "attributes": [
124 {
125 "value": "Red",
126 "trait_type": "Background"
127 },
128 {
129 "value": "Brown",
130 "trait_type": "Tusks"
131 }
132 ]
133 }
134 },
135 "collection": {
136 "name": "3L3Phants Official",
137 "slug": "3l3phants-official",
138 "externalUrl": "http://3l3phants.io",
139 "bannerImageUrl": "https://i.seadn.io/gcs/files/1667bbb67e548917820271ee2430bb35.png?w=500&auto=format"
140 },
141 "mint": {
142 "mintAddress": "0xa590b03f6492f658b9d13f49924b2b1bb4b596b1",
143 "blockNumber": 15141967,
144 "timestamp": "2022-07-14T16:52:41Z",
145 "transactionHash": "0xc126314bde53b9348df97561c796ff9535549ac7fa596f9f7223084443bbdff8"
146 },
147 "timeLastUpdated": "2023-03-15T08:33:25.446Z",
148 "from": "0xb7dded5be42790543096fd7d765155de658530f8",
149 "to": "0x4209859ae2992f581d2678392b4ac80c13d5eed4",
150 "transactionHash": "0xb89d383a80ead28c4ec00d985dd5f25989c02d945bb84b55261e07ce34d4406f",
151 "blockNumber": "0xfcc202"
152 }
153 ]
154}

getMintedNfts - SDK

The getMintedNfts method gets all the NFTs minted by a specified owner address.

Overview of Changes

  • The openSea object in the parent contract object has been changed to openSeaMetadata in the V3 response.
  • The collectionSlug and bannerImageUrl parameters have been added to the contract.openSeaMetadata object in V3.
  • The title parameter in V2 has been changed to a name parameter in V3.
  • The media parameter in V2 has been replaced with an image object in V3.
  • The rawMetadataobject parameter has been changed to a raw object in V3, which contains the tokenUri,metadata, and error parameters
  • The tokenUri object in V2 has been changed to a tokenUri string parameter in the V3 response.
  • The isSpam and spamClassifications parameters have been added to the contract object in V3.
  • The mint object parameter has been added to the V3 response containing optional mintAddress?, blockNumber?, timestamp?, and transactionHash? parameters.
  • The collection object has been added to the V3 response containing the name, slug?, externalUrl?, and bannerImageUrl? parameters.
  • The acquiredAt object has been added to the V3 response.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "demo", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13// Example of using the new getMintedNfts method
14const main = async () => {
15 // Address for the NFT owner (can be in ENS format).
16 let address = "vitalik.eth";
17
18 // Additional options for the request. (Optional)
19 let options = {
20 /**
21 * List of NFT contract addresses to filter mints by. If omitted, defaults to
22 * all contract addresses.
23 */
24 contractAddresses: ["0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85"],
25 /**
26 * Filter mints by ERC721 vs ERC1155 contracts. If omitted, defaults to all
27 * NFTs.
28 */
29 tokenType: "ERC721",
30 };
31
32 // Calling the getMintedNfts method
33 let mintedNfts = await alchemy.nft.getMintedNfts(address, options);
34
35 // Logging the response to the console
36 console.log(mintedNfts);
37};
38
39main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contract.addresscontract.address
contract.namecontract.name
contract.symbolcontract.symbol
contract.totalSupplycontract.totalSupply
contract.tokenTypecontract.tokenType
contract.openSea.floorPricecontract.openSeaMetadata.floorPrice
contract.openSea.collectionNamecontract.openSeaMetadata.collectionName
-contract.openSeaMetadata.collectionSlug(New in V3)
contract.openSea.safelistRequestStatuscontract.openSeaMetadata.safelistRequestStatus
contract.openSea.imageUrlcontract.openSeaMetadata.imageUrl
contract.openSea.descriptioncontract.openSeaMetadata.description
contract.openSea.externalUrlcontract.openSeaMetadata.externalUrl
contract.openSea.twitterUsernamecontract.openSeaMetadata.twitterUsername
contract.openSea.discordUrlcontract.openSeaMetadata.discordUrl
-contract.openSeaMetadata.bannerImageUrl(New in V3)
contract.openSea.lastIngestedAtcontract.openSeaMetadata.lastIngestedAt
contract.contractDeployercontract.contractDeployer
contract.deployedBlockNumbercontract.deployedBlockNumber
spamInfo.isSpamcontract.isSpam
spamInfo.classificationscontract.spamClassifications
tokenIdtokenId
tokenTypetokenType
titlename
descriptiondescription
timeLastUpdatedtimeLastUpdated
rawMetadataraw
rawMetadata.metadataraw.metadata
rawMetadata.errorraw.error
rawMetadata.attributesraw.metadata.attributes
-raw.tokenUri
tokenUritokenUri
mediaimage
fromfrom
toto
transactionHashtransactionHash
blockNumberblockNumber
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
6 "tokenType": "ERC721",
7 "openSea": {
8 "floorPrice": 0.0005,
9 "collectionName": "ENS: Ethereum Name Service",
10 "safelistRequestStatus": "verified",
11 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
12 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
13 "externalUrl": "https://ens.domains",
14 "twitterUsername": "ensdomains",
15 "lastIngestedAt": "2023-07-21T07:08:17.000Z"
16 },
17 "contractDeployer": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8",
18 "deployedBlockNumber": 9380410
19 },
20 "tokenId": "111352653673047713804124050598355152059184664886497242203777472800304891334469",
21 "tokenType": "ERC721",
22 "title": "",
23 "description": "",
24 "timeLastUpdated": "2023-07-21T12:40:51.364Z",
25 "metadataError": "Token uri responded with a non 200 response code",
26 "rawMetadata": {
27 "metadata": [],
28 "attributes": []
29 },
30 "tokenUri": {
31 "gateway": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xf62f5e56fe8da20b0f4596383d464ebbaf1968de230cfb3dd53fc91800228f45",
32 "raw": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xf62f5e56fe8da20b0f4596383d464ebbaf1968de230cfb3dd53fc91800228f45"
33 },
34 "media": [],
35 "from": "0x0000000000000000000000000000000000000000",
36 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
37 "transactionHash": "0xc5bc4cf983e98ad9708dee356a17196aa367228f9ec87f81e622c81adaa6211e",
38 "blockNumber": "0xe88086"
39 },
40 {
41 "contract": {
42 "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
43 "tokenType": "ERC721",
44 "openSea": {
45 "floorPrice": 0.0005,
46 "collectionName": "ENS: Ethereum Name Service",
47 "safelistRequestStatus": "verified",
48 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
49 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
50 "externalUrl": "https://ens.domains",
51 "twitterUsername": "ensdomains",
52 "lastIngestedAt": "2023-07-21T07:08:17.000Z"
53 },
54 "contractDeployer": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8",
55 "deployedBlockNumber": 9380410
56 },
57 "tokenId": "103040680624633360426956226800459505851045291463662393946817594920946384752224",
58 "tokenType": "ERC721",
59 "title": "",
60 "description": "",
61 "timeLastUpdated": "2023-07-21T12:40:50.845Z",
62 "metadataError": "Token uri responded with a non 200 response code",
63 "rawMetadata": {
64 "metadata": [],
65 "attributes": []
66 },
67 "tokenUri": {
68 "gateway": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xe3cef55f7067b9353a1b591cd3ea3af56e998792eb10d19a1b96f0a09917ce60",
69 "raw": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xe3cef55f7067b9353a1b591cd3ea3af56e998792eb10d19a1b96f0a09917ce60"
70 },
71 "media": [],
72 "from": "0x0000000000000000000000000000000000000000",
73 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
74 "transactionHash": "0x9f21fad5549aaf94e7731f5c4649353926cf7520b96891b8b511d099020fb887",
75 "blockNumber": "0xf47bcd"
76 },
77 {
78 "contract": {
79 "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
80 "tokenType": "ERC721",
81 "openSea": {
82 "floorPrice": 0.0005,
83 "collectionName": "ENS: Ethereum Name Service",
84 "safelistRequestStatus": "verified",
85 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
86 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
87 "externalUrl": "https://ens.domains",
88 "twitterUsername": "ensdomains",
89 "lastIngestedAt": "2023-07-21T07:08:17.000Z"
90 },
91 "contractDeployer": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8",
92 "deployedBlockNumber": 9380410
93 },
94 "tokenId": "79362104341617195787435013155216554898816343870453146709166302825328240112628",
95 "tokenType": "ERC721",
96 "title": "",
97 "description": "",
98 "timeLastUpdated": "2023-07-21T12:40:51.867Z",
99 "metadataError": "Token uri responded with a non 200 response code",
100 "rawMetadata": {
101 "metadata": [],
102 "attributes": []
103 },
104 "tokenUri": {
105 "gateway": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf755bf78de2496dbb4f4c665d1437ed11cd5c8835e8e32b16f3bf500cb633f4",
106 "raw": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf755bf78de2496dbb4f4c665d1437ed11cd5c8835e8e32b16f3bf500cb633f4"
107 },
108 "media": [],
109 "from": "0x0000000000000000000000000000000000000000",
110 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
111 "transactionHash": "0xe3c78eca914f215644922e15d080b4198d552885a64958f4bec6516ace149b43",
112 "blockNumber": "0xf47bcd"
113 }
114 ]
115}

V3 Example Response

json
1{
2 "nfts": [
3 {
4 "contract": {
5 "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
6 "tokenType": "ERC721",
7 "contractDeployer": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8",
8 "deployedBlockNumber": 9380410,
9 "openSeaMetadata": {
10 "floorPrice": 0.001,
11 "collectionName": "ENS: Ethereum Name Service",
12 "collectionSlug": "ens",
13 "safelistRequestStatus": "verified",
14 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
15 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
16 "externalUrl": "https://ens.domains",
17 "twitterUsername": "ensdomains",
18 "lastIngestedAt": "2023-09-18T10:20:40.000Z"
19 },
20 "spamClassifications": []
21 },
22 "tokenId": "111352653673047713804124050598355152059184664886497242203777472800304891334469",
23 "tokenType": "ERC721",
24 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xf62f5e56fe8da20b0f4596383d464ebbaf1968de230cfb3dd53fc91800228f45",
25 "image": {},
26 "raw": {
27 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xf62f5e56fe8da20b0f4596383d464ebbaf1968de230cfb3dd53fc91800228f45",
28 "metadata": {},
29 "error": "Centralized gateway timed out, try again with a higher tokenUri timeout"
30 },
31 "collection": {
32 "name": "ENS: Ethereum Name Service",
33 "slug": "ens",
34 "externalUrl": "https://ens.domains"
35 },
36 "mint": {},
37 "timeLastUpdated": "2023-09-21T14:06:39.073Z",
38 "from": "0x0000000000000000000000000000000000000000",
39 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
40 "transactionHash": "0xc5bc4cf983e98ad9708dee356a17196aa367228f9ec87f81e622c81adaa6211e",
41 "blockNumber": "0xe88086"
42 },
43 {
44 "contract": {
45 "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
46 "tokenType": "ERC721",
47 "contractDeployer": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8",
48 "deployedBlockNumber": 9380410,
49 "openSeaMetadata": {
50 "floorPrice": 0.001,
51 "collectionName": "ENS: Ethereum Name Service",
52 "collectionSlug": "ens",
53 "safelistRequestStatus": "verified",
54 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
55 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
56 "externalUrl": "https://ens.domains",
57 "twitterUsername": "ensdomains",
58 "lastIngestedAt": "2023-09-18T10:20:40.000Z"
59 },
60 "spamClassifications": []
61 },
62 "tokenId": "103040680624633360426956226800459505851045291463662393946817594920946384752224",
63 "tokenType": "ERC721",
64 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xe3cef55f7067b9353a1b591cd3ea3af56e998792eb10d19a1b96f0a09917ce60",
65 "image": {},
66 "raw": {
67 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xe3cef55f7067b9353a1b591cd3ea3af56e998792eb10d19a1b96f0a09917ce60",
68 "metadata": {},
69 "error": "Centralized gateway timed out, try again with a higher tokenUri timeout"
70 },
71 "collection": {
72 "name": "ENS: Ethereum Name Service",
73 "slug": "ens",
74 "externalUrl": "https://ens.domains"
75 },
76 "mint": {},
77 "timeLastUpdated": "2023-09-21T14:06:39.076Z",
78 "from": "0x0000000000000000000000000000000000000000",
79 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
80 "transactionHash": "0x9f21fad5549aaf94e7731f5c4649353926cf7520b96891b8b511d099020fb887",
81 "blockNumber": "0xf47bcd"
82 },
83 {
84 "contract": {
85 "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
86 "tokenType": "ERC721",
87 "contractDeployer": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8",
88 "deployedBlockNumber": 9380410,
89 "openSeaMetadata": {
90 "floorPrice": 0.001,
91 "collectionName": "ENS: Ethereum Name Service",
92 "collectionSlug": "ens",
93 "safelistRequestStatus": "verified",
94 "imageUrl": "https://i.seadn.io/gae/0cOqWoYA7xL9CkUjGlxsjreSYBdrUBE0c6EO1COG4XE8UeP-Z30ckqUNiL872zHQHQU5MUNMNhfDpyXIP17hRSC5HQ?w=500&auto=format",
95 "description": "Ethereum Name Service (ENS) domains are secure domain names for the decentralized world. ENS domains provide a way for users to map human readable names to blockchain and non-blockchain resources, like Ethereum addresses, IPFS hashes, or website URLs. ENS domains can be bought and sold on secondary markets.",
96 "externalUrl": "https://ens.domains",
97 "twitterUsername": "ensdomains",
98 "lastIngestedAt": "2023-09-18T10:20:40.000Z"
99 },
100 "spamClassifications": []
101 },
102 "tokenId": "79362104341617195787435013155216554898816343870453146709166302825328240112628",
103 "tokenType": "ERC721",
104 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf755bf78de2496dbb4f4c665d1437ed11cd5c8835e8e32b16f3bf500cb633f4",
105 "image": {},
106 "raw": {
107 "tokenUri": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf755bf78de2496dbb4f4c665d1437ed11cd5c8835e8e32b16f3bf500cb633f4",
108 "metadata": {},
109 "error": "Token uri responded with a non 200 response code"
110 },
111 "collection": {
112 "name": "ENS: Ethereum Name Service",
113 "slug": "ens",
114 "externalUrl": "https://ens.domains"
115 },
116 "mint": {},
117 "timeLastUpdated": "2023-09-21T14:06:38.973Z",
118 "from": "0x0000000000000000000000000000000000000000",
119 "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
120 "transactionHash": "0xe3c78eca914f215644922e15d080b4198d552885a64958f4bec6516ace149b43",
121 "blockNumber": "0xf47bcd"
122 }
123 ]
124}

getOwnersForNft - SDK

Gets all the owners for a given NFT contract address and token ID.

Overview of Changes

  • A new field pageKey has been added to the response structure in V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address and token Id
15 const address = "0x5180db8F5c931aaE63c74266b211F580155ecac8";
16 const tokenId = "1590";
17
18 //Call the method to fetch the owners for the collection
19 const response = await alchemy.nft.getOwnersForNft(address, tokenId)
20
21 //Logging the response to the console
22 console.log(response)
23}
24
25main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
ownersowners
pageKey(New in V3)

Example Responses

V2 Example Response

json
1{
2 "owners": [
3 "0xf5fff32cf83a1a614e15f25ce55b0c0a6b5f8f2c"
4 ]
5}

V3 Example Response

json
1{
2 "owners": [
3 "0xF5FFF32CF83A1A614e15F25Ce55B0c0A6b5F8F2c"
4 ],
5 "pageKey": null
6}

getOwnersForContract - SDK

Gets all the owners for a given NFT contract and the token balance.

Overview of Changes

There are no changes in the request or response structure for the method getOwnersForContract between V2 and V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address
15 const address = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";
16
17 //Call the method to fetch the owners for the contract
18 const response = await alchemy.nft.getOwnersForContract(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
ownersowners
totalCount?totalCount?
pageKey?pageKey?

Example Responses

V2 Example Response

json
1{
2 "owners": [
3 "0x001a61213d72f2f3c95ff743c80f472749ab8ad3",
4 "0x003a1acce28eb335f3ff1e93a5b09cd4b598ef62",
5 "0x00614efd868dabb5f92e15b0440d1f85ac0f9be1",
6 "0x006f48d6ed87efd9e0bc56cc7a8703d0455c2858",
7 "0x008b7903f1f0b825636739c7a3defb7eebc94f1d",
8 "0x008c79f10cbd14070b106b05d5fd494e084ee8a5",
9 "0x00ce8f7e0ec4f03a821e8cb3d84479d76151d0a9",
10 "0x00f3a0fcc47ba9f7a757c255aaa6a286a524cef9",
11 "0x016c6422b74463834514394b7207478982139bb4",
12 "0x016df42305bb3d0e21abf75b456a4babb1777a4b",
13 "0x01882145348b9908f803740e547efbad0983cdcb",
14 "0x018edc98b3190dbb261e6ff3858c4ba59c71ba94",
15 "0x019d99678bd3b9f1157e763398a3dd62cb760a23",
16 "0x01ae3e9aa99f080b59d3a02ee40478af8b3d63c1",
17 "0x01e4cf06c6adb9231a30ca17f4a62afe23c0a9c1",
18 "0x01e6357045328fa19c11994af6a4500754e6a75b",
19 "0x02070ed234f1a07ca88f6164791e033c97570d96",
20 "0x0207a5cfc75733d82f2dd5a8b6adf78277ef7347",
21 "0x025dca13f8803ed01b3ea717e2ee9daf7a383cda",
22 "0x02b92b2254c27bed8d4268e663200f705bc76e35",
23 "0xffc91af289242fb62d8d06116b2c5a6c6aa50205",
24 "0xffcebf6be845b95cfd42e77c65968662bc8f9f2f"
25 ]
26}

V3 Example Response

json
1{
2 "owners": [
3 "0x001a61213D72F2F3C95Ff743c80f472749AB8ad3",
4 "0x003a1aCce28eb335F3FF1E93A5B09cD4b598EF62",
5 "0x00614Efd868DAbB5f92E15b0440D1F85ac0f9be1",
6 "0x006F48D6eD87eFD9e0BC56cC7a8703D0455C2858",
7 "0x008B7903F1f0B825636739c7a3defb7EEbc94F1D",
8 "0x008c79F10CBd14070b106b05d5Fd494e084EE8A5",
9 "0x00Ce8F7e0EC4F03a821E8CB3D84479D76151D0A9",
10 "0x00f3a0fcC47ba9f7A757C255aaa6A286a524ceF9",
11 "0x016c6422B74463834514394B7207478982139bB4",
12 "0x016DF42305bb3D0E21abF75b456a4Babb1777A4B",
13 "0x01882145348B9908f803740e547EfbaD0983cDcB",
14 "0x018eDC98B3190DbB261E6Ff3858c4BA59c71Ba94",
15 "0x019D99678BD3B9F1157E763398a3Dd62cb760A23",
16 "0x01aE3e9Aa99F080b59D3A02EE40478af8b3d63c1",
17 "0x01E4cF06C6ADb9231a30Ca17f4A62afE23c0A9c1",
18 "0x01E6357045328fA19C11994af6a4500754E6a75b",
19 "0x02070ed234F1a07cA88F6164791e033C97570d96",
20 "0x0207A5cFc75733D82f2dd5A8b6adf78277EF7347",
21 "0x025DCA13f8803Ed01B3Ea717e2Ee9DaF7A383cDa",
22 "0x02B92b2254c27beD8d4268e663200f705bC76E35",
23 "0x02f52b4aF1deCD963a3f0586D28484F530bdC101",
24 "0x02fe09e15f1fEAEf2E4Dd4b7afd5A12630f1fae6",
25 "0x034C8f85476f2D30c946e3CE5929BC24e8D3B04F",
26 "0x037C8b05C9Ffe5e33B99372d17580C0C915AFa60",
27 "0x037FC3F7f58771CbcC4C32327814769FBF5A8F3F",
28 "0x038080B8BF89847Ca926F9731695859d9c55A4C6",
29 "0xffcEBF6Be845b95CFD42e77c65968662BC8F9f2F"
30 ]
31}

getContractsForOwner - SDK

Gets all NFT contracts held by the specified owner address.

Overview of Changes

  • A new totalSupply field has been added.
  • The field title has been removed and replaced with displayNft.name.
  • The field tokenId has been renamed to displayNft.tokenId.
  • A new image object has been created with the specified mappings.
  • The openSea object has been renamed to openSeaMetadata.
  • The collectionSlug and bannerUrl parameters have been added to the openSeaMetadata object.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14
15 const owner = "vitalik.eth"
16
17 //Call the method
18 const response = await alchemy.nft.getContractsForOwner(owner)
19
20 //Logging the response to the console
21 console.log(response)
22};
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2V3
addressaddress
totalBalancetotalBalance
numDistinctTokensOwnednumDistinctTokensOwned
namename
titleNot present, use displayNft.name
symbolsymbol
-totalSupply
tokenTypetokenType
contractDeployercontractDeployer
deployedBlockNumberdeployedBlockNumber
isSpamisSpam
tokenIddisplayNft.tokenId
mediaimage
opensea.floorPriceopenSeaMetadata.floorPrice
opensea.collectionNameopenSeaMetadata.collectionName
-openSeaMetadata.collectionSlug
opensea.safelistRequestStatusopenSeaMetadata.safelistRequestStatus
opensea.imageUrlopenSeaMetadata.imageUrl
opensea.descriptionopenSeaMetadata.description
opensea.externalUrlopenSeaMetadata.externalUrl
opensea.twitterUsernameopenSeaMetadata.twitterUsername
opensea.discordUrlopenSeaMetadata.discordUrl
-openSeaMetadata.bannerUrl
opensea.lastIngestedAtopenSeaMetadata.lastIngestedAt
totalCounttotalCount
pageKeypageKey

Example Responses

V2 Example Response

json
1{
2 "contracts": [
3 {
4 "address": "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
5 "totalBalance": 912,
6 "numDistinctTokensOwned": 80,
7 "isSpam": true,
8 "tokenId": "0x0000000000000000000000000000000000000000000000000000000000000001",
9 "name": "Bored Ape Nike Club",
10 "title": "",
11 "symbol": "BANC",
12 "tokenType": "ERC721",
13 "contractDeployer": "0x51d7d428041e23ef51422e110dfeff906e821cfe",
14 "deployedBlockNumber": 14276343,
15 "opensea": {
16 "collectionName": "BoredApeNikeClub",
17 "collectionSlug": "bored-ape-nike-club-v2",
18 "safelistRequestStatus": "not_requested",
19 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
20 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
21 "externalUrl": "https://nikemetaverse.xyz",
22 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
23 "lastIngestedAt": "2023-09-21T15:28:51.000Z"
24 },
25 "media": [
26 {
27 "gateway": "",
28 "raw": ""
29 }
30 ]
31 },
32 {
33 "address": "0x0da763dfc24764275e56d9011a01186fbacf2edf",
34 "totalBalance": 10,
35 "numDistinctTokensOwned": 6,
36 "isSpam": true,
37 "tokenId": "0x0000000000000000000000000000000000000000000000000000000000000012",
38 "name": "VeeCon",
39 "title": "",
40 "symbol": "VC",
41 "totalSupply": "8",
42 "tokenType": "ERC721",
43 "contractDeployer": "0xdce675fcce9cb500b62f69464fe10f2999d77a50",
44 "deployedBlockNumber": 14530344,
45 "opensea": {
46 "collectionName": "Vee Con Tickets Official",
47 "collectionSlug": "veecontickets-2022",
48 "safelistRequestStatus": "not_requested",
49 "imageUrl": "https://i.seadn.io/gae/wPIhTZGy2aMY3rHL6eUUvSansxQqTZwsbnD2Dt7AoW2YQZH-iwiue3Xt6YbO005Z_vwCzyKyVhmHBZ8C4KYttgjmzEpTRc6sAQLWag?w=500&auto=format",
50 "description": "[Mint on the website](https://veecontickets.xyz)\n\nVeeCon 2022 is a multi-day superconference where only VeeCon NFT ticket holders will experience an extraordinary lineup of content including iconic keynote speeches; innovative and educational talks, panels and Q&A sessions; and many collaborative experiences",
51 "externalUrl": "https://veecontickets.xyz",
52 "bannerImageUrl": "https://i.seadn.io/gae/zjaIJ85YSsyeO88fFOegjzeh3lfG8Z0zNYjvjDGrRGpdTyEUw3upA7ZrdRTHbwWu7XVQPheZMOObLKrMWV0mQdbjhZeXiddyKnwLD9E?w=500&auto=format",
53 "lastIngestedAt": "2023-09-28T23:32:45.000Z"
54 },
55 "media": [
56 {
57 "gateway": "",
58 "raw": ""
59 }
60 ]
61 }
62 ],
63 "totalCount": 2207,
64 "pageKey": "94d6b0fd-5288-4cab-8f60-ac5f09941a65"
65}

V3 Example Response

json
1{
2 "contracts": [
3 {
4 "address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
5 "name": "Bored Ape Nike Club",
6 "symbol": "BANC",
7 "tokenType": "ERC721",
8 "contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
9 "deployedBlockNumber": 14276343,
10 "openSeaMetadata": {
11 "collectionName": "BoredApeNikeClub",
12 "collectionSlug": "bored-ape-nike-club-v2",
13 "safelistRequestStatus": "not_requested",
14 "imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
15 "description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
16 "externalUrl": "https://nikemetaverse.xyz",
17 "bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
18 "lastIngestedAt": "2023-09-21T15:28:51.000Z"
19 },
20 "totalBalance": "912",
21 "numDistinctTokensOwned": "80",
22 "isSpam": true,
23 "displayNft": {
24 "tokenId": "1"
25 },
26 "image": {}
27 },
28 {
29 "address": "0x0015F391949f25c3211063104aD4AFC99210f85c",
30 "name": "BAYC Otherside Land",
31 "symbol": "BAYC",
32 "totalSupply": "24",
33 "tokenType": "ERC721",
34 "contractDeployer": "0x4B7A67800712472F5f4a5f580c3B99345DF1CeD6",
35 "deployedBlockNumber": 14669988,
36 "openSeaMetadata": {
37 "collectionName": "BAYC Otherside Land V3",
38 "collectionSlug": "bayc-otherside-land-v3-7",
39 "safelistRequestStatus": "not_requested",
40 "imageUrl": "https://i.seadn.io/gae/aR91WTPUmY4QBkle9qBum5dfjfCyh9n8zgYWyMAFJ-3vUUdquzasMpYyl2Jr6elxhZlPuI1gzthut99h0Z33F_k-xqev_jGldV7X?w=500&auto=format",
41 "description": "[Mint on the website](https://baycofficial.xyz)\n\nBAYC Otherside Land is an open world that enables users to build 3D immersive applications on top of several blockchains. In BAYC Otherside Land, users can take advantage of traditional 3D open-world features such as building 3D architectures, hosting virtual meetings, exhibiting NFTs, and more advanced functionality.Details on Twitter @BoredApeYC or PUBLIC MINT NOW LIVE!\n",
42 "externalUrl": "https://baycofficial.xyz",
43 "bannerImageUrl": "https://i.seadn.io/gae/buhkgp9EPv2YoCeB9k1XWMX7hkBbkpIFkwOdveTZPsVOuKiANbDBwjvAxSpvxhbh5NxU0Kkjje-3VVWk36z-f4Z5rlmAHZXMeisu?w=500&auto=format",
44 "lastIngestedAt": "2023-09-21T21:07:17.000Z"
45 },
46 "totalBalance": "17",
47 "numDistinctTokensOwned": "6",
48 "isSpam": true,
49 "displayNft": {
50 "tokenId": "2"
51 },
52 "image": {}
53 },
54 {
55 "address": "0x0dA763DFc24764275E56D9011A01186fbacF2edf",
56 "name": "VeeCon",
57 "symbol": "VC",
58 "totalSupply": "8",
59 "tokenType": "ERC721",
60 "contractDeployer": "0xDce675fCcE9Cb500B62f69464fE10f2999d77A50",
61 "deployedBlockNumber": 14530344,
62 "openSeaMetadata": {
63 "collectionName": "Vee Con Tickets Official",
64 "collectionSlug": "veecontickets-2022",
65 "safelistRequestStatus": "not_requested",
66 "imageUrl": "https://i.seadn.io/gae/wPIhTZGy2aMY3rHL6eUUvSansxQqTZwsbnD2Dt7AoW2YQZH-iwiue3Xt6YbO005Z_vwCzyKyVhmHBZ8C4KYttgjmzEpTRc6sAQLWag?w=500&auto=format",
67 "description": "[Mint on the website](https://veecontickets.xyz)\n\nVeeCon 2022 is a multi-day superconference where only VeeCon NFT ticket holders will experience an extraordinary lineup of content including iconic keynote speeches; innovative and educational talks, panels and Q&A sessions; and many collaborative experiences",
68 "externalUrl": "https://veecontickets.xyz",
69 "bannerImageUrl": "https://i.seadn.io/gae/zjaIJ85YSsyeO88fFOegjzeh3lfG8Z0zNYjvjDGrRGpdTyEUw3upA7ZrdRTHbwWu7XVQPheZMOObLKrMWV0mQdbjhZeXiddyKnwLD9E?w=500&auto=format",
70 "lastIngestedAt": "2023-09-19T03:10:31.000Z"
71 },
72 "totalBalance": "10",
73 "numDistinctTokensOwned": "6",
74 "isSpam": true,
75 "displayNft": {
76 "tokenId": "18"
77 },
78 "image": {}
79 }
80 ],
81 "pageKey": "75db8160-ea3f-4cb0-9bc4-4663f6a804af",
82 "totalCount": 2207
83}

getSpamContracts - SDK

Returns a list of all spam contracts marked by Alchemy.

Overview of Changes

  • The key name for the array of contract addresses in the response has been changed to contractAddresses in V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 //Call the method to return a list of spam contracts
15 const response = await alchemy.nft.getSpamContracts()
16
17 //Logging the response to the console
18 console.log(response)
19}
20
21main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
N/AcontractAddresses (new in V3)

Example Responses

V2 Example Response

json
1[
2 "0x000000000a42c2791eec307fff43fa5c640e3ef7",
3 "0x000294f162dc337cf060ac6e2cb7db8c8f544004",
4 "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
5 "0x00050657890966fc261113dba4c277d9cb204e52",
6 "0x0009498dd5a13679ac11927e4bae78c154fcf754",
7 "0x000d398c50ea4d0681e6a224749c94334d606ba2",
8 "0x000fb295d38c01051e37e65f3034dd4f02267c96",
9 "0x0015f391949f25c3211063104ad4afc99210f85c",
10 "0x001757861e8233c5a288411ddbf17378e724dd0c",
11 "0x001ac203afb48600f5a7d9b524145ac075f648af",
12 "0x001f561c73555005a7f22e2ae9cb785cf37cc3b9",
13 "0x002cb7d6d92e0bca294e0d4bc5762ef5d535d1d2",
14 "0x0030a97650f44802a4331dadeb2a4fc83e59dec1",
15 "0xfff9e4b5cf4b0f0ff83bba48ee5a88772cd258b9"
16]

V3 Example Response

json
1 "contractAddresses": [
2 "0x000000000A42C2791eEc307FFf43Fa5c640e3Ef7",
3 "0x000294F162Dc337Cf060AC6e2Cb7Db8c8F544004",
4 "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
5 "0x00050657890966fc261113DBa4c277d9cb204E52",
6 "0x0009498dD5a13679aC11927e4BAE78C154Fcf754",
7 "0x000D398c50EA4D0681E6a224749C94334d606Ba2",
8 "0x000Fb295d38c01051e37e65F3034dD4F02267c96",
9 "0x0015F391949f25c3211063104aD4AFC99210f85c",
10 "0x001757861e8233C5a288411dDbf17378e724DD0C",
11 "0x001AC203aFB48600f5a7D9b524145AC075f648aF",
12 "0x001f561C73555005a7f22e2ae9CB785cf37Cc3B9",
13 "0xfFf9e4b5Cf4b0F0fF83BbA48Ee5A88772Cd258B9"
14 ]
15}

isSpamContract - SDK

Returns whether a contract is marked as spam or not by Alchemy.

Overview of Changes

  • The V3 response wraps the boolean value in an object with a key isSpamContract.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address
15 const address = "0x000440f08436a7b866d1ae42db5e0be801da722a";
16
17 //Call the method to check if a contract is a spam
18 const response = await alchemy.nft.isSpamContract(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
boolean{ "isSpamContract": boolean }

Example Responses

V2 Example Response

json
1false

V3 Example Response

json
1{
2 "isSpamContract": false
3}

refreshContract - SDK

Triggers a metadata refresh of all NFTs in the provided contract address. This method is useful after an NFT collection is revealed.

Overview of Changes

  • There are no changes in the method’s request, response format, or parameter names/structures between V2 and V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address
15 const address = "0x5180db8F5c931aaE63c74266b211F580155ecac8";
16
17 //Call the method to return the refresh result response object
18 const response = await alchemy.nft.refreshContract(address)
19
20 //Logging the response to the console
21 console.log(response)
22}
23
24main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
contractAddresscontractAddress
refreshStaterefreshState
progressprogress

Example Responses

V2 Example Response

json
1{
2 "contractAddress": "0x5180db8f5c931aae63c74266b211f580155ecac8",
3 "refreshState": "queued",
4 "progress": 0
5}

V3 Example Response

json
1{
2 "contractAddress": "0x5180db8f5c931aae63c74266b211f580155ecac8",
3 "refreshState": "already_queued",
4 "progress": 0
5}

computeRarity - SDK

Returns the floor prices of an NFT contract by marketplace.

Overview of Changes

  • The response structure has been reorganized in V3. Instead of an array of objects, the response now contains an object with a rarities property that holds an array of objects.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address and tokenId
15 const address = "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d";
16 const tokenId = 145;
17
18 //Call the method to display the rarity of each attribute of the NFT
19 const response = await alchemy.nft.computeRarity(address, tokenId)
20
21 //Logging the response to the console
22 console.log(response)
23}
24
25main();

V3 Example Request

javascript
1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
prevalencerarities.prevalence
traitTyperarities.traitType
valuerarities.value

Example Responses

V2 Example Response

json
1[
2 {
3 "prevalence": 0.1273,
4 "traitType": "Background",
5 "value": "Orange"
6 },
7 {
8 "prevalence": 0.013,
9 "traitType": "Hat",
10 "value": "Prussian Helmet"
11 },
12 {
13 "prevalence": 0.1551,
14 "traitType": "Mouth",
15 "value": "Bored Unshaven"
16 },
17 {
18 "prevalence": 0.1229,
19 "traitType": "Fur",
20 "value": "Black"
21 },
22 {
23 "prevalence": 0.0203,
24 "traitType": "Clothes",
25 "value": "Bone Necklace"
26 },
27 {
28 "prevalence": 0.0487,
29 "traitType": "Eyes",
30 "value": "3d"
31 }
32]

V3 Example Response

json
1{
2 "rarities": [
3 {
4 "traitType": "Background",
5 "value": "Orange",
6 "prevalence": 0.1273
7 },
8 {
9 "traitType": "Hat",
10 "value": "Prussian Helmet",
11 "prevalence": 0.013
12 },
13 {
14 "traitType": "Mouth",
15 "value": "Bored Unshaven",
16 "prevalence": 0.1551
17 },
18 {
19 "traitType": "Fur",
20 "value": "Black",
21 "prevalence": 0.1229
22 },
23 {
24 "traitType": "Clothes",
25 "value": "Bone Necklace",
26 "prevalence": 0.0203
27 },
28 {
29 "traitType": "Eyes",
30 "value": "3d",
31 "prevalence": 0.0487
32 }
33 ]
34}

verifyNftOwnership - SDK

Checks that the provided owner address owns one or more of the provided NFTs. Returns a boolean indicating whether the owner’s address owns the provided NFT.

Overview of Changes

  • There are no changes in the method’s request, response format, or parameter names/structures between V2 and V3.

Example Requests

V2 Example Request

javascript
1// Imports the Alchemy SDK
2const { Alchemy, Network } = require("alchemy-sdk");
3
4// Configures the Alchemy SDK
5const config = {
6 apiKey: "alchemy-replit", // Replace with your API key
7 network: Network.ETH_MAINNET, // Replace with your network
8};
9
10// Creates an Alchemy object instance with the config to use for making requests
11const alchemy = new Alchemy(config);
12
13const main = async () => {
14 // define the contract address and owner
15 const address = "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8";
16 const owner = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
17
18 //Call the method to display the rarity of each attribute of the NFT
19 const response = await alchemy.nft.verifyNftOwnership(owner, address)
20
21 //Logging the response to the console
22 console.log(response)
23}
24
25main();

V3 Example Request

1// Same as V2

V2 <> V3 Mapping

V2 ParameterV3 Parameter
booleanboolean

Example Responses

V2 Example Response

json
1false

V3 Example Response

json
1false