WatchData Documentation
  • πŸ“–Welcome to WatchData Docs
    • 🧩Features
      • ⛓️Blockchain API
      • ⚑Powered API
      • πŸͺ™Price API
    • πŸ’ΌWhat products are suitable for our solutions
  • πŸ‘‹Introduction
    • πŸ› οΈQuick start guide to WatchData!
    • πŸ€”Why Use WatchData?
    • πŸ’‘Supported chains
    • πŸ›‘Error Reference
    • πŸ—οΈChange Log (update)
  • πŸ’ŽPowered API
    • πŸ”€Transfers
      • watch_getTransfers
      • watch_getTransfersByAddress
    • πŸ’ Parity
      • parity_getBlockReceipts
    • πŸŒ€Trace
      • trace_transaction
      • trace_block
    • ⏹️Blocks
      • watch_getBlockNumberByTimestamp
    • *️⃣Token API
      • watch_getTokenBalances
      • πŸ†•watch_getTokenMetadata
    • πŸ†’Stats
      • watch_getStatsByDay
  • πŸ•ΈοΈBlockchain API's
    • Ethereum API
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getTransactionCount
      • eth_getTransactionByHash
      • eth_getTransactionReceipt
      • eth_getBlockTransactionCountByHash
      • eth_getBlockTransactionCountByNumber
      • eth_getTransactionByBlockHashAndIndex
      • eth_getTransactionByBlockNumberAndIndex
      • eth_getUncleCountByBlockHash
      • eth_getUncleCountByBlockNumber
      • eth_getLogs
      • eth_call
      • eth_chainId
      • eth_estimateGas
      • eth_gasPrice
      • eth_getBalance
      • eth_getCode
      • net_version
      • eth_getStorageAt
      • eth_sendRawTransaction
      • eth_blockNumber
    • ♨️Polygon API
      • eth_blockNumber - Polygon
      • eth_getBlockByHash - Polygon
      • eth_getBlockByNumber - Polygon
      • eth_getTransactionByHash - Polygon
      • eth_getTransactionCount - Polygon
      • eth_getTransactionReceipt -Polygon
      • eth_getBlockTransactionCountByHash - Polygon
      • eth_getBlockTransactionCountByNumber - Polygon
      • eth_getTransactionByBlockHashAndIndex - Polygon
      • eth_getTransactionByBlockNumberAndIndex - Polygon
      • eth_getUncleCountByBlockHash - Polygon
      • eth_getUncleCountByBlockNumber - Polygon
      • eth_getLogs - Polygon
      • eth_call - Polygon
      • eth_chainId - Polygon
      • eth_estimateGas - Polygon
      • eth_gasPrice - Polygon
      • eth_getBalance - Polygon
      • eth_getCode - Polygon
      • net_version - Polygon
      • eth_getStorageAt - Polygon
      • eth_sendRawTransaction - Polygon
    • Binance Smart Chain API
      • eth_blockNumber (BSC)
      • eth_getBlockByHash (BSC)
      • eth_getBlockByNumber (BSC)
      • eth_getTransactionCount (BSC)
      • eth_getTransactionByHash (BSC)
      • eth_getTransactionReceipt (BSC)
      • eth_getBlockTransactionCountByHash (BSC)
      • eth_getBlockTransactionCountByNumber (BSC)
      • eth_getTransactionByBlockHashAndIndex (BSC)
      • eth_getTransactionByBlockNumberAndIndex (BSC)
      • eth_getUncleCountByBlockHash (BSC)
      • eth_getUncleCountByBlockNumber (BSC)
      • eth_getLogs (BSC)
      • eth_call (BSC)
      • eth_chainId (BSC)
      • eth_estimateGas (BSC)
      • eth_gasPrice (BSC)
      • eth_getBalance (BSC)
      • eth_getCode (BSC)
      • net_version (BSC)
      • eth_getStorageAt (BSC)
      • eth_sendRawTransaction (BSC)
    • Tron API
      • Full Node API Overview
      • Address Utilities
        • CreateAddress
        • GenerateAddress
        • ValidateAddress
      • Transactions
        • CreateTransaction
        • EasyTransferByPrivate
        • EasyTransfer
        • BroadcastHex
        • BroadcastTransaction
      • Accounts
        • AccountPermissionUpdate
        • UpdateAccount
        • GetAccount
        • CreateAccount
      • Account Resources
        • GetAccountNet
        • GetAccountResource
        • UnfreezeBalance
        • FreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query The Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • GetNodeInfo
        • GetChainParameters
      • TRC 10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • ParticipateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
        • EasyTransferAsset
        • EasyTransferAssetByPrivate
      • Smart Contracts
        • GetContract
        • TriggerSmartContract
        • TriggerConstantContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
      • TRONZ Shielded Smart Contract
        • GetSpendingKey
        • GetExpandedSpendingKey
        • GetAkFromAsk
        • GetNkFromNsk
        • GetIncomingViewingKey
        • GetDiversifier
        • GetZenPaymentAddress
        • GetNewShieldedAddress
        • CreateShieldedContractParameters
        • CreateSpendAuthSig
        • GetTriggerInputForShieldedTrc20Contract
        • ScanShieldedTrc20NotesByIvk
        • ScanShieldedTrc20NotesByOvk
        • IsShieldedTrc20ContractNoteSpent
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Proposals
        • ListProposals
        • GetProposalById
        • ProposalCreate
        • ProposalApprove
        • ProposalDelete
      • DEX Exchange
        • ListExchanges
        • GetExchangeById
        • ExchangeCreate
        • ExchangeInject
        • ExchangeWithdraw
        • ExchangeTransaction
      • Pending Pool
        • GetTransactionListFromPending
        • GetTransactionFromPending
        • GetPendingSize
    • Bitcoin API
      • Blockchain RPCs
        • getbestblockhash
        • getblock
        • getblockchaininfo
        • getblockcount
        • getblockhash
        • getblockheader
        • getblockstats
        • getchaintips
        • getchaintxstats
        • getdifficulty
        • getmempoolancestors
        • getmempooldescendants
        • getmempoolentry
        • getmempoolinfo
        • getrawmempool
        • gettxout
        • gettxoutproof
      • Rawtransactions RPCs
        • analyzepsbt
        • combinepsbt
        • combinerawtransaction
        • converttopsbt
        • createpsbt
        • createrawtransaction
        • decodepsbt
        • decoderawtransaction
        • decodescript
        • finalizepsbt
        • fundrawtransaction
        • getrawtransaction
        • joinpsbts
        • sendrawtransaction
        • testmempoolaccept
        • utxoupdatepsbt
  • πŸͺ™Price API
    • Price API
      • All tickers
      • Current price
  • ⛓️Web3
    • Web3 SDK
      • Web3.js
      • Web3.py
      • Ethers.js
      • Ethereum.rb
  • πŸ—ΊοΈTutorials and Guides
    • How to guides
      • How Getting Ethereum Account Balance and Transactions
      • How do I add WatchData to MetaMask?
      • How can i Get stats by Day
      • How to get the balance of an ERC-20 token
      • How can i get transfers using watch_getTransfersByAddress?
    • WatchData PriceΒ API and how it works?
    • How eth_getLogs works?
  • πŸ—ƒοΈResources
    • Pricing and Limits
      • Watch Units
    • FAQ
      • General
      • Pricing
      • Privacy
    • Support
    • Community
