Documentation Index
Fetch the complete documentation index at: https://docs.moralis.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
In this tutorial, you’ll learn how to retrieve all NFTs owned by a wallet address using the Moralis API. This works for both ERC721 and ERC1155 tokens and includes metadata, images, and collection information. This is essential for building NFT galleries, portfolio trackers, or wallet applications. We’ll use the following Moralis API endpoint:- Get Wallet NFTs - Fetch all NFTs owned by a wallet address
Prerequisites
- Node.js v18+ installed
- A Moralis API key (get one free)
Step 1: Set Up Your Project
Create a new directory for your project and initialize it:Step 2: Create the Script
Create a file calledindex.js and add the following code:
YOUR_API_KEY with your actual Moralis API key.
Step 3: Run the Script
Execute the script to fetch the NFTs:Example Response
Understanding the Response
| Field | Description |
|---|---|
token_address | The NFT collection contract address |
token_id | The unique token ID within the collection |
amount | Quantity owned (relevant for ERC1155) |
contract_type | Token standard (ERC721 or ERC1155) |
name | Collection name |
symbol | Collection symbol |
metadata | NFT metadata (name, image, attributes) |
possible_spam | Whether the NFT is flagged as spam |
verified_collection | Whether the collection is verified |
floor_price | Current floor price in native token |
floor_price_usd | Floor price in USD |
Next Steps
- Get NFT Metadata - Get detailed NFT metadata
- Get NFT Floor Prices - Fetch collection floor prices
- NFT Metadata - explore detailed metadata
- NFT Media Images (CDN) - learn how we store NFT images

