This API method helps you to get transfers for any fromAddress, toAddress, contractAddress, etc.
Supported on BSC and ETH mainnet only.
Parameters
-
categoryA list of category identifiers. Supported values include"external","20","721", and"1155".externalrefers specifically to normal transactions, the same meaning as Etherscan’s “Normal Transactions”. This includes native coin transfers (e.g., BNB/ETH) between EOAs, or contract interactions that do not emit ERC-20/721/1155 transfer events."20"indicates ERC-20 transfer events."721"indicates ERC-721 NFT transfer events."1155"indicates ERC-1155 transfer events.
-
fromBlockA hexadecimal block number or"latest". If bothfromBlockandtoBlockare provided, their range must be no more than 1000 blocks. If onlyfromBlockis provided,toBlockis auto-filled asfromBlock + 1000. -
toBlockA hexadecimal block number or"latest". If both are provided, difference must be ≤ 1000 blocks. If onlytoBlockis provided,fromBlockis auto-filled astoBlock - 1000. -
address- address, must not be null -
addressType- option: from, to, contract, null if all of addressType -
orderSorting order, either"asc"or"desc". -
maxCountHex-encoded integer specifying max number of returned results. Maximum allowed value:0x3E8(1000 decimal). -
pageKeyA UUID used for pagination. Omit for the first request; include it to fetch subsequent pages.
Returns
PageKey- string, page key for next page querytransfers- detailscategory- external or internalblockNum- numberfrom- string, from addresssto- string, to addressvalue- hexadecimal string, raw transfer valueerc721TokenId- 32-byte fixed-length hexadecimal stringerc1155MetaData- string, page key for next page querytokenId- hexadecimal stringvalue- hexadecimal string, raw transfer value
asset- ETH/BNB or the token's symbol. null if not defined in the contract and not available from other sources.hash- string, transaction hashcontractAddress- contract address (hex string). null if external transferdecimal- contract decimal (hex string). null if not defined in the contract and not available from other sources.blockTimestamp- timestamp of the block from which the transaction event originatedgasPrice- gas price for external transfer, not return when category is othersgasUsed- gas used for external transfer, not return when category is othersreceiptsStatus- receipt status, 1 is success,0 is failed
API Endpoint
The format of a MegaNode API endpoint is https://{chain}-{network}.nodereal.io/v1/{API-key}
Here is an example:
https://bsc-mainnet.nodereal.io/v1/4c0a1c23661a4e26bcbcwed461e34ea9
For other chains or networks, you could refer to this guidance Find API key & endpoint.
Example
Request
curl https://eth-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nr_getTransactionByAddress","params":[{"category": ["external","20"],"addressType": "from","address": "0xd7cdba6d6fa60a0aa9518dc0dacd0ad896cc02bd","order": "asc","excludeZeroValue": false,"maxCount": "0x5","fromBlock": "0x4","toBlock": "0x615856d7","pageKey": "qg000000-0075-RyKy-efk2-Fx9n32gAu432"}],"id":1}'
Result
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"pageKey": "qh000000-0X5j-WSqq-mCLq-kPfWRH8B1GPS",
"transfers": [
{
"category": "external",
"blockNum": "0x6c92dd",
"from": "0x646eafba97ec6ee7631887cdee468b323dd65d4f",
"to": "0x8f07f7312f3ede8b0094f09ab1554c8d89f47ddf",
"value": "0x0",
"asset": "BNB",
"hash": "0xf7605ce61c1855348cde8512d752265a8cbbf57e0ac4c8bc259155f8c1592838",
"blockTimeStamp": 1620089457,
"gasPrice": 5000000000,
"gasUsed": 35813,
"receiptsStatus": 1
}
]
}
}