This endpoint allows you to retrieve balance tied to a particular address on a specific chain.The response of this API will let you understand in details about all your assets.
Filters:
Get All Assets Without dust tokens
Dust filtering, where if verified is specified as true it returns only verified tokens removing all dust tokens. (verified query parameter accepts true or false)
Get Assets in requested chain
Chain Id Filtering for kadena chain, Returns assets available on a particular chain (0-19)
Get a particular token balance across all chains
Token Filtering for kadena chain, Returns token balance across all chains (0-19). Combination of both token and chainID can be passed which return the balance of a requested token in a requested chain, If address does not start with k: or w: then both chainId and token should be passed
Get aggregated balance across all chains
Aggregated balance for kadena Returns the aggregated balance across all chains
import Unmarshal, {Chain} from "@unmarshal/sdk";
const unmarshal = new Unmarshal({apiKey: "YOUR_API_KEY_GOES_HERE"});
unmarshal.WalletApi
.getTokenBalances(Chain.ethereum, "demo.eth")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/address/:address/assets?verified=false&chainId=false&token=false&auth_key=YOUR_API_KEY_HERE'
[- {
- "contract_name": "BNB",
- "contract_ticker_symbol": "BNB",
- "contract_decimals": 18,
- "contract_address": "0xb8c77482e45f1f44de1745f52c74426c631bdd52",
- "coin": 60,
- "type": "ERC20",
- "balance": "1000107409683556863",
- "quote": 0,
- "quote_rate": 0,
- "quote_rate_24h": "0",
- "quote_pct_change_24h": 0
}, - {
- "contract_name": "string",
- "contract_ticker_symbol": "string",
- "contract_decimals": 0,
- "contract_address": "string",
- "coin": 0,
- "type": "string",
- "balance": "string",
- "quote": 0,
- "quote_rate": 0,
- "logo_url": "string",
- "quote_rate_24h": "string",
- "quote_pct_change_24h": 0
}, - {
- "contract_name": "Ethereum",
- "contract_ticker_symbol": "ETH",
- "contract_decimals": 18,
- "contract_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "coin": 60,
- "type": "ERC20",
- "balance": "1030533275139623654",
- "quote": 4417.751875865047,
- "quote_rate": 4286.86,
- "quote_rate_24h": "6.33",
- "quote_pct_change_24h": 0.14783
}
]
This endpoint allows you to retrieve assets tied to a particular address on a specific chain.The response of this API is returned in a paginated format with an offset value.
Note:
To fetch items on the next page, pass next_offset value of current page as the offset.
For Kadena and Solana, all assets will be returned in a single response.
Filters:
Get All Assets Without dust tokens
Dust filtering, where if verified is specified as true it returns only verified tokens removing all dust tokens. (verified query parameter accepts true or false)
Get Assets in requested chain
Chain Id Filtering for kadena chain, Returns assets available on a particular chain (0-19)
Get a particular token balance across all chains
Token Filtering for kadena chain, Returns token balance across all chains (0-19). Combination of both token and chainID can be passed which return the balance of a requested token in a requested chain, If address does not start with k: or w: then both chainId and token should be passed
Get aggregated balance across all chains
Aggregated balance for kadena Returns the aggregated balance across all chains
import Unmarshal, {Chain} from "@unmarshal/sdk";
const unmarshal = new Unmarshal({apiKey: "YOUR_API_KEY_GOES_HERE"});
unmarshal.WalletApi
.getTokenBalances(Chain.ethereum, "demo.eth")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v2/:chain/address/:address/assets?verified=false&chainId=false&token=false&pageSize=5&offset=0&auth_key=YOUR_API_KEY_HERE'
{- "items_on_page": 5,
- "next_offset": 5,
- "assets": [
- {
- "contract_name": "Tether USD",
- "contract_ticker_symbol": "USDT",
- "contract_decimals": 6,
- "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "coin": 60,
- "type": "ERC20",
- "balance": "9858287165",
- "quote": 9868.145452165,
- "quote_rate": 1.001,
- "quote_rate_24h": "0.00047874",
- "quote_pct_change_24h": 0.04786,
- "verified": true,
- "coin_gecko_id": "tether"
}, - {
- "contract_name": "Frontier Token",
- "contract_ticker_symbol": "FRONT",
- "contract_decimals": 18,
- "contract_address": "0xf8c3527cc04340b208c854e985240c02f7b7793f",
- "coin": 60,
- "type": "ERC20",
- "balance": "4843997835959514312853",
- "quote": 839.5568609306671,
- "quote_rate": 0.173319,
- "quote_rate_24h": "-0.002736091749376252",
- "quote_pct_change_24h": -1.55411,
- "verified": true,
- "coin_gecko_id": "frontier-token"
}, - {
- "contract_name": "Ethereum",
- "contract_ticker_symbol": "ETH",
- "contract_decimals": 18,
- "contract_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "coin": 60,
- "type": "ERC20",
- "balance": "567414931501599473",
- "quote": 689.2162206977329,
- "quote_rate": 1214.66,
- "quote_rate_24h": "28.01",
- "quote_pct_change_24h": 2.36082,
- "verified": true,
- "coin_gecko_id": "ethereum"
}, - {
- "contract_name": "USD Coin",
- "contract_ticker_symbol": "USDC",
- "contract_decimals": 6,
- "contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
- "coin": 60,
- "type": "ERC20",
- "balance": "647245836",
- "quote": 647.218004429052,
- "quote_rate": 0.999957,
- "quote_rate_24h": "-0.00065697685964683",
- "quote_pct_change_24h": -0.06566,
- "verified": true,
- "coin_gecko_id": "usd-coin"
}, - {
- "contract_name": "SuperRare",
- "contract_ticker_symbol": "RARE",
- "contract_decimals": 18,
- "contract_address": "0xba5bde662c17e2adff1075610382b9b691296350",
- "coin": 60,
- "type": "ERC20",
- "balance": "1157000000000000000000",
- "quote": 115.23372900000001,
- "quote_rate": 0.099597,
- "quote_rate_24h": "-0.002663093775851985",
- "quote_pct_change_24h": -2.60424,
- "verified": true,
- "coin_gecko_id": "superrare"
}
]
}
The profit loss endpoint provide the profit or loss made by an address for a given token.
unmarshal.WalletApi
.getProfitAndLoss(Chain.ethereum, "demo.eth", "token-address")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v2/:chain/address/:address/userData?contract=string&auth_key=YOUR_API_KEY_HERE'
{- "quote_rate": 1.88,
- "total_fees_paid": 0.00408196,
- "total_fees_paid_usd": 12.35876252184,
- "average_token_price": 0.6777538233562116,
- "overall_profit_loss": 1390.998826376863,
- "current_holding_quantity": 1157,
- "percentage_change_24H": 3.87773,
- "price_change_24H": 81.37875199999999
}
This endpoint allows you to retrieve the total token holders for a given token contract address.
unmarshal.WalletApi
.getTokenHoldersCount(Chain.ethereum, "token address")
.then(({data}) => console.log(data))
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/token-address/:address/holders-count?auth_key=YOUR_API_KEY_HERE'
{- "token_holders_count": "3367"
}
This endpoint returns the Top Holders of a token. This is supported on the ethereum and polygon chains currently.
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/:chain/contract/:contract/top-holders?auth_key=YOUR_API_KEY_HERE'
{- "token_address": "0x5a666c7d92e5fa7edcb6390e4efd6d0cdd69cf37",
- "top_holders": [
- {
- "address": "0x56ee84baf54c472e206e06c29de8c494d0f120ba",
- "balance": 62285000.00206402
}, - {
- "address": "0xef38f0cdfe4df26c0da27c9347b870cd4207a897",
- "balance": 14963898.77438037
}, - {
- "address": "0xf16e9b0d03470827a95cdfd0cb8a8a3b46969b91",
- "balance": 4250251.844552843
}, - {
- "address": "0x738cf6903e6c4e699d1c2dd9ab8b67fcdb3121ea",
- "balance": 2282080.1403131136
}, - {
- "address": "0xfc270414a3dd54bb649f83349fb783182eab8610",
- "balance": 2004448.7302565863
}, - {
- "address": "0x3bee11d70e5a25b16520286a7053e84dff2e0f5d",
- "balance": 1794300.5638183085
}, - {
- "address": "0x9c5de3ad97b95a0da09fd0de84c347db450cd75c",
- "balance": 1483756.7605084442
}, - {
- "address": "0xd0365271d8f74b7a0c8a0099aace8e1bbd701c78",
- "balance": 1000000
}, - {
- "address": "0x0d0707963952f2fba59dd06f2b425ace40b492fe",
- "balance": 911049.7347293429
}, - {
- "address": "0x63ac48561c36933c4d810a537601508929e95d87",
- "balance": 594990
}, - {
- "address": "0x06d8f188ce3a5d341e6d276ed49f88baf264e9fb",
- "balance": 500000
}, - {
- "address": "0xd4b69e8d62c880e9dd55d419d5e07435c3538342",
- "balance": 499990.0000000007
}, - {
- "address": "0xa5d4aeddf4ffb8f5ded3576c58ef345da2ca375d",
- "balance": 499933.00190000003
}, - {
- "address": "0x410aa0b164db233eb40e857d34a9f581d3f7019c",
- "balance": 372839.35504563997
}, - {
- "address": "0x11fb41e49f29a306a8a01a4d0e198902c9e6d241",
- "balance": 268797
}, - {
- "address": "0x4a5bb1c9347a0d4f7e06a29239162f03647d9232",
- "balance": 253999.9999037037
}, - {
- "address": "0x4c87a5806079d54f48e791a6b565d9646f0e48f4",
- "balance": 226897.38548444546
}, - {
- "address": "0xc7fcdf23cfd8e65dbf412f04070d45eca1bb5025",
- "balance": 206075.23155926
}, - {
- "address": "0x4d24eececb86041f47bca41265319e9f06ae2fcb",
- "balance": 160517.50135227005
}, - {
- "address": "0x0ca90ac1c97fc3679df07e1ae5c20e4349c79b37",
- "balance": 158991.00000000026
}
], - "holders_count": 4070
}