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”
- “avalanche testnet”
- “0xa869”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “cronos testnet”
- “0x152”
- “arbitrum”
- “0xa4b1”
The chain to query   “eth” “eth”
to_block float The block number from which the balances should 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", 
    "providerUrl": "", 
    "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”
- “avalanche testnet”
- “0xa869”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “cronos testnet”
- “0x152”
- “arbitrum”
- “0xa4b1”
The chain to query   “eth” “eth”
providerUrl str The web3 provider URL to use when using local dev chain     ””
to_block float The block number on which the balances should be checked     1.2