Get block

Retrieves a single block.

GET
/extended/v2/blocks/{height_or_hash}

Path Parameters

height_or_hashstring & Block hash & Block height

Response Body

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

canonicalboolean

Set to true if block corresponds to the canonical chain tip

heightinteger

Height of the block

hashstring

Hash representing the block

block_timeinteger

Unix timestamp (in seconds) indicating when this block was mined.

block_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.

tenure_heightinteger

The tenure height (AKA coinbase height) of this block

index_block_hashstring

The only hash that can uniquely identify an anchored block or an unconfirmed state trie

parent_block_hashstring

Hash of the parent block

parent_index_block_hashstring

Index block hash of the parent block

burn_block_timeinteger

Unix timestamp (in seconds) indicating when this block was mined.

burn_block_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.

burn_block_hashstring

Hash of the anchor chain block

burn_block_heightinteger

Height of the anchor chain block

miner_txidstring

Anchor chain transaction ID

tx_countinteger

Number of transactions included in the block

execution_cost_read_countinteger

Execution cost read count.

execution_cost_read_lengthinteger

Execution cost read length.

execution_cost_runtimeinteger

Execution cost runtime.

execution_cost_write_countinteger

Execution cost write count.

execution_cost_write_lengthinteger

Execution cost write length.

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

errorstring
message?string
[key: string]any
curl -X GET "https://api.hiro.so//extended/v2/blocks/latest"
fetch("https://api.hiro.so//extended/v2/blocks/latest")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.hiro.so//extended/v2/blocks/latest"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.hiro.so//extended/v2/blocks/latest"

response = requests.request("GET", url)

print(response.text)
{
  "canonical": true,
  "height": 0,
  "hash": "string",
  "block_time": 0,
  "block_time_iso": "string",
  "tenure_height": 0,
  "index_block_hash": "string",
  "parent_block_hash": "string",
  "parent_index_block_hash": "string",
  "burn_block_time": 0,
  "burn_block_time_iso": "string",
  "burn_block_hash": "string",
  "burn_block_height": 0,
  "miner_txid": "string",
  "tx_count": 0,
  "execution_cost_read_count": 0,
  "execution_cost_read_length": 0,
  "execution_cost_runtime": 0,
  "execution_cost_write_count": 0,
  "execution_cost_write_length": 0
}
{
  "error": "string",
  "message": "string"
}