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.
Returns the floor prices of an NFT contract by marketplace.
Overview of Changes
- An
error
field has been added to bothopenSea
andlooksRare
objects in the response structure in V3.
Example Requests
V2 Example Request
// Imports the Alchemy SDK
const { Alchemy, Network } = require("alchemy-sdk");
// Configures the Alchemy SDK
const config = {
apiKey: "alchemy-replit", // Replace with your API key
network: Network.ETH_MAINNET, // Replace with your network
};
// Creates an Alchemy object instance with the config to use for making requests
const alchemy = new Alchemy(config);
const main = async () => {
// define the contract address
const address = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
//Call the method to check the contract floor price
const response = await alchemy.nft.getFloorPrice(address)
//Logging the response to the console
console.log(response)
}
main();
V3 Example Request
Same as V2
V2 <> V3 Mapping
V2 Parameter | V3 Parameter |
---|---|
openSea.floorPrice | openSea.floorPrice |
openSea.priceCurrency | openSea.priceCurrency |
openSea.collectionUrl | openSea.collectionUrl |
openSea.retrievedAt | openSea.retrievedAt |
openSea.error (New in V3) | |
looksRare.floorPrice | looksRare.floorPrice |
looksRare.priceCurrency | looksRare.priceCurrency |
looksRare.collectionUrl | looksRare.collectionUrl |
looksRare.retrievedAt | looksRare.retrievedAt |
looksRare.error (New in V3) |
Example Responses
V2 Example Response
{
openSea: {
floorPrice: 44.5,
priceCurrency: 'ETH',
collectionUrl: 'https://opensea.io/collection/boredapeyachtclub',
retrievedAt: '2023-06-19T00:07:11.601Z'
},
looksRare: {
floorPrice: 43.65,
priceCurrency: 'ETH',
collectionUrl: 'https://looksrare.org/collections/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
retrievedAt: '2023-06-19T00:07:11.639Z'
}
}
V3 Example Response
{
"openSea": {
"floorPrice": 24.979951,
"priceCurrency": "ETH",
"collectionUrl": "https://opensea.io/collection/boredapeyachtclub",
"retrievedAt": "2023-09-21T15:22:06.168Z",
"error": undefined
},
"looksRare": {
"floorPrice": 24.98,
"priceCurrency": "ETH",
"collectionUrl": "https://looksrare.org/collections/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"retrievedAt": "2023-09-21T15:22:06.097Z",
"error": undefined
}
}
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 parentcontract
object has been changed toopenSeaMetadata
in the V3 response. - The
collectionSlug
andbannerImageUrl
parameters have been added to thecontract.openSeaMetadata
object in V3. - The
title
parameter in V2 has been changed to an optionalname
parameter in V3. - The
media
parameter in V2 has been replaced with animage
object in V3. - The
blockHash
parameter has been removed in V3. - The
metadataError
in V2 has been replaced with theraw.error
parameter in the V3 response. - The
rawMetadata
object parameter has been changed to araw
object in V3, which contains thetokenUri
andmetadata
parameters - The
tokenUri
object in V2 has been changed to atokenUri
string parameter in V3. - The
isSpam
andclassifications
parameters forspamInfo
on V2 has been added to thecontract
object in V3. - The
mint
object parameter has been added to the V3 response containing optionalmintAddress?
,blockNumber?
,timestamp?
, andtransactionHash?
parameters. - The
collection
object has been added to the V3 response containing thename
,slug?
,externalUrl?
, andbannerImageUrl?
parameters. - The
validAt
object has been added to the V3 response. It contains theblockNumber
,blockHash
, andblockTimestamp
parameters. - The
acquiredAt
object has been added to the V3 response.
Example Requests
V2 Example Request
// Imports the Alchemy SDK
const { Alchemy, Network } = require("alchemy-sdk");
// Configures the Alchemy SDK
const config = {
apiKey: "alchemy-replit", // Replace with your API key
network: Network.ETH_MAINNET, // Replace with your network
};
// Creates an Alchemy object instance with the config to use for making requests
const alchemy = new Alchemy(config);
const main = async () => {
let owner = "vitalik.eth";
//Call the method to get the nfts owned by this address
let response = await alchemy.nft.getNftsForOwner(owner)
//Logging the response to the console
console.log(response)
};
main();
V3 Example Request
Same as V2.
V2 <> V3 Mapping
V2 Parameter | V3 Parameter |
---|---|
contract.address | contract.address |
contract.name | contract.name |
contract.symbol | contract.symbol |
contract.tokenType | contract.tokenType |
contract.contractDeployer | contract.contractDeployer |
contract.deployedBlockNumber | contract.deployedBlockNumber |
spamInfo.isSpam | contract.isSpam |
spamInfo.classifications | contract.spamClassifications |
contract.openSea.collectionName | contract.openSeaMetadata.collectionName |
- | contract.openSeaMetadata.collectionSlug (New in V3) |
contract.openSea.safelistRequestStatus | contract.openSeaMetadata.safelistRequestStatus |
contract.openSea.imageUrl | contract.openSeaMetadata.imageUrl |
contract.openSea.description | contract.openSeaMetadata.description |
contract.openSea.externalUrl | contract.openSeaMetadata.externalUrl |
- | contract.openSeaMetadata.bannerImageUrl (New in V3) |
contract.openSea.lastIngestedAt | contract.openSeaMetadata.lastIngestedAt |
tokenId | tokenId |
tokenType | tokenType |
tokenUri | tokenUri |
title | name |
description | description |
metadataError | raw.error |
rawMetadata | raw |
rawMetadata.metadata | raw.metadata |
rawMetadata.attributes | raw.metadata.attributes |
- | raw.tokenUri |
media | image |
spamInfo | (Removed in V3 and moved to contract ) |
- | collection (New in V3) |
- | mint (New in V3) |
balance | balance |
timeLastUpdated | timeLastUpdated |
- | validAt.blockNumber (New in V3) |
- | validAt.blockHash (New in V3) |
- | validAt.blockTimestamp (New in V3) |
pageKey | pageKey |
totalCount | totalCount |
blockHash | (Removed in V3) |
- | acquiredAt (New in V3) |
Example Responses
V2 Example Response
{
"ownedNfts": [
{
"contract": {
"address": "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
"name": "Bored Ape Nike Club",
"symbol": "BANC",
"tokenType": "ERC721",
"openSea": {
"collectionName": "BoredApeNikeClub",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
"externalUrl": "https://nikemetaverse.xyz",
"lastIngestedAt": "2023-07-15T19:05:35.000Z"
},
"contractDeployer": "0x51d7d428041e23ef51422e110dfeff906e821cfe",
"deployedBlockNumber": 14276343
},
"tokenId": "1",
"tokenType": "ERC721",
"title": "",
"description": "",
"timeLastUpdated": "2023-07-19T10:54:51.000Z",
"metadataError": "Contract returned a broken token uri",
"rawMetadata": {
"metadata": [],
"attributes": []
},
"tokenUri": {
"gateway": "http://api.nikeapenft.xyz/ipfs/1",
"raw": "http://api.nikeapenft.xyz/ipfs/1"
},
"media": [],
"spamInfo": {
"isSpam": true,
"classifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"balance": 26
},
{
"contract": {
"address": "0x000386e3f7559d9b6a2f5c46b4ad1a9587d59dc3",
"name": "Bored Ape Nike Club",
"symbol": "BANC",
"tokenType": "ERC721",
"openSea": {
"collectionName": "BoredApeNikeClub",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
"externalUrl": "https://nikemetaverse.xyz",
"lastIngestedAt": "2023-07-15T19:05:35.000Z"
},
"contractDeployer": "0x51d7d428041e23ef51422e110dfeff906e821cfe",
"deployedBlockNumber": 14276343
},
"tokenId": "2",
"tokenType": "ERC721",
"title": "",
"description": "",
"timeLastUpdated": "2023-07-19T10:54:50.978Z",
"metadataError": "Contract returned a broken token uri",
"rawMetadata": {
"metadata": [],
"attributes": []
},
"tokenUri": {
"gateway": "http://api.nikeapenft.xyz/ipfs/2",
"raw": "http://api.nikeapenft.xyz/ipfs/2"
},
"media": [],
"spamInfo": {
"isSpam": true,
"classifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"balance": 31
},
{
"contract": {
"address": "0x00703f9b11f2ac02d391a11e7b97c6ee80cd8563",
"name": "Elon Musk",
"symbol": "MUSK",
"tokenType": "ERC721",
"openSea": {
"collectionName": "ELON MUSK LICENSE",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/7O8H5tVTUPfi03LBY3xI29wkuzp8sSsRvr_BjOxXUfsU7mrkV7WxhOMedXKBp-dqDtCLjSfLwzWEMg6_yrxw8YPXC7OY9TqelDm9?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://elonmusknftworld.shop)",
"externalUrl": "https://elonmusknftworld.shop",
"lastIngestedAt": "2023-07-15T19:21:16.000Z"
},
"contractDeployer": "0x69a3c97428bad2c431a70b886d4d03b042df5670",
"deployedBlockNumber": 14268680
},
"tokenId": "5",
"tokenType": "ERC721",
"title": "",
"description": "",
"timeLastUpdated": "2023-07-19T10:54:51.011Z",
"metadataError": "Contract returned a broken token uri",
"rawMetadata": {
"metadata": [],
"attributes": []
},
"tokenUri": {
"gateway": "http://api.elonmusknfts.xyz/ipfs/5",
"raw": "http://api.elonmusknfts.xyz/ipfs/5"
},
"media": [],
"spamInfo": {
"isSpam": true,
"classifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"balance": 11
}
],
"pageKey": "MHgwMDcwM2Y5YjExZjJhYzAyZDM5MWExMWU3Yjk3YzZlZTgwY2Q4NTYzOjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNTpmYWxzZQ==",
"totalCount": 26525,
"blockHash": "0x7f9574679a4ee645fc34683464ee4c038cb968112c912cb7ddce46d5abdeac94"
}
V3 Example Response
{
"ownedNfts": [
{
"contract": {
"address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
"name": "Bored Ape Nike Club",
"symbol": "BANC",
"tokenType": "ERC721",
"contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
"deployedBlockNumber": 14276343,
"openSeaMetadata": {
"collectionName": "BoredApeNikeClub",
"collectionSlug": "bored-ape-nike-club-v2",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
"lastIngestedAt": "2023-09-11T13:59:53.000Z"
},
"isSpam": true,
"spamClassifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"tokenId": "1",
"tokenType": "ERC721",
"tokenUri": "http://api.nikeapenft.xyz/ipfs/1",
"image": {},
"raw": {
"tokenUri": "http://api.nikeapenft.xyz/ipfs/1",
"metadata": {}
},
"collection": {
"name": "BoredApeNikeClub",
"slug": "bored-ape-nike-club-v2",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
},
"mint": {},
"timeLastUpdated": "2023-09-20T12:18:35.890Z",
"balance": "26",
"acquiredAt": {}
},
{
"contract": {
"address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
"name": "Bored Ape Nike Club",
"symbol": "BANC",
"tokenType": "ERC721",
"contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
"deployedBlockNumber": 14276343,
"openSeaMetadata": {
"collectionName": "BoredApeNikeClub",
"collectionSlug": "bored-ape-nike-club-v2",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
"lastIngestedAt": "2023-09-11T13:59:53.000Z"
},
"isSpam": true,
"spamClassifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"tokenId": "2",
"tokenType": "ERC721",
"tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
"image": {},
"raw": {
"tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
"metadata": {},
"error": "Contract returned a broken token uri"
},
"collection": {
"name": "BoredApeNikeClub",
"slug": "bored-ape-nike-club-v2",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
},
"mint": {},
"timeLastUpdated": "2023-09-20T13:13:54.798Z",
"balance": "31",
"acquiredAt": {}
},
{
"contract": {
"address": "0x000386E3F7559d9B6a2F5c46B4aD1A9587D59Dc3",
"name": "Bored Ape Nike Club",
"symbol": "BANC",
"tokenType": "ERC721",
"contractDeployer": "0x51D7D428041E23ef51422e110dfEfF906e821CFe",
"deployedBlockNumber": 14276343,
"openSeaMetadata": {
"collectionName": "BoredApeNikeClub",
"collectionSlug": "bored-ape-nike-club-v2",
"safelistRequestStatus": "not_requested",
"imageUrl": "https://i.seadn.io/gae/yJ9DgXqjRwgdCkrQmHj7krCbixM8fPVAyYJWJ5NHXap1L0c3QL5MPvrNT0QDINIStGOK857lOvab8MpNQS9X4pkHPktmhVmN82qoVw?w=500&auto=format",
"description": "COUNTDOWN OVER. MINTING LIVE.\n\n[Mint on the website.](https://nikemetaverse.xyz)\n",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format",
"lastIngestedAt": "2023-09-11T13:59:53.000Z"
},
"isSpam": true,
"spamClassifications": [
"OwnedByMostHoneyPots",
"Erc721TooManyOwners",
"Erc721TooManyTokens",
"NoSalesActivity",
"HighAirdropPercent",
"HighHoneyPotPercent",
"HoneyPotsOwnMultipleTokens"
]
},
"tokenId": "2",
"tokenType": "ERC721",
"tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
"image": {},
"raw": {
"tokenUri": "http://api.nikeapenft.xyz/ipfs/2",
"metadata": {}
},
"collection": {
"name": "BoredApeNikeClub",
"slug": "bored-ape-nike-club-v2",
"externalUrl": "https://nikemetaverse.xyz",
"bannerImageUrl": "https://i.seadn.io/gae/i84LsC2dtbF5I3YiuaXzzfvSijlBI-ZJ8UEta04Ukl4V57Uoj0ZGw8tNyuPdwrF7N5pclyzdqSJjxHZ65z4G5jQrVRK_DHUMVrzTYQ?w=500&auto=format"
},
"mint": {},
"timeLastUpdated": "2023-09-18T11:02:14.698Z",
"balance": "31",
"acquiredAt": {}
},
],
"pageKey": "MHgwMDcwM2Y5YjExZjJhYzAyZDM5MWExMWU3Yjk3YzZlZTgwY2Q4NTYzOjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNTpmYWxzZQ==",
"totalCount": 26585,
"validAt": {
"blockNumber": 18162406,
"blockHash": "0x670957987df0a8d0838a05a25d8a1945fbeea24f547a4e59e748c42a12d7cfce",
"blockTimestamp": "2023-09-18T11:02:47Z"
}
}
Get the NFT metadata associated with the provided parameters.
Overview of Changes
- The
openSea
object in the parentcontract
object has been changed toopenSeaMetadata
in the V3 response. - The
contract
object in the V3 response now includes new parameters calledisSpam
andspamClassifications
. - The
isSpam
andclassifications
parameters forspamInfo
on V2 has been added to thecontract
object in V3. - The
collectionSlug
andbannerImageUrl
parameters have been added to thecontract.openSeaMetadata
object in V3. - The
title
parameter in V2 has been changed to an optionalname
parameter in V3. - The
media
parameter in V2 has been replaced with animage
object in V3. - The
rawMetadata.attributes
parameter has been removed and changed toraw.metadata.attributes
in the V3 response. - The
rawMetadata
object parameter has been changed to araw
object in V3 response, which contains thetokenUri
,error
andmetadata
parameters - The
tokenUri
object in V2 has been changed to atokenUri
string parameter in the V3 response. - The
mint
object parameter has been added to the V3 response containing optionalmintAddress?
,blockNumber?
,timestamp?
, andtransactionHash?
parameters. - The
collection
object has been added to the V3 response containing thename
,slug?
,externalUrl?
, andbannerImageUrl?
parameters.
Example Requests
V2 Example Request
// Imports the Alchemy SDK
const { Alchemy, Network } = require("alchemy-sdk");
// Configures the Alchemy SDK
const config = {
apiKey: "alchemy-replit", // Replace with your API key
network: Network.ETH_MAINNET, // Replace with your network
};
// Creates an Alchemy object instance with the config to use for making requests
const alchemy = new Alchemy(config);
const main = async () => {
let owner = "0xe785E82358879F061BC3dcAC6f0444462D4b5330";
let tokenId = 44;
//Call the method to get the nfts owned by this address
let response = await alchemy.nft.getNftMetadata(owner, tokenId)
//Logging the response to the console
console.log(response)
};
main();
V3 Example Request
Same as V2.
V2 <> V3 Mapping
V2 Parameter | V3 Parameter |
---|---|
contract.address | contract.address |
contract.name | contract.name |
contract.symbol | contract.symbol |
contract.tokenType | contract.tokenType |
contract.contractDeployer | contract.contractDeployer |
contract.deployedBlockNumber | contract.deployedBlockNumber |
spamInfo.isSpam | contract.isSpam |
spamInfo.classifications | contract.spamClassifications |
contract.openSea.floorPrice | contract.openSeaMetadata.floorPrice |
contract.openSea.collectionName | contract.openSeaMetadata.collectionName |
- | contract.openSeaMetadata.collectionSlug (New in V3) |
contract.openSea.safelistRequestStatus | contract.openSeaMetadata.safelistRequestStatus |
contract.openSea.imageUrl | contract.openSeaMetadata.imageUrl |
contract.openSea.description | contract.openSeaMetadata.description |
contract.openSea.externalUrl | contract.openSeaMetadata.externalUrl |
- | contract.openSeaMetadata.bannerImageUrl (New in V3) |
contract.openSea.lastIngestedAt | contract.openSeaMetadata.lastIngestedAt |
tokenId | tokenId |
tokenType | tokenType |
tokenUri | tokenUri |
title | name |