Blocks API
Get Latest Block

Get Latest Block

Overview

The Get Latest Block endpoint obtains data for the most recent block on a specific blockchain network.

Querying via Postman

If you prefer querying via Postman, the description of PARSIQ Endpoints for Get Latest Block (opens in a new tab) might come in handy. There you will find examples and responses for good and bad requests as well as parameter definitions and their example values.

Usage

In this example, we receive data for the latest block on Ethereum Mainnet.

import * as Parsiq from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const latest = await client.blocks.getLatest();
 
console.log(latest)

Output:

{
  hash: '0x8a0e12429f7c2ea3ac140334245908c11e001d202deb3eb0a6712a8f9d65d485',
  parent_hash: '0xe326a0778640ae74cb6bb162dc6e75c2ed3e037871de3acec1cac67bc4969d78',
  number: 18390588,
  timestamp: 1697793455,
  header: {
    nonce: 0,
    gas_used: 14129438,
    mix_hash: '0xfe6b6763963e591d07e7549b752909b3000129cbe3246d1459eb092d60b48b82',
    gas_limit: 30000000,
    burnt_fees: '148500815454571936',
    difficulty: 0,
    extra_data: '0x546974616e2028746974616e6275696c6465722e78797a29',
    logs_bloom: '0x01af827465cb71421003ace08c483000cda70c181c15708136911439bcc238441c04115910008094021a308a489241269e014801ad0eae9e52548700842e9152a043e888c45189e86b0b6309b57001ac8da9008302c40d40d41514a4caa00105d804820416c62a01106492243881ac4785934631841896c628883cfc064e1469a08c065662a981109545065837822b64081384918345a66dc630055d07d30000c2202d40ce81bc604a0364f08f7575c50698e61b6e83072ba8439f29068864c8c63fa2d6254c01c10ab0821d1d7f529c2efc401bd5603b9c47a140022202e86115337c5d146a55ebb3e52ab949505e228065b292036026e2006b9219006074c1',
    state_root: '0xf2ffa51a8f6dad0812bba09ca1114045d3f2d903d03ce0da8749b51b04bca417',
    sha3_uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
    receipts_root: '0xc48c78822cab0ed2348e7bc711c63828fc4cd93ccb2cac9cc1fc633f03b468b0',
    base_fee_per_gas: '10510029872',
    total_difficulty: '58750003716598360000000',
    transactions_root: '0xfeb1fdaab2e98e6f20f2f2834c4d215edb5d187f847bff6d6f5c6a7b1b10941e'
  },
  ghost: true
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
Query params
estimate_cu
boolean