Features

Fetching a Core Collection

Last updated April 8, 2026

fetchCollection retrieves a Core Collection account from Solana by its address and deserialises it into a typed object.

Summary

fetchCollection reads a Collection account and returns all its onchain fields — name, URI, update authority, plugin data, and member counts.

  • Requires the collection's public key
  • Returns a typed Collection object with all onchain fields
  • Throws if the address is not a valid Collection account

Fetching a Collection by Address

Pass the collection's public key to fetchCollection to retrieve the account.

Fetch a Core Collection

fetch-collection.ts
import { fetchCollection } from '@metaplex-foundation/mpl-core'
import { publicKey } from '@metaplex-foundation/umi'
const collectionId = publicKey('11111111111111111111111111111111')
const collection = await fetchCollection(umi, collectionId)
console.log(collection)

Notes

  • fetchCollection throws if the address does not exist or is not a Core Collection account
  • currentSize reflects the live count of Assets in the collection; numMinted is the all-time total
  • To verify state after a write, call fetchCollection after sendAndConfirm

Quick Reference

ItemValue
JS functionfetchCollection
Required argCollection public key
ReturnsCollection object
SourceGitHub