Migrating from Bscscan
1. How to Migrate from BscScan to BscTrace
Migrating from BscScan APIs to BscTrace/MegaNode requires switching from REST-based, module/action-style endpoints to JSON-RPC 2.0 calls (and MegaNode Enhanced APIs for transfers, token data, holders, etc.).
BscScan-style APIs rely heavily on:
- HTTP GET
- Query parameters
- Human-oriented response wrappers (
status,message,result)
BscTrace/MegaNode rely on:
- JSON-RPC 2.0
- POST requests with structured method calls
- Direct blockchain-native return values (hex-encoded Wei, raw RPC objects)
This guide illustrates the differences clearly and provides concrete examples.
2. API Call Example — Getting Native Balance
This section shows the migration from BSCScan/Etherscan V2 balance API to MegaNode (JSON-RPC).
We break the example into:
- cURL Comparison
- Request Structure Comparison
- Response Comparison
- Summary of Key Differences
2.1 cURL Comparison
A) BscScan / Etherscan V2 (REST GET)
curl "https://api.etherscan.io/v2/api?apikey=YOUR_API_KEY&chainid=56&module=account&action=balance&address=0xfF3f428583c15a5681584e9e5e86e270418AC4d3&tag=latest"B) BscTrace / MegaNode (JSON-RPC POST)
curl -X POST https://bsc-mainnet.nodereal.io/v1/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0xfF3f428583c15a5681584e9e5e86e270418AC4d3",
"latest"
],
"id": 1
}'2.2 Request Structure Comparison
| Aspect | BscScan / Etherscan V2 | BscTrace / MegaNode |
|---|---|---|
| Protocol | REST (HTTP GET) | JSON-RPC 2.0 (HTTP POST) |
| Base URL | https://api.etherscan.io/v2/api | https://bsc-mainnet.nodereal.io/v1/<API_KEY> |
| Authentication | apikey=... query param | API key embedded in endpoint URL |
| Chain Selection | Requires chainid=56 | Chain-specific endpoint, no chainid needed |
| Request Format | Query parameters: module=account&action=balance... | JSON: { "method": "eth_getBalance", "params": [...] } |
| Method Naming | BscScan-style: module + action | Standard RPC methods (eth_*) |
| Error Handling | status: "0" in JSON | JSON-RPC error object |
| HTTP Method | GET | POST |
2.3 Response Comparison
A) BscScan / Etherscan V2 Response
{
"status": "1",
"message": "OK",
"result": "0"
}Notable characteristics:
- Contains wrapper fields:
status,message resultis stringified Wei, decimal- API is not purely blockchain-native; it is a browser-style wrapper
B) BscTrace / MegaNode JSON-RPC Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x18b907bc31ae8172d100e0"
}Notable characteristics:
- Pure JSON-RPC 2.0 format
resultis hexadecimal Wei (0x-prefixed)- No wrapper fields (
status,message) - Directly compatible with Ethereum RPC tooling
2.4 Key Differences
| Difference | BscScan / Etherscan V2 | BscTrace / MegaNode |
|---|---|---|
| Data Encoding (Balance) | Decimal string (Wei) | Hexadecimal (Wei) |
| Interface Abstraction | Browser-style API | Native blockchain RPC |
| HTTP Method | GET | POST |
| Parameters | Query params | JSON body |
| Result Parsing | Must convert decimal Wei | Must convert hex Wei |
| Chain Selection | Explicit (chainid) | Implicit via endpoint |
3. Quick Tip: Searching for API
Users can quickly locate API methods using the built-in documentation search.
Navigate to: https://docs.nodereal.io → API Reference → Jump To → Search Here
This allows users to instantly find:
- RPC methods
- Enhanced APIs (
nr_*) - Trace-related APIs
- Token, asset, holder, and NFT endpoints
4. Supported API
I. Account Module APIs
The following APIs under the Account module can be mapped to MegaNode's supported methods, often involving standard RPC calls or MegaNode's enhanced asset/transfer APIs.
| BSCScan API Name | MegaNode Equivalent / Notes | Additional Information |
|---|---|---|
| Get Native Balance for an Address | eth_getBalance | NA |
| Get Historical Native Balance for an Address | eth_getBalance with block parameter (requires archive node). | Retrieves the balance at a given block height. |
| Get Blocks Validated by Address | Query blocks using eth_getBlockByNumber and check miner/author field. Requires indexing historical data. | Retrieves the list of blocks validated by an address. |
| Get Normal Transactions By Address | nr_getAssetTransfers | Retrieves transaction history with pagination. |
| Get ERC20 Token Transfers by Address | nr_getAssetTransfers | Retrieves ERC-20 token transfers. |
| Get ERC721 Token Transfers by Address | nr_getAssetTransfers | Retrieves ERC-721 token transfers. |
| Get ERC1155 Token Transfers by Address | nr_getAssetTransfers | Retrieves ERC-1155 token transfers. |
| Get Internal Transactions by Address | nr_getAssetTransfers | Retrieves internal transaction history with pagination. |
| Get Internal Transactions by Block Range | nr_getAssetTransfers | Returns internal transactions within a block range. |
| Get Internal Transactions by Transaction Hash | nr_getAssetTransfers | Retrieves internal transactions within a specific transaction. |
| Get Address Funded By | Trace creation transaction or use eth_getLogs for transfers (requires historical index, confirmed not supported by current enhanced-API). | Retrieves the address and transaction that first funded a specific address. |
II. Token Module APIs
Token-related queries are supported either via direct eth_call on the contract methods (totalSupply, balanceOf) or via MegaNode's enhanced APIs for aggregated data and holders/inventory.
| BSCScan API Name | Description | MegaNode Equivalent / Notes |
|---|---|---|
| Get ERC20-Token TotalSupply by ContractAddress | Returns ERC-20 total supply. | nr_getTotalSupply20 |
| Get ERC20-Token Account Balance for TokenContractAddress | Retrieves ERC-20 balance for an address. | nr_getTokenBalance20 |
| Get Historical ERC20-Token TotalSupply by ContractAddress & BlockNo | Historical total supply. | nr_getTotalSupply20 |
| Get Historical ERC20-Token Account Balance by BlockNo | Historical ERC-20 balance. | nr_getTokenBalance20 |
| Get Top Token Holders | Returns list of top holders. | nr_getTokenHolders |
| Get Token Holder List by Contract Address | Retrieves current token holders. | nr_getTokenHolders |
| Get Token Holder Count by Contract Address | Retrieves count of token holders. | nr_getTokenHolderCount (Enhanced API, note: not real-time, maybe hours latency). |
| Get Token Info by ContractAddress | Retrieves basic token info. | nr_getTokenMeta (Enhanced API) for basic meta-data (name/symbol). |
| Get Address ERC20 Token Holding | Retrieves ERC-20 balance. | nr_getTokenHoldings |
| Get Address ERC721 Token Holding | Retrieves ERC-721 tokens owned by an address. | nr_getNFTHoldings |
| Get Address ERC721 Token Inventory by Contract | Retrieves count of ERC-721 token IDs per collection. | nr_getNFTInventory |
III. Block Module APIs
Block information can be obtained via standard RPC, or enhanced MegaNode APIs for aggregated daily statistics.
| BSCScan API Name | Description | MegaNode Equivalent / Notes |
|---|---|---|
| Get Block Number by Timestamp | Retrieves the block number mined at a specific timestamp. | nr_getBlockNumberByTimeStamp See Documentation |
| Get Daily Block Count and Rewards | Retrieves daily count of mined blocks and rewards. | nr_getDailyBlockCountAndReward See Documentation |
| Get Daily Block Rewards | Retrieves daily distribution of block rewards. | nr_getDailyBlockReward See Documentation |
IV. Gas Tracker APIs
Gas price and usage information, including some historical and estimation features, can be migrated.
| BSCScan API Name | Description | MegaNode Equivalent / Notes |
|---|---|---|
| Get Gas Oracle | Get current gas price recommendations. | eth_gasPrice or eth_feeHistory. |
V. Log & Transaction APIs
Log retrieval uses standard RPC, and transaction status checks map to receipt lookups.
| BSCScan API Name | Description | MegaNode Equivalent / Notes |
|---|---|---|
| Event Logs by Address | Retrieves event logs from an address. | eth_getLogs with address filter. |
| Event Logs by Topics | Retrieves event logs filtered by topics. | eth_getLogs with topics. |
| Event Logs by Address and Topics | Retrieves event logs filtered by address and topics. | eth_getLogs with combined filter. |
| Check Contract Execution Status | Retrieves current status and execution result. | eth_getTransactionReceipt. |
| Check Transaction Receipt Status | Retrieves the execution status by hash. | eth_getTransactionReceipt. |
| Get Deposit/Withdrawal Transactions by Address | L2 bridging specific, not core RPC for BSC. | nr_getAssetTransfers. This endpoint is only available for Arbitrum and Optimism stack chains. |
VI. Contracts APIs (Verification and Deployment)
Contract verification requires dedicated services, while creator information is available via tracing.
| BSCScan API Name | Description | MegaNode Equivalent / Notes |
|---|---|---|
| Get Contract ABI | Retrieve the ABI for a verified smart contract. | Requires deploying a BSC contract verification service. |
| Get Contract Source Code | Retrieve the source code for a verified smart contract. | Requires deploying a BSC contract verification service. |
| Get Contract Creator and Creation Tx Hash | Retrieve a contract’s deployer address and creation transaction. | nr_getContractCreationTransaction (Enhanced API) |
| Verify Solidity Source Code | Submit Solidity source code for verification. | Requires deploying a BSC contract verification service. |
| Check Source Code Verification Status | Check the status of a source code verification request. | Requires deploying a BSC contract verification service. |
| Verify Proxy Contract | Submit a proxy contract for verification. | Requires deploying a BSC contract verification service. |
| Check Proxy Contract Verification Status | Check the status of a proxy contract verification. | Requires deploying a BSC contract verification service. |
VII. Geth/Parity Proxy APIs (Standard RPC - Native Support)
All BSCScan Geth/Parity Proxy endpoints are directly supported by standard JSON-RPC methods available on MegaNode.
| BSCScan API Name | MegaNode Equivalent RPC Method |
|---|---|
eth_blockNumber | eth_blockNumber |
eth_BlockByNumber | eth_getBlockByNumber |
eth_UncleByBlockNumberAndIndex | eth_getUncleByBlockNumberAndIndex |
eth_BlockTransactionCountByNumber | eth_getBlockTransactionCountByNumber |
eth_TransactionByHash | eth_getTransactionByHash |
eth_TransactionByBlockNumberAndIndex | eth_getTransactionByBlockNumberAndIndex |
eth_TransactionCount | eth_getTransactionCount |
eth_sendRawTransaction | eth_sendRawTransaction |
eth_TransactionReceipt | eth_getTransactionReceipt |
eth_call | eth_call |
eth_Code | eth_getCode |
eth_StorageAt | eth_getStorageAt |
eth_gasPrice | eth_gasPrice |
eth_estimateGas | eth_estimateGas |
5. Not Supported API
These APIs are currently not supported by BscTrace or MegaNode. They may be added in the future depending on feature roadmap and indexing availability.
| API Name | BscScan Function Name | Description |
|---|---|---|
| Get Daily Transaction Count | Get Get Daily Transaction Count | Retrieves the daily number of transactions executed in the blockchain. |
| Get Daily Average Block Size | Get Get Daily Average Block Size | Retrieves the average daily block size over a specified date range. |
| Get Daily Average Block Time | Get Get Daily Average Block Time | Retrieves the daily average time taken to successfully mine a block. |
| Get Daily Average Gas Limit | Get Get Daily Average Gas Limit | Retrieve historical daily average gas limit. |
| Get Ethereum Daily Total Gas Used | Get Get Ethereum Daily Total Gas Used | Retrieve the total gas used each day. |
| Get Daily Average Gas Price | Get Get Daily Average Gas Price | Retrieve daily average gas price statistics. |
| Get Estimated Block Countdown | Get Get Estimated Block Countdown by Block Number | Retrieves the estimated time, in seconds, until a specified block is mined. |
| Get Daily Uncle Block Count and Rewards | Get Get Daily Uncle Block Count and Rewards | Returns the daily count of Uncle blocks mined and their associated rewards. |
| Get Total Supply of Ether 2 | Get Get Total Supply of Ether 2 | Retrieves the current Ether supply, including circulation and staking-related accounting. |
| Get Ether Last Price | Get Get Ether Last Price | Retrieves the latest price of the native gas token. |
| Get Ethereum Nodes Size | Get Get Ethereum Nodes Size | Retrieves the total size of the blockchain in bytes. |
| Get Total Nodes Count | Get Get Total Nodes Count | Retrieves the total count of discoverable nodes. |
| Get Daily Network Transaction Fee | Get Get Daily Network Transaction Fee | Retrieves the total transaction fees paid each day. |
| Get Daily New Address Count | Get Get Daily New Address Count | Retrieves the daily count of newly created addresses. |
| Get Daily Network Utilization | Get Get Daily Network Utilization | Retrieves the daily average percentage of gas used relative to the network gas limit. |
| Get Daily Average Network Hash Rate | Get Get Daily Average Network Hash Rate | Retrieves historical hash rate statistics. |
| Get Daily Average Network Difficulty | Get Get Daily Average Network Difficulty | Returns historical mining difficulty data. |
| Get Ether Historical Price | Get Get Ether Historical Price | Returns the historical USD price data for 1 ETH. |
| Get Plasma Deposits by Address | Get Get Plasma Deposits by Address | Retrieves a list of Plasma deposit transactions received by an address. |
| Get Nametag for Address | Get Get Nametag (Metadata) for an Address | Retrieves off-chain name tags and metadata. |
| Get Beacon Chain Withdrawals by Address | Get Get Beacon Chain Withdrawals by Address | Retrieves Beacon chain withdrawal transactions to an address. |
| Chainlist | Get Chainlist | Returns the list of supported Etherscan chains. |
| Verify Source Code on zkSync | Post Verify Source Code on zkSync | Submit zkSync source code for verification. |
| Verify Vyper Source Code | Post Verify Vyper Source Code | Submit a Vyper contract for verification. |
| Verify Stylus Source Code | Post Verify Stylus Source Code | Submit Stylus source code for verification. |
| Verify with Foundry | Verify with Foundry | Contract verification via Foundry. |
| Verify with Hardhat | Verify with Hardhat | Contract verification via Hardhat. |
| Verify with Remix | Verify with Remix | Contract verification via Remix. |
Other not supported functions:
- Get Estimation of Confirmation Time
- Retrieves the average daily block size.
- Retrieves the daily average time to mine a block.
Updated about 18 hours ago
