> ## 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 Internal Transactions for a Wallet Address

> Learn how to fetch internal transactions (contract calls and ETH transfers between contracts) for any wallet using the Moralis API.

## Introduction

In this tutorial, you'll learn how to retrieve internal transactions for any wallet address using the Moralis API. Internal transactions are calls made between smart contracts during a transaction's execution, including ETH transfers from contracts. These are not visible in standard transaction lists but are important for tracking the complete flow of funds. We'll use the following Moralis API endpoint:

* [Get Decoded Transactions](/data-api/evm/wallet/decoded-transactions) - Fetch transactions with internal calls and detailed execution data

## 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-internal-transactions && cd get-internal-transactions
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';

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

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

getInternalTransactions();
```

Replace `YOUR_API_KEY` with your actual Moralis API key.

## Step 3: Run the Script

Execute the script to fetch the internal transactions:

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

## Example Response

```json theme={null}
{
  "page_size": 100,
  "page": 1,
  "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "result": [
    {
      "hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21d29f3e2c2f10c82e12c",
      "nonce": "1848059",
      "transaction_index": "73",
      "from_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
      "to_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "value": "100000000000000000",
      "gas": "30000",
      "gas_price": "22434567890",
      "receipt_cumulative_gas_used": "4923073",
      "receipt_gas_used": "21000",
      "receipt_status": "1",
      "block_timestamp": "2023-01-01T01:28:23.000Z",
      "block_number": "16308190",
      "block_hash": "0x3c6d5e2a1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b",
      "internal_transactions": [
        {
          "transaction_hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21d29f3e2c2f10c82e12c",
          "block_number": 16308190,
          "block_hash": "0x3c6d5e2a1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b1b2b",
          "type": "CALL",
          "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
          "value": "100000000000000000",
          "gas": "2300",
          "gas_used": "0",
          "input": "0x",
          "output": "0x"
        }
      ]
    }
  ]
}
```

## Understanding the Response

| Field                         | Description                                              |
| ----------------------------- | -------------------------------------------------------- |
| `hash`                        | Parent transaction hash                                  |
| `from_address`                | Address that initiated the transaction                   |
| `to_address`                  | Address the transaction was sent to                      |
| `value`                       | ETH value transferred (in wei)                           |
| `receipt_status`              | Transaction status (1 = success, 0 = failed)             |
| `block_timestamp`             | When the transaction was mined                           |
| `internal_transactions`       | Array of internal calls within this transaction          |
| `internal_transactions.type`  | Type of internal call (CALL, CREATE, DELEGATECALL, etc.) |
| `internal_transactions.from`  | Address initiating the internal call                     |
| `internal_transactions.to`    | Address receiving the internal call                      |
| `internal_transactions.value` | ETH value transferred internally (in wei)                |

## Next Steps

* [Get Wallet History](/data-api/evm/wallet/wallet-history) - Get complete transaction history
* [Get Transaction by Hash](/data-api/evm/blockchain/transaction-by-hash-decoded) - Get specific transaction details
