Get XDC Balance for a Single Address
Returns the XDC balance of a given address.
https://api-testnet.xdcscan.com/api
?module=account
&action=balance
&address=0xD8Ea779b8FFC1096CA422D40588C4c0641709890
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser
Sample Response
{
"status": "1",
"message": "OK",
"result": "1000000000000000"
}
Get XDC Balance for Multiple Addresses in a Single Call
Returns the balance of the accounts from a list of addresses.
https://api-testnet.xdcscan.com/api
?module=account
&action=balancemulti
&address=0xD8Ea779b8FFC1096CA422D40588C4c0641709890,0x3C352eA32DFBb757CCdf4b457E52daF6eCC21917,0xA7E4EF0a9e15bDEf215E2ed87AE050f974ECD60b
&apikey=YourApiKeyToken
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"account": "0xD8Ea779b8FFC1096CA422D40588C4c0641709890",
"balance": "120676999073987283387101"
},
{
"account": "0x3C352eA32DFBb757CCdf4b457E52daF6eCC21917",
"balance": "8469241817024271831192"
},
{
"account": "0xA7E4EF0a9e15bDEf215E2ed87AE050f974ECD60b",
"balance": "8456235008214121957004"
}
]
}
Get a list of 'Normal' Transactions By Address
Returns the list of transactions performed by an address, with optional pagination.
https://api-testnet.xdcscan.com/api
?module=account
&action=txlist
&address=0xD8Ea779b8FFC1096CA422D40588C4c0641709890
&startblock=0
&endblock=latest
&page=1
&offset=2
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "1590025",
"timeStamp": "1698948338",
"hash": "0xb58763a7ea4ae68964867bc39c1e8420fe21fb50c6e0e3974626a1e61c97731c",
"nonce": "0",
"blockHash": "0x5868dfa101f53079cf2cd6279e0d5bc0f84f5d0dbc2be6e0c1bc396ca8133d2d",
"transactionIndex": "1",
"from": "0xd8ea779b8ffc1096ca422d40588c4c0641709890",
"to": "0xd8ea779b8ffc1096ca422d40588c4c0641709890",
"value": "1000000000000000000000",
"gas": "100000",
"gasPrice": "0",
"isError": "0",
"txreceipt_status": "1",
"input": "0x",
"contractAddress": "",
"cumulativeGasUsed": "71501",
"gasUsed": "21000",
"confirmations": "1749007",
"methodId": "0x",
"functionName": ""
},
{
"blockNumber": "1593622",
"timeStamp": "1698955532",
"hash": "0x680d0b76940a906d3efeb7e5be5e75ae194b04295efe00f218bb3287ca82c5a4",
"nonce": "1",
"blockHash": "0xe8e57a4ee79e96c2053b3a340a9788af2bd0adc93fceee09759035c6f3a2d5f5",
"transactionIndex": "1",
"from": "0xd8ea779b8ffc1096ca422d40588c4c0641709890",
"to": "0x385dbb7ce3eff942254a554ad44e67f7d4130586",
"value": "100000000000000000000",
"gas": "21000",
"gasPrice": "1500000050",
"isError": "0",
"txreceipt_status": "1",
"input": "0x",
"contractAddress": "",
"cumulativeGasUsed": "84965",
"gasUsed": "21000",
"confirmations": "1745410",
"methodId": "0x",
"functionName": ""
}
]
}
Get a list of 'Internal' Transactions by Address
Returns the list of internal transactions performed by an address, with optional pagination.
https://api-testnet.xdcscan.com/api
?module=account
&action=txlistinternal
&address=0x2C7A1CaAC34549ef4D6718ECCF3120AC2f74Df5C
&startblock=0
&endblock=latest
&page=1
&offset=2
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "2187819",
"timeStamp": "1700143926",
"hash": "0xef440aa6d8b09e5338c1c02651fbf59f98fffd8648d0058b331069dae7b287c2",
"from": "0x9a792d8e485a5417dd42d71fa5d58510e59c2ae0",
"to": "0x2c7a1caac34549ef4d6718eccf3120ac2f74df5c",
"value": "50000000000000000",
"contractAddress": "",
"input": "",
"type": "self-destruct",
"gas": "0",
"gasUsed": "0",
"traceId": "0_1_1_1",
"isError": "0",
"errCode": ""
},
{
"blockNumber": "2719782",
"timeStamp": "1701207852",
"hash": "0xd5999c2b3250c67fe182854f4a57b939d2267b9aa3506ed01694f055377732c9",
"from": "0x861d4a5733008c32cceb50cebace0ea29b7ab9a3",
"to": "0x2c7a1caac34549ef4d6718eccf3120ac2f74df5c",
"value": "11",
"contractAddress": "",
"input": "",
"type": "call",
"gas": "2300",
"gasUsed": "0",
"traceId": "0_1",
"isError": "0",
"errCode": ""
}
]
}
Get 'Internal Transactions' by Transaction Hash
Returns the list of internal transactions performed within a transaction.
Note : This API endpoint returns a maximum of 10000 records only.
https://api-testnet.xdcscan.com/api
?module=account
&action=txlistinternal
&txhash=0x1464fe536813fe2b87f8f828e89749c5667ecaa1bc0017f6ce3d55ae28f70cb2
&apikey=YourApiKeyToken
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "2742805",
"timeStamp": "1701253898",
"from": "0x861d4a5733008c32cceb50cebace0ea29b7ab9a3",
"to": "0x2c7a1caac34549ef4d6718eccf3120ac2f74df5c",
"value": "11",
"contractAddress": "",
"input": "",
"type": "call",
"gas": "2300",
"gasUsed": "0",
"isError": "0",
"errCode": ""
}
]
}
The isError
field returns 0
for successful transactions and 1
for rejected/cancelled transactions.
Get "Internal Transactions" by Block Range
Returns the list of internal transactions performed within a block range, with optional pagination.
https://api-testnet.xdcscan.com/api
?module=account
&action=txlistinternal
&startblock=0
&endblock=latest
&page=1
&offset=2
&sort=asc
&apikey=YourApiKeyToken
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "478231",
"timeStamp": "1696724750",
"hash": "0x54c0619c0f7f387c9cfc20b754d7f3c0b3942cf98d4005443d6238927771d3d4",
"from": "0x4200000000000000000000000000000000000007",
"to": "0x4200000000000000000000000000000000000010",
"value": "10000000000000000",
"contractAddress": "",
"input": "",
"type": "call",
"gas": "404963",
"gasUsed": "25131",
"traceId": "0_1_1",
"isError": "0",
"errCode": ""
},
{
"blockNumber": "478231",
"timeStamp": "1696724750",
"hash": "0x54c0619c0f7f387c9cfc20b754d7f3c0b3942cf98d4005443d6238927771d3d4",
"from": "0x4200000000000000000000000000000000000010",
"to": "0x24a1704636ab7083eac56294aff13e1651997638",
"value": "10000000000000000",
"contractAddress": "",
"input": "",
"type": "call",
"gas": "367885",
"gasUsed": "0",
"traceId": "0_1_1_1_1",
"isError": "0",
"errCode": ""
}
]
}
The isError
field returns 0
for successful transactions and 1
for rejected/cancelled transactions.
Get a list of 'ERC20 - Token Transfer Events' by Address
Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract.
https://api-testnet.xdcscan.com/api
?module=account
&action=tokentx
&contractaddress=0x35FD47E1324A6c4fAE96DF7fBff1Ed9689C1808E
&address=0x7d0d1f76b34eddf60283f001982fee13ebc6ec0e
&page=1
&offset=2
&startblock=0
&endblock=99999999
&sort=asc
&apikey=YourApiKeyToken
Usage:
ERC-20 transfers from an address, specify the address
parameter
ERC-20 transfers from a contract address, specify the contract address
parameter
ERC-20 transfers from an address filtered by a token contract, specify both address
and contract address
parameters.
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "3308107",
"timeStamp": "1702384502",
"hash": "0x366b9c4b852b4659bc360dcfa416fbf10198db4f4c2bbe40a9c59169741700c7",
"nonce": "0",
"blockHash": "0xfe353d2644ad4c18071a4152bb5a8c7035c90ad622e6a4ae53827fb2dba8a16c",
"from": "0x0000000000000000000000000000000000000000",
"contractAddress": "0x35fd47e1324a6c4fae96df7fbff1ed9689c1808e",
"to": "0x7d0d1f76b34eddf60283f001982fee13ebc6ec0e",
"value": "1000000000000000000000",
"tokenName": "Nodo Gem",
"tokenSymbol": "NDG",
"tokenDecimal": "18",
"transactionIndex": "1",
"gas": "328606",
"gasPrice": "1000254",
"gasUsed": "162203",
"cumulativeGasUsed": "209116",
"input": "deprecated",
"confirmations": "31214"
},
{
"blockNumber": "3308109",
"timeStamp": "1702384506",
"hash": "0xc08ac1352055b226e1d601bce6810aa44c36a07c5de1ecb61fc9d73e1b1dfccb",
"nonce": "1",
"blockHash": "0xd557840de209a74127ae4266eee37f55398a8e6a2c3d03e48b71caf7b0afd198",
"from": "0x0000000000000000000000000000000000000000",
"contractAddress": "0x35fd47e1324a6c4fae96df7fbff1ed9689c1808e",
"to": "0x7d0d1f76b34eddf60283f001982fee13ebc6ec0e",
"value": "1000000000000000000000",
"tokenName": "Nodo Gem",
"tokenSymbol": "NDG",
"tokenDecimal": "18",
"transactionIndex": "2",
"gas": "189636",
"gasPrice": "1000254",
"gasUsed": "93803",
"cumulativeGasUsed": "165304",
"input": "deprecated",
"confirmations": "31212"
}
]
}
Get a list of 'ERC721 - Token Transfer Events' by Address
Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract
https://api-testnet.xdcscan.com/api
?module=account
&action=tokennfttx
&contractaddress=0x7238cE8EEcACA4949284A3F0b7625068f49801D4
&address=0xd2f235b03056b9439d86d91ba890598aaaad7c85
&page=1
&offset=2
&startblock=0
&endblock=99999999
&sort=asc
&apikey=YourApiKeyToken
Usage:
ERC-721 transfers from an address, specify the address
parameter
ERC-721 transfers from a contract address, specify the contract address
parameter
ERC-721 transfers from an address filtered by a token contract, specify both address
and contract address
parameters.
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"blockNumber": "3240431",
"timeStamp": "1702249150",
"hash": "0x723e7208cf95de895d2e86b4c4c2336892aa87d862dc3466d1f2118e34918a41",
"nonce": "1",
"blockHash": "0xda701dbd188b43532e522dbc7f1538ca07d04217d60aad347e71f9385b1d45dc",
"from": "0x0000000000000000000000000000000000000000",
"contractAddress": "0x7238ce8eecaca4949284a3f0b7625068f49801d4",
"to": "0xd2f235b03056b9439d86d91ba890598aaaad7c85",
"tokenID": "0",
"tokenName": "Test 5",
"tokenSymbol": "Te",
"tokenDecimal": "0",
"transactionIndex": "1",
"gas": "479193",
"gasPrice": "1000000254",
"gasUsed": "479193",
"cumulativeGasUsed": "543194",
"input": "deprecated",
"confirmations": "98928"
},
{
"blockNumber": "3240431",
"timeStamp": "1702249150",
"hash": "0x723e7208cf95de895d2e86b4c4c2336892aa87d862dc3466d1f2118e34918a41",
"nonce": "1",
"blockHash": "0xda701dbd188b43532e522dbc7f1538ca07d04217d60aad347e71f9385b1d45dc",
"from": "0x0000000000000000000000000000000000000000",
"contractAddress": "0x7238ce8eecaca4949284a3f0b7625068f49801d4",
"to": "0xd2f235b03056b9439d86d91ba890598aaaad7c85",
"tokenID": "1",
"tokenName": "Test 5",
"tokenSymbol": "Te",
"tokenDecimal": "0",
"transactionIndex": "1",
"gas": "479193",
"gasPrice": "1000000254",
"gasUsed": "479193",
"cumulativeGasUsed": "543194",
"input": "deprecated",
"confirmations": "98928"
}
]
}