Powered by GitBook
On this page
  1. Blockchain API's
  2. Binance Smart Chain API

eth_getBlockByNumber (BSC)

Returns information about a block by block number.

Previouseth_getBlockByHash (BSC)Nexteth_getTransactionCount (BSC)

Last updated 2 years ago

Parameters

  • QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the .

  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

params: [
    '0x119B705', 
    true
]

Returns

See

Object - A block object with the following fields, or null when no block was found:

  • number: QUANTITY - the block number. null when its pending block.

  • hash: DATA, 32 Bytes - hash of the block. null when its pending block.

  • parentHash: DATA, 32 Bytes - hash of the parent block.

  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.

  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.

  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.

  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.

  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.

  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.

  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.

  • difficulty: QUANTITY - integer of the difficulty for this block.

  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.

  • extraData: DATA - the "extra data" field of this block.

  • size: QUANTITY - integer the size of this block in bytes.

  • gasLimit: QUANTITY - the maximum gas allowed in this block.

  • gasUsed: QUANTITY - the total used gas by all transactions in this block.

  • timestamp: QUANTITY - the unix timestamp for when the block was collated.

  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.

  • uncles: Array - Array of uncle hashes.

  • baseFeePerGas - the minimum fee per gas required for a transaction to be included in the block.

  • mixHash – a unique identifier for that block.

