Introduction
In this tutorial, you’ll learn how to retrieve the full transaction history for any wallet address using the Moralis API. This includes all transactions, token transfers, NFT transfers, and internal transactions in a single, unified timeline. This works for both externally owned accounts (EOAs) and smart contract wallets. We’ll use the following Moralis API endpoint:- Get Wallet History - Fetch the complete transaction history for any wallet
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 wallet history:Example Response
Understanding the Response
| Field | Description |
|---|---|
hash | Transaction hash |
from_address | Sender’s wallet address |
from_address_label | Known label for sender |
to_address | Recipient’s wallet address |
to_address_label | Known label for recipient |
value | Native token amount in wei |
receipt_status | Transaction status (1 = success) |
block_timestamp | When the transaction was mined |
category | Type of transaction (send, receive, token send, etc.) |
summary | Human-readable transaction summary |
erc20_transfers | ERC20 token transfers in this transaction |
nft_transfers | NFT transfers in this transaction |
native_transfers | Native token transfers |
Next Steps
- Get Token Balances - Fetch current balances
- NFT Balances - Fetch NFTs by wallet
- Get Multi-Chain Activity - See cross-chain activity

