Bware Docs
  • About Bware Labs Decentralized API
  • API Docs
    • Ethereum API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket API
        • eth_syncing method
    • Binance Smart Chain API
      • RPC
        • eth_getTransactionByHash method
        • eth_getBlockByNumber method
        • eth_blockNumber method
        • eth_syncing method
        • eth_getBalance method
        • eth_accounts method
        • eth_gasPrice method
      • Websocket API
        • eth_syncing method
    • Avalanche API
      • X-Chain
      • C-Chain
      • P-Chain
      • Keystore API
      • Health API
      • Admin API
      • Info API
      • Metrics API
    • Moonbeam/Moonriver API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Astar/Shiden APIs
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Fantom API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websockets
        • eth_syncing method
    • Polkadot API
      • RPC
        • chain_getBlock
        • chain_getHeader
        • system_chainType
        • state_getMetadata
      • Websockets
        • system_chainType
    • Elrond API
      • REST API
        • Get Block By Hash
        • Get Shard Status
  • Tutorials
    • Using Bware Labs Platform
      • Getting a Bware Labs full endpoint
    • Using Bware Labs Endpoint in PolkadotJs
    • Using Bware Labs Endpoint in Metamask
    • Using a Bware Labs endpoint in code
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example

Was this helpful?

  1. API Docs
  2. Binance Smart Chain API
  3. RPC

eth_getBlockByNumber method

Returns information about a block with a given number

Previouseth_getTransactionByHash methodNexteth_blockNumber method

Last updated 4 years ago

Was this helpful?

Parameters

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

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

Returns

An object containing data about the block at the given height.

Example

// Request
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_getBlockByNumber","params": ["0x46d9e", true]}' https://bsc-api.bwarelabs.com/<your-endpoint-id>

// Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "difficulty": "0x2",
    "extraData": "0xd883010002846765746888676f312e31332e34856c696e7578000000000000004bb33f4cc4424417f1b1082f27cd70fb7a3c3f727a5868fd397a5edfc2390ce93a88e2c05e2d7f3ef7fbcc56de326c174a6d523d8b6279a981f0e8e1e449dae601",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0x0",
    "hash": "0x72bd249c65738fe19323dc00e881a49d1c7f0570f11249a37dae67f589a44b80",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x685b1ded8013785d6623cc18d214320b6bb64759",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000",
    "number": "0x46d9e",
    "parentHash": "0x6af21f12b49393b23758e96edc4af5b7d7894cf9ce1b6184776e614e4b193f3f",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x262",
    "stateRoot": "0x0cd6a3bbceaf4e3410a942ef4e769b8767eb2755308ddc34500fc166419d4607",
    "timestamp": "0x5f57147e",
    "totalDifficulty": "0x8daae",
    "transactions": [],
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "uncles": []
  }
}
default block parameter