Introduction
In this tutorial, you’ll learn how to retrieve native token balances (like ETH, MATIC, or BNB) for any wallet address using the Moralis API. This works for both externally owned accounts (EOAs) and smart contract wallets like Safe or Argent. We’ll use the following Moralis API endpoint:- Get Native Balance - Fetch the native token balance 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 native balance:Example Response
Understanding the Response
| Field | Description |
|---|---|
balance | The native token balance in wei (smallest unit) |
Next Steps
- Get Token Balances - Fetch ERC20 token balances
- Get Multi-Chain Activity - See activity across chains

