Get total balance (including tokens)

how can i get total address balance (in best case USD or ETH) including tokens?
address: 0xaF5DfB1CF63e05a09D06237e6C2F7f85Cff17699

This address also contains token, and I don’t want to make two separate API calls with
/adress/balance and /adress/erc20

Hi,

We don’t have an API call that can return that value directly. You may need do more than two calls, for example when the token has a different price than 1 USD per token (to get the token price).

Hi,

thank you for the fast respond.

do you also know if there is any historical data? so e.g. for an address the balance of the last 90 days

you can use to_block parameter to get the balance from a particular block number. And there is an API endpoint to convert a date to a block number (GET /dateToBlock in https://admin.moralis.io/web3Api interface)

great - thank you :slight_smile:
i will try it the next days.

1 Like

Hi,
now i get the Balance of a Address (eth) + Balance of token - For example 12,3 MANA (decentraland).

How can i get the current price in usd or eur.
I did not found an api call to get current value of token or ethereum in usd. What Options do i have?

Regards

You can use getTokenPrice.

hi glad,

thank you for the respond. but this just works with Token right? I am not able to get balance in USD/EUR for a public Address (containing eth).

You have to use 2 api requests to get that value in usd for an address, first to get the native balance for that address and then to use get token price to know the price in usd for that native token ( you will have to use the address of the wrapped version of that native token)

1 Like

alright - thank you :slight_smile:

hi,

with /{address}/erc20 i get this informations about the token:
name
symbol
logo
balance

if i want to know these informations about the native token (example eth) i use /{address}/balance and just get:
balance

Do you know how i can get logo, symbol etc. from the native token (eth) for the address?

You can look up the symbols used for native currency like ETH or AVAX. The chain logo you can get and display yourself.

How can i get it? Which api call?

I meant you can just statically specify the symbols or codes. They don’t change. E.g. ETH, AVAX, FTM. If you’re using data from eth, use ETH, avalanche, use AVAX, etc.