Request example

curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x119B705", true],"id":0}'
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByNumber",
    "params":["0x119B705", true],
    "id":0
}

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "number": "0x119b705",
        "hash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
        "parentHash": "0x261974b63eea921cfc9be27f4155d84a4724679b30cd83ce92b91e918b82a660",
        "nonce": "0x0000000000000000",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x983063000c198152b44840c091880112ad6b1c4b3621011a455106e8814a4f03cf76e0e414221225c38070880206b004f969960b19f8fe28400cec156aa40aa34b1745926df9423241276ee852557bf237d94b3caae6abc1a59f8889d058a3a812ca3b22d623e251365b10703254cb668965df5bb69c44d6c421d11be442de015a2725038c1f70262c956f86b8f867e0382db50d1c2449c88f388e59aba88bb08601c14e04cad802a007f8014b7e4ce86c34a95321af8d64d262a283891b675e22ce7d8e09e812be27c4060604925668709b23104dea6450504e320a8e38f020b0b0d5820148760c057c98996c07572462144e048945145ca90a409c9a099f5a",
        "transactionsRoot": "0xb7b85c12c7bb213f2108c02f185054433b324436e2398923851e2b0c05b0ce9c",
        "stateRoot": "0x8173efc9fad6f885130c0f9abef78109b52c698986ca6c8dfd2ace4a62d86e90",
        "receiptsRoot": "0xbe937a9da3d388edce6157cd844c3b3b42128d82edf497dcc1c39c6ccd3ec98c",
        "miner": "0x3f349bbafec1551819b8be1efea2fc46ca749aa1",
        "difficulty": "0x2",
        "totalDifficulty": "0x22ffe74",
        "extraData": "0xd883010109846765746888676f312e31372e36856c696e7578000000c3167bdfc7a004af88244c093280c2ee514e2a07371fd57dab056da28bdcab99339115b41ee7ee6e85a738fecf091ad312159ce682d9a0ea42734ec36b94cfadc381056100",
        "size": "0x9e53",
        "gasLimit": "0x48da4bf",
        "gasUsed": "0xfcedaf",
        "timestamp": "0x629e6b2e",
        "uncles": [],
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "transactions": [
            {
                "hash": "0x097573dc0a4512673878362f63382c74b74e5ef45972b0d3c8be2d2d59105cc3",
                "nonce": "0x10e88c",
                "transactionIndex": "0x0",
                "from": "0x90f729f31e20c58b93a7092f1e10bdae9cc4d82b",
                "to": "0x6fa0ae33263e500a6aba7535e5837c8766769847",
                "value": "0x0",
                "gasPrice": "0x3ad9a2d3ae",
                "gas": "0x35b62",
                "input": "0x0000167800000000000006154845044400000000000000267e4ef19e4f160000429cf6bb26f5f63b00b58bb57f6c06db6a2339070d265528b380773747286d8c2b389f286d52b2d546f1ee7678d100eecad33030c798da5c8f8774b6a39fae699901ff8c276751e691f6ac99f76bf1e332",
                "v": "0x93",
                "r": "0x573630ff7be77c9fa9336d2336c8ea7556a69be05f060a0ebd166ef8ec54cd72",
                "s": "0x60bdc76e0af015400d794988c5a048c33a1294384027c92ae566ec11f068110b",
                "chainId": "0x38",
                "blockHash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
                "blockNumber": "0x119b705"
                          }
        ]
    }
}
πŸ•ΈοΈ
default block parameter
eth_getBlockByHash