BSC Querying API

About Binance Smart Chain

Binance Chain was launched in April 2019 with a focus on providing fast decentralized trading. Due to flexibility limitations, the Binance Chain evolved to the Binance Smart Chain which got launched in September 2020. Today, BSC is arguably one of the fastest-growing chains, which is gaining a lot of traction because of its intriguing features compared to the other chains

Key Aspects:

  • BSC generated $15 million & $24 billion in terms of transaction volumes in January and February 2021 respectively (exponential rise)

  • BSC is the third largest chain with more than 50,000 unique active wallets

  • PancakeSwap is only 12,000 users behind Uniswap in terms of unique active wallets

Unmarshal's Current Infrastructure Support

  • Token Balances API

  • Transaction API

  • Decoded Transactions API

  • Push Notification API (In Progress)

  • DeFi Taxing (In progress)

  • Profit & Loss Tracking API (In progress)

  • Historical Prices (In progress)

  • Automated DeFi protocol indexing(In progress)

get
Get Token Balance

https://stg-api.unmarshal.io/v1/bsc/address/:address/assets
Description This endpoint allows you to retrieve balance tied to a particular address. The response of this API will include everything you need to make sense of your assets. You can see what is the current value of each token, and how much your assets are worth in fiat currency. We also have built a CDN for logos. Eg: Fetch Balances by address for BSC https://stg-api.unmarshal.io/v1/bsc/address/0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA/assets?auth_key=VGVtcEtleQ%3D%3D
Request
Response
Request
Path Parameters
address
required
string
Vaild BSC address
Query Parameters
auth_key
required
string
Demo key: VGVtcEtleQ==
Response
200: OK
[
{
"contract_name": "PancakeSwap Token",
"contract_ticker_symbol": "Cake",
"contract_decimals": 18,
"contract_address": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"coin": 10000714,
"type": "BEP20",
"balance": "47799999999995300000",
"quote": 1598.699201999843,
"quote_rate": 33.44559,
"logo_url": "https://exchange.pancakeswap.finance/images/coins/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82.png"
},
{
"contract_name": "ALICE",
"contract_ticker_symbol": "ALICE",
"contract_decimals": 6,
"contract_address": "0xAC51066d7bEC65Dc4589368da368b212745d63E8",
"coin": 10000714,
"type": "BEP20",
"balance": "8121648",
"quote": 74.737410943056,
"quote_rate": 9.202247,
"logo_url": "https://exchange.pancakeswap.finance/images/coins/0xAC51066d7bEC65Dc4589368da368b212745d63E8.png"
},
{
"contract_name": "IoTeX Network",
"contract_ticker_symbol": "IOTX",
"contract_decimals": 18,
"contract_address": "0x9678E42ceBEb63F23197D726B29b1CB20d0064E5",
"coin": 10000714,
"type": "BEP20",
"balance": "41831238146331205632",
"quote": 1.5842744823160015,
"quote_rate": 0.037873,
"logo_url": "https://exchange.pancakeswap.finance/images/coins/0x9678E42ceBEb63F23197D726B29b1CB20d0064E5.png"
}
]
‚Äč

get
Get Token Transactions

https://stg-api.unmarshal.io/v1/bsc/address/:address/assets
Description Retrieves all transactions of the particular address. Unmarshal has the best in class decoders to extract the meaning out of just a function call to the smart contract. Our decoder decodes the transaction into Send, Receive, Approve, Stake, UnStake, Add Liquidity, Remove Liquidity, etc. Optional Query Parameters: -> page: specifies the page of the returned transaction, starting from 1. -> pageSize: Number of transaction returned by API call (by default 1000), returns in the order of recent transactions Eg: Fetch all transactions by address for BSC https://stg-api.unmarshal.io/v1/bsc/address/0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA/transactions?auth_key=VGVtcEtleQ%3D%3D&page=1&pageSize=10
Request
Response
Request
Path Parameters
address
required
string
Valid BSC address
Query Parameters
auth_key
required
string
Demo key: VGVtcEtleQ==
Response
200: OK
{
"page": 1,
"total_pages": 4797,
"items_on_page": 10,
"total_txs": 47961,
"transactions": [
{
"id": "0x04da92855224cc01e06e542f75c0911c364fd16e6bebbab2aaf8369272463dbf",
"from": "0xe27e9b5DCE16174d02b9C950432222aAe1e9f990",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619415008,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0x1962103781030a309cd848b142bbee97d8d3c6899fb25a53cc60b5b33c4e98d2",
"from": "0xEfda1534a9b74E5e8E6d242F8F9413a694E27Db4",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "342480000000000",
"date": 1619414456,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0xf16c51deffc483c0d0c8bcd3ebe67b89a001f3541d88d63ecba9339af56897cc",
"from": "0xc6daB09eDc7aB9D0bd625cc760Adf4C4b00240A1",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619412306,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0xf161f0ac0128a5a24b27bfdbc13617954cd7650a8c8d76970c7afa526cb2974a",
"from": "0x949Ddd9511Dac0A16E6cA87667231dA819F2Ef6D",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "285400000000000",
"date": 1619411086,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0xf4521adb420ef665d1fc1e4ab5da3930940ea2f2ca6d051e94292121bef6ea95",
"from": "0x5624430EffeAC4439E811B890dA094F5F0907A70",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "285400000000000",
"date": 1619410936,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0xe8fb00b6801c7b0fcc00420087749dd2594c8ae6fcc5afdf8e06bc7c3503dd86",
"from": "0x7aF1f06F80f987c06C9EeDF8e856a550aC06C02B",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619408053,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0x2dba55ffa1fe7285a87993848735977934aba11ef1758e9a3180b4dd899f0063",
"from": "0xf4e71b4F810BFECBD5d5A3e4b6ca5C9400714258",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619407315,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0xe3c2863058939ccc57dc75859cb0c37705732a5707421703bd0aa1edecf5dedb",
"from": "0xCdC8D9cadd55137b07107a3F5f00F74D545efbeb",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619406172,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0x8ae9a538d8282940959a54c5257bde8a66015966e3736ab33cc3d0a6e9c46407",
"from": "0x81f140a8eB7905520d30910bF1166B7096715ba3",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619402567,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
},
{
"id": "0x0c62f2870c7745967e34d53c49129258081d2daf2ebeb17b90cf1da1cb574cd7",
"from": "0x214a337117Ff85BFFc730Ea8ec617655853fE2eE",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619402099,
"status": "completed",
"type": "receive",
"value": "0",
"description": "Received 0 BNB",
"received": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
}
]
}

get
Get Transaction Detail

https://stg-api.unmarshal.io/v1/bsc/transactions/:txID
Description Get the details of a single transaction through transaction hash. Eg: Fetch particular transaction details by transaction Hash from BSC https://stg-api.unmarshal.io/v1/bsc/transactions/0x63455a16b9072471271f93fdde4ebadd83e47342a12855287887c00973d92093?auth_key=VGVtcEtleQ%3D%3D
Request
Response
Request
Path Parameters
txID
required
string
Valid BSC transaction ID
Query Parameters
auth_key
required
string
Demo key: VGVtcEtleQ==
Response
200: OK
{
"id": "0x63455a16b9072471271f93fdde4ebadd83e47342a12855287887c00973d92093",
"from": "0x55F496cd532669EFC127148340a7e5F4EED97CdB",
"to": "0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA",
"fee": "360400000000000",
"date": 1619375618,
"status": "completed",
"type": "send",
"value": "0",
"description": "Sent 0 BNB",
"sent": [
{
"name": "Binance Smart Chain",
"symbol": "BNB",
"token_id": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"value": "0"
}
]
}