๐งโ
๐งโ
๐งโ
๐งโ
Moralis
Forum
Moralis.io
Searchโฆ
๐งโ
๐งโ
๐งโ
๐งโ
Moralis
๐
Introduction
Why use Moralis?
Our community
Prerequisites
Contribute to Docs
๐ง
Platform
๐
Getting Started
๐ฎ
Connect with SDK
๐ฅ
Users
๐ธ
Transfer Assets
๐ช
Web3 API
โ
Solana API
โ
Supported Networks
๐ฐ
SolanaAPI.account
๐ผ
SolanaAPI.nft
โป
Automatic Sync
๐
Database
โ
Cloud Code
โ
Web3
๐
Files
๐งฐ
Tools
๐
Plugins
๐ฅ
Speedy Nodes
What Are Speedy Nodes?
Connecting to RPC Nodes
๐จโ๐ณ Tutorials
Fiat Gateway Tutorial
Token Swaps (DEX) Tutorial
Create and Launch Own NFTs
Create NFT Game From Scratch
Token Price Charts
Learning BSC Programming From Scratch
๐Guides
Build a Simple dApp in 3 Minutes - Setup (Part 1)
Deploy and Track ERC-20 Events
Misc
FAQ
Troubleshooting
Billing & Rate Limits
Change Log
License
Powered By
GitBook
๐ผ
SolanaAPI.nft
You can query NFTs and get their metadata on Solana
All the methods extend from
Moralis.SolanaAPI.nft
getNFTMetadata
Returns the metadata of a SPL NFT.
Options:
network
: The network cluster to get data from. Valid values are listed on the
Supported Networks
. Default value
mainnet
.
address
: A SPL NFT address (i.e.
HsXZnAba2...
).
JS
React
curl
Unity
1
// get devnet metadata for a given SPL NFT address
2
const
options
=
{
3
network
:
"devnet"
,
4
address
:
"6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe"
,
5
};
6
const
nftMetadata
=
await
Moralis
.
SolanaAPI
.
nft
.
getNFTMetadata
(
options
);
Copied!
1
import
{
useMoralisSolanaApi
,
useMoralisSolanaCall
}
from
"react-moralis"
;
2
โ
3
const
{
nft
}
=
useMoralisSolanaApi
();
4
โ
5
// get devnet SPL NFT metadata for a given address
6
const
options
=
{
7
network
:
"devnet"
,
8
address
:
"6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe"
,
9
};
10
const
{
fetch
,
data
,
isLoading
}
=
useMoralisSolanaCall
(
11
nft
.
getNFTMetadata
,
12
options
13
);
Copied!
1
curl
-X
'GET'
\
2
'https://solana-gateway.moralis.io/nft/devnet/6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe/metadata'
\
3
-H
'accept: application/json'
\
4
-H
'X-API-Key: MY-API-KEY'
Copied!
1
using
MoralisUnity
;
2
using
MoralisUnity
.
SolanaApi
.
Models
;
3
using
UnityEngine
;
4
โ
5
public
class
Example
6
{
7
// get mainnet metadata for a given SPL NFT address
8
public
async
void
GetSPLNftMetadata
()
9
{
10
NftMetadata
nftmetadata
=
await
Moralis
.
SolanaApi
.
Nft
.
GetNFTMetadata
(
NetworkTypes
.
mainnet
,
"6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe"
);
11
Debug
.
Log
(
nftmetadata
);
12
}
13
}
Copied!
Example result:
1
{
2
"mint"
:
"string"
,
3
"standard"
:
"string"
,
4
"name"
:
"string"
,
5
"symbol"
:
"string"
,
6
"metaplex"
:
{
7
"metadataUri"
:
"string"
,
8
"masterEdition"
:
true
,
9
"isMutable"
:
true
,
10
"primarySaleHappened"
:
true
,
11
"sellerFeeBasisPoints"
:
0
,
12
"updateAuthority"
:
"string"
13
}
14
}
Copied!
Previous
SolanaAPI.account
Next - Platform
Automatic Sync
Last modified
16d ago
Copy link
Contents
getNFTMetadata