1

I was wondering if there was a way to get the metadata for NFT tokens minted through the Metaplex standard? I was able to find the data for Solana fungible tokens using the code listed below and I want to find the same kind of data but just for Metaplex NFTs.

import { TokenListProvider } from '@solana/spl-token-registry';

function App() {
new TokenListProvider().resolve().then((tokens) => {
  const tokenList = tokens.filterByClusterSlug('mainnet-beta').getList();
  console.log(tokenList);
})
};

export default App;

2 Answers 2

2

Yep you can use the Helius API to get all token metadata! See the docs for nft metadata. You can get an API key here

Some example code for how to do this

const axios = require('axios')

const url = "https://api.helius.xyz/v0/tokens/metadata?api-key=<your-key>"
const nftAddresses = [
  "BAAzgRGWY2v5AJBNZNFd2abiRXAUo56UxywKEjoCZW2",
  "8s6kQUZfdm7GSaThAcsmSs56wMinXrbk6SdNVngutrz5"
] // Monkes
const getMetadata = async () => {
  const { data } = await axios.post(url, { mintAccounts: nftAddresses})
  console.log("metadata: ", data)
}
getMetadata()
1

Use the findByMint method from the Metaplex SDK: https://github.com/metaplex-foundation/js#findByMint enter image description here

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.