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
Collectionobject 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
fetchCollectionthrows if the address does not exist or is not a Core Collection accountcurrentSizereflects the live count of Assets in the collection;numMintedis the all-time total- To verify state after a write, call
fetchCollectionaftersendAndConfirm
Quick Reference
| Item | Value |
|---|---|
| JS function | fetchCollection |
| Required arg | Collection public key |
| Returns | Collection object |
| Source | GitHub |
