⚡ Test Our Private Nodes of 40+ Blockchains just for $50!

coins coins coins coins
avax
Avalanche (AVAX)

Method: POST eth_getBlockByNumber

dropdown

# eth_getBlockByNumber example for Avalanche (AVAX)

POST eth_getBlockByNumber

Returns information about a block by block number.

Parameters

QUANTITY|TAG - string

block number or "latest", "earliest" or "pending"

Boolean - Boolean

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

Request

curl --location --request POST 'https://avax.getblock.io/mainnet/ext/bc/C/rpc' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", false],
"id": "getblock.io"}'


Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "baseFeePerGas": "0x19bb848f81",
        "blockExtraData": "0x",
        "blockGasCost": "0x0",
        "difficulty": "0x1",
        "extDataGasUsed": "0x0",
        "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "extraData": "0x00000000000000000000000000331408000000000000000000000000003f97dd000000000000000000000000002ea46c00000000000000000000000000137a9f00000000000000000000000000000000",
        "gasLimit": "0x7a1200",
        "gasUsed": "0x2b8179",
        "hash": "0xdca5763ad1c2caff24371708a9be95a6b8b27f3c7c6c8e228cec6bbfcf0c5d6b",
        "logsBloom": "0x00200000000010000000024880000000400000042008000020410000000040000000000002000000004002000014400000000000000000410000000000200000c0c08000000800000008020814000820100000002044080000400080810004002000020002080c0003080001000808000001000202000c0010020010000000201002002040000000001104000000010000000000000000888400004018200000020a00004600000000000090200000000004000000200002000021000080000000010452000000080000104000010200000480000014001002010002600030000010100800000000000000040440000d00000000000044270000000000108000",
        "miner": "0x0100000000000000000000000000000000000000",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0xcbf818",
        "parentHash": "0x1ed7abacc78a7af41497402e531dac6103b8789c4356c115ebe3678ff12e0c77",
        "receiptsRoot": "0x64f9a69885e9b470f1824e9713801a68fca2f024232b7d8259923734b8cf3781",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0xeeb",
        "stateRoot": "0xd818a0f0f24272df7fb5daf296e8e3cfb04d0e19022265723e0bf7fe3076f20b",
        "timestamp": "0x6256d357",
        "totalDifficulty": "0xcbf818",
        "transactions": [
            "0xc0f9363177941e575e02cf7746471d648fa2c1df1c7abca92b54b998a17ffdf0",
            "0x59f89c8edf1ba5ee517cd56787133452df65b7e83e2a0e7b16535a5987735caa",
            "0x1a7362d6aadc0ebe8b388c802775b3aaebea28f33545e2152496266f6e67eec5",
            "0x76c7339ec2cdcc28db59a2b62ef92aba36dc51cc3ac9b0ebfe68c121e13176f0",
            "0x2f2f113fbab9eef6d1cc296c522721f77f4d909cc31d39c1b4c7f6d971d641f6",
            "0xe529b109506af64fbf1ab4cf582786af207801ecd420430dd08eb0c77925ca49",
            "0x21e30c1b833875911d4727820120195023c4512903ff6bf5ce32952d63ba4314",
            "0xb28a79bfe313cdf708912bb320758c94f3375f17b50bb3f377702491faeb8813",
            "0xe06f2d6cbe028962003233a422f2fd6117efc8013b6ac791aeb20604402cb9b6",
            "0x6df30a91721e08fb8f59e00bd9e7daa8742efde210c57647edc82aaece0c6a0b",
            "0x356903ed17061b6b4cd3b9d871f474668b1e23dfa1d15dcfa79b453f69168e84",
            "0xc34c5c9cc4f5b9e1943a321e2bee25a8272f7871f9e8c22e53e44a660ce581f4",
            "0xec0ec47cd5995fdfb2b08c2e9cd1cb7d4a8fd61c35b3c0f55275ec2a9c15e6b0",
            "0xe442ccef8b799ace752d1094c15cf27add274db9590e49af6db18871ada5c741",
            "0xa8500b48ac0e0d0919667d10ee53d61b7575cc625cb71bb008fe534cc36535f3"
        ],
        "transactionsRoot": "0x3cdad00b74131df5d5cadba058216162c1a93e54f72df525f958c76a1ae43712",
        "uncles": []
    }
}