9

Hello to fetch all the NFTs in a collection using the symbol of the collection. Is any API available that provides the data?

2 Answers2

1

https://docs.metaplex.com/programs/token-metadata/certified-collections is probably what you are looking for. But the standard doesn't work for older Solana NFTs. To upload a "collection", people literally need to upload a list of mint addresses of an entire collection ...

noooooooob
  • 1,872
  • 3
  • 21
  • 27
-1

Here's a simplest example by using Mataplex.JS

import { Metadata } from "@metaplex-foundation/mpl-token-metadata";
import { Connection } from "@solana/web3.js";

const connectionMetaplex = new Connection(
"https://api.metaplex.solana.com",
"confirmed"
);
const walletAddress = "6vRx1iVZo3xfrBHdpvuwArL2jucVj9j9nLpd2VUTTGMG"
const nftsmetadata = await Metadata.findDataByOwner(connectionMetaplex, walletAddress);
console.log(nftsmetadata);
  "dependencies": {
    "@metaplex-foundation/mpl-core": "^0.0.5",
    "@metaplex-foundation/mpl-token-metadata": "^1.2.5",
    "@project-serum/anchor": "^0.22.1",
    "@solana/buffer-layout": "^4.0.0",
    "@solana/spl-token": "^0.2.0",
    "@solana/web3.js": "^1.36.0"
  }
Pang
  • 9,564
  • 146
  • 81
  • 122
RammusXu
  • 1,180
  • 1
  • 7
  • 21
  • I've tried public & private endpoints, but this seems to only work with the API link you provided. Do you know why? – Lemon Apr 06 '22 at 15:10
  • 10
    This retrieves the metadata of token accounts owned by a certain wallet, not the token accounts in a collection. – oriont Apr 12 '22 at 01:43