--- title: getBlock --- # getBlock Query a block information by the block height or the blcok ID ## Usage ```js tronWeb.trx.getBlock(blockNumberOrBlockId); ``` ## Parameters | Parameters | Parameter Description | Data Type | |--------------|-------------------------------|-----------| | blockNumberOrBlockId | The height of the Block or blockId or `'latest'` or `'earliest'` | Integer | ## Return Object - The block information, see examples below. ## Example ```js //Example 1 await tronWeb.trx.getBlock(12345); // output-start { blockID: '000000000000303987c7c8ab3f5967c107a619fa47819940597e9938811a1764', block_header: { raw_data: { number: 12345, txTrieRoot: '0000000000000000000000000000000000000000000000000000000000000000', witness_address: '414b4778beebb48abe0bc1df42e92e0fe64d0c8685', parentHash: '0000000000003038c0a3aa1806236bc5b281633728b5fe8a14a51062522e651d', timestamp: 1529928585000 }, witness_signature: 'cb889103aa9ce691d39df8030b54b50b12b77984684281f3490e0b802cbc364c13af773ede8d9314add0fa4d247165be82fa28721f17493c88761b7039ba1c1100' } } // output-end //Example 2 await tronWeb.trx.getBlock('000000000000303987c7c8ab3f5967c107a619fa47819940597e9938811a1764'); // output-start { blockID: '000000000000303987c7c8ab3f5967c107a619fa47819940597e9938811a1764', block_header: { raw_data: { number: 12345, txTrieRoot: '0000000000000000000000000000000000000000000000000000000000000000', witness_address: '414b4778beebb48abe0bc1df42e92e0fe64d0c8685', parentHash: '0000000000003038c0a3aa1806236bc5b281633728b5fe8a14a51062522e651d', timestamp: 1529928585000 }, witness_signature: 'cb889103aa9ce691d39df8030b54b50b12b77984684281f3490e0b802cbc364c13af773ede8d9314add0fa4d247165be82fa28721f17493c88761b7039ba1c1100' } } // output-end //Example 3 await tronWeb.trx.getBlock('latest').then(result => {console.log(result)}); // output-start { blockID: '0000000000000000de1aa88295e1fcf982742f773e0419c5a9c134c994a9059e', block_header: { raw_data: { txTrieRoot: 'ea97ca7ac977cf2765093fa0e4732e561dc4ff8871c17e35fd2bcabb8b5f821d', witness_address: '414b4778beebb48abe0bc1df42e92e0fe64d0c8685', parentHash: '957dc2d350daecc7bb6a38f3938ebde0a0c1cedafe15f0edae4256a2907449f6' } }, transactions: [ { txID: 'abda6c8b1e8954dbe1d5a06a774a3e6923b003d29bb4ce286998f23452e3b04a', raw_data: [Object], raw_data_hex: '5a6f0801126b0a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e7472616374123a0a173078303030303030303030303030303030303030303030121541f16412b9a17ee9408646e2a21e16478f72ed1e9518ffffa7ec85afd1b101' }, ... // Contains the block contents (transactions, IDs, hashes, timestamps, etc.) // output-end ```