Skip to content
Tokens created with the Metaplex Token Metadata Program have a metadata account that stores the token’s name, symbol, URI, and other information. The metadata account is a PDA derived from the mint address.
These examples read the metadata of mainnet tokens, which exists only on mainnet. Run them against a Surfpool local network that forks mainnet (surfpool start --network mainnet fetches the accounts on demand), or point the RPC URL at a mainnet endpoint.
The Kit examples use the Metaplex Token Metadata client. Install it together with @solana-program/token, which the client loads but doesn’t declare as a dependency:
@metaplex-foundation/mpl-token-metadata-kit 0.0.3 is built on Kit 6. It runs with Kit 8, but TypeScript reports the RPC types as incompatible until you resolve it onto your Kit version in package.json, then delete node_modules and package-lock.json and run npm install again:

​Fetch Metadata for a Single Token

​Fetch Offchain JSON Metadata

The uri field in the onchain metadata points to a JSON file containing extended metadata like the image URL, description, and attributes.
Not all tokens have Metaplex Token Metadata. Tokens using Token Extensions (Token-2022) may store metadata directly on the mint using the metadata extension. See Token Extensions Metadata.