> ## 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.

# How to Get Native Token Balances for EOAs and Smart Accounts

> Learn how to fetch native token balances (ETH, MATIC, BNB) for any wallet address using the Moralis API.

## 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](/data-api/evm/wallet/native-balance) - Fetch the native token balance for any wallet

## Prerequisites

* Node.js v18+ installed
* A Moralis API key ([get one free](https://admin.moralis.io))

## Step 1: Set Up Your Project

Create a new directory for your project and initialize it:

```bash theme={null}
mkdir get-native-balance && cd get-native-balance
npm init -y
```

## Step 2: Create the Script

Create a file called `index.js` and add the following code:

```javascript theme={null}
// index.js
const API_KEY = 'YOUR_API_KEY';
const WALLET_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Vitalik's wallet

async function getNativeBalance() {
  const response = await fetch(
    `https://deep-index.moralis.io/api/v2.2/${WALLET_ADDRESS}/balance?chain=eth`,
    {
      headers: {
        'X-API-Key': API_KEY,
      },
    }
  );

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

getNativeBalance();
```

Replace `YOUR_API_KEY` with your actual Moralis API key.

## Step 3: Run the Script

Execute the script to fetch the native balance:

```bash theme={null}
node index.js
```

## Example Response

```json theme={null}
{
  "balance": "2847583920000000000000"
}
```

## Understanding the Response

| Field     | Description                                     |
| --------- | ----------------------------------------------- |
| `balance` | The native token balance in wei (smallest unit) |

To convert to a human-readable format, divide by 10^18:

```javascript theme={null}
const balanceInEth = Number(data.balance) / 1e18;
console.log(`Balance: ${balanceInEth} ETH`);
```

## Next Steps

* [Get Token Balances](/data-api/evm/wallet/token-balances) - Fetch ERC20 token balances
* [Get Multi-Chain Activity](/data-api/evm/wallet/chain-activity) - See activity across chains
