Hedera
Search…
Get NFT info
A query that returns information about a non-fungible token (NFT). You request the info for an NFT by specifying the NFT ID.
Requesting NFT info by Token ID or Account ID is deprecated.
The request returns the following information:
Item
Description
NFT ID
The ID of the non-fungible token in x.y.z format.
Account ID
The account ID of the current owner of the NFT
Creation Time
The effective consensus timestamp at which the NFT was minted
Metadata
Represents the unique metadata of the NFT
Constructor
Description
new TokenNftInfoQuery()
Initializes the TokenNFTInfoQuery object
1
new TokenNftInfoQuery()
Copied!

Methods

V2
V1
Method
Type
Description
Requirement
setNftId(<nftId>)
​NftId​
Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on a NFT for a given TokenID (of type NON_FUNGIBLE_UNIQUE) and serial number.
Optional
Java
1
//Returns the info for the specified NFT ID
2
List<TokenNftInfo> nftInfos = new TokenNftInfoQuery()
3
.setNftId(nftId)
4
.execute(client);
5
​
6
//v2.0.14
Copied!
JavaScript
1
//Returns the info for the specified NFT ID
2
const nftInfos = await new TokenNftInfoQuery()
3
.setNftId(nftId)
4
.execute(client);
5
​
6
//v2.0.28
Copied!
Go
1
//Returns the info for the specified NFT ID
2
nftInfo, err := NewTokenNftInfoQuery().
3
SetNftID(nftID).
4
Execute(client)
5
​
6
//v2.1.16
Copied!
​
Method
Type
Description
Requirement
byNftId(<nftId>)
​NftId​
Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on a NFT for a given TokenID (of type NON_FUNGIBLE_UNIQUE) and serial number.
Optional
Java
1
//Returns the info for the specified NFT ID
2
List<TokenNftInfo> nftInfos = new TokenNftInfoQuery()
3
.byNftId(nftId)
4
.execute(client);
5
6
//v1.5.0
Copied!
JavaScript
1
//Returns the info for the specified NFT ID
2
const nftInfos = await new TokenNftInfoQuery()
3
.byNftId(nftId)
4
.execute(client);
5
​
6
//v1.4.10
Copied!
​
Last modified 3mo ago
Copy link
Contents
Methods