Query details about a specific NFT by its NFT ID, including owner, metadata, and any spender allowance, with TokenNftInfoQuery.
A query that returns information about a non-fungible token (NFT). You request the info for an NFT by specifying the NFT ID.Token AllowancesOnly when a spender is set on an explicit NFT ID of a token, we return the spender ID in the TokenNftInfoQuery for the respective NFT. If approveTokenNftAllowanceAllSerials is used to approve all NFTs for a given token class and no NFT ID is specified, we will not return a spender ID for all the serial numbers of that token.
For obtaining NFT information and historical data, consider using the Mirror Node REST API endpoint Get NFT Info which offers several advantages:
Cost-effective and scalable:Mirror node providers offer paid plans with a large number of queries included. The Hedera-hosted mirror node offers free queries with specific throttles for testing. While some SDK queries are currently free, these are subject to change in the future.
Performance: Mirror nodes don’t burden consensus nodes, allowing them to focus on processing transactions and providing efficient access to historical data without impacting network performance.
Historical data: Mirror nodes store complete transaction history, records, and events - ideal for analytics, auditing, and monitoring past activity.
Requesting NFT info by Token ID or Account ID is deprecated.
The request returns the following information:
Item
Description
NFT ID
The unique ID of a non-fungible token composed of the token ID and serial number in the format: <shardNum>.<realmNum>.<tokenNum>/<serialNum> (e.g., 0.0.1234/1).
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
Ledger ID
The ID of the network (mainnet, testnet, previewnet). Reference HIP-198.
Spender ID
The spender account ID for the NFT. This is only returned if the NFT ID was specifically approved.