Query NFTs
Use client.nft('<network>') for NFT API v3 methods. The network selector is
a typed literal such as 'ethereum', 'base', or 'polygon'.
NFTs Owned By A Wallet
from alchemy import Alchemy
async with Alchemy.new() as client:
nfts = await client.nft('ethereum').get_nfts_for_owner(
owner='0x1E6E8695FAb3Eb382534915eA8d7Cc1D1994B152',
page_size=2,
with_metadata=True,
)
print(nfts['ownedNfts'])
NFTs In A Contract
from alchemy import Alchemy
async with Alchemy.new() as client:
nfts = await client.nft('ethereum').get_nfts_for_contract(
contract_address='0xe785E82358879F061BC3dcAC6f0444462D4b5330',
limit=2,
with_metadata=True,
)
print(nfts['nfts'])