Moralis-Python-SDK

balance API:

evm_api.balance


get_native_balance

evm_api.balance.get_native_balance()

Get the native balance for a specific wallet address.

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e", 
    "chain": "eth", 
    "to_block": 1.2, 
}

result = evm_api.balance.get_native_balance(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
address str The address from which the native balance will be checked Yes   “0x057Ec652A4F150f7FF94f089A38008f49a0DF88e”
chain enum[str]:
- “eth”
- “0x1”
- “goerli”
- “0x5”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “mumbai”
- “0x13881”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base testnet”
- “0x14a33”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
The chain to query   “eth” “eth”
to_block float The block number up to which the balances will be checked.     1.2

get_native_balances_for_addresses

evm_api.balance.get_native_balances_for_addresses()

Get the native balances for a set of specific addresses

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "wallet_addresses": [], 
    "chain": "eth", 
    "to_block": 1.2, 
}

result = evm_api.balance.get_native_balances_for_addresses(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
wallet_addresses List of str The addresses to get metadata for Yes   []
chain enum[str]:
- “eth”
- “0x1”
- “goerli”
- “0x5”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “mumbai”
- “0x13881”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base testnet”
- “0x14a33”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
The chain to query   “eth” “eth”
to_block float The block number on which the balances should be checked     1.2