Metadata Normalization
Through our NFT APIs, you have the option to receive either a normalized or non-normalized NFT metadata.
To use this feature, simply set normalizeMetadata
parameter to true
.
- index.js (JavaScript)
- index.ts (TypeScript)
- index.py (Python)
const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");
const chain = EvmChain.ETHEREUM;
const address = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB";
const tokenId = "1";
await Moralis.start({
apiKey: "<YOUR_API_KEY>",
// ...and any other configuration
});
const response = await Moralis.EvmApi.nft.getNFTMetadata({
address,
chain,
tokenId,
normalizeMetadata: true,
});
console.log(response.toJSON());
import Moralis from "moralis";
import { EvmChain } from "@moralisweb3/common-evm-utils";
const chain = EvmChain.ETHEREUM;
const address = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB";
const tokenId = "1";
await Moralis.start({
apiKey: "<YOUR_API_KEY>",
// ...and any other configuration
});
const response = await Moralis.EvmApi.nft.getNFTMetadata({
address,
chain,
tokenId,
normalizeMetadata: true,
});
console.log(response.toJSON());
from moralis import evm_api
api_key = "YOUR_API_KEY"
params = {
"chain": "ethereum",
"address": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
"tokenId": "1",
}
result = aptos_api.coins.get_coins_by_coin_type_hashes(
api_key=api_key,
params=params,
)
print(result)
This feature is available in the following NFT APIs: