nr_getTransactionByAddress

This API method helps you to get transfers for any fromAddress, toAddress, contractAddress, etc.

📘

Supported on BSC and ETH mainnet only.

Parameters

  • category A list of category identifiers. Supported values include "external", "20", "721", and "1155".

    • external refers 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.
  • fromBlock A hexadecimal block number or "latest". If both fromBlock and toBlock are provided, their range must be no more than 1000 blocks. If only fromBlock is provided, toBlock is auto-filled as fromBlock + 1000.

  • toBlock A hexadecimal block number or "latest". If both are provided, difference must be ≤ 1000 blocks. If only toBlock is provided, fromBlock is auto-filled as toBlock - 1000.

  • address - address, must not be null

  • addressType - option: from, to, contract, null if all of addressType

  • order Sorting order, either "asc" or "desc".

  • maxCount Hex-encoded integer specifying max number of returned results. Maximum allowed value: 0x3E8 (1000 decimal).

  • pageKey A UUID used for pagination. Omit for the first request; include it to fetch subsequent pages.

Returns

  • PageKey - string, page key for next page query
  • transfers - details
    • category - external or internal
    • blockNum - number
    • from - string, from addresss
    • to - string, to address
    • value - hexadecimal string, raw transfer value
    • erc721TokenId - 32-byte fixed-length hexadecimal string
    • erc1155MetaData - string, page key for next page query
      • tokenId - hexadecimal string
      • value - 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 hash
    • contractAddress - contract address (hex string). null if external transfer
    • decimal - 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 originated
    • gasPrice - gas price for external transfer, not return when category is others
    • gasUsed - gas used for external transfer, not return when category is others
    • receiptsStatus - 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
      }
    ]
  }
}