Skip to main content
GET
/
main-page
/
blocks
get main page blocks
curl --request GET \
  --url https://eth.blockscout.com/api/v2/main-page/blocks
import requests

url = "https://eth.blockscout.com/api/v2/main-page/blocks"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://eth.blockscout.com/api/v2/main-page/blocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://eth.blockscout.com/api/v2/main-page/blocks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://eth.blockscout.com/api/v2/main-page/blocks"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://eth.blockscout.com/api/v2/main-page/blocks")
.asString();
require 'uri'
require 'net/http'

url = URI("https://eth.blockscout.com/api/v2/main-page/blocks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
[
  {
    "base_fee_per_gas": "26618801760",
    "burnt_fees": "261263193229977120",
    "burnt_fees_percentage": 85.19028810863084,
    "difficulty": "0",
    "extra_data": "TODO",
    "gas_limit": "30000000",
    "gas_target_percentage": -34.56675333333333,
    "gas_used": "9814987",
    "gas_used_percentage": 32.71662333333333,
    "hash": "0xf569ec751152b2f814001fc730f7797aa155e4bc3ba9cb6ba24bc2c8c9468c1a",
    "height": 17615720,
    "miner": {
      "hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
      "implementation_name": "implementationName",
      "name": "contractName",
      "is_contract": true,
      "private_tags": [
        {
          "address_hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
          "display_name": "name to show",
          "label": "label"
        }
      ],
      "watchlist_names": [
        {
          "display_name": "name to show",
          "label": "label"
        }
      ],
      "public_tags": [
        {
          "address_hash": "0xEb533ee5687044E622C69c58B1B12329F56eD9ad",
          "display_name": "name to show",
          "label": "label"
        }
      ],
      "is_verified": true,
      "ens_domain_name": "domain.eth",
      "metadata": {
        "slug": "tag_slug",
        "name": "Tag name",
        "tagType": "name",
        "ordinal": 0,
        "meta": {}
      }
    },
    "nonce": "0x0000000000000000",
    "parent_hash": "0xd464e02d81e2bdf6bc5fa9b8e33f0b564c464a82d821a3e56531f8636dc00dfa",
    "priority_fee": "45418705646601378",
    "rewards": [
      {
        "reward": 123,
        "type": "Miner Reward | Emission Reward | Chore Reward | Uncle Reward"
      }
    ],
    "size": 49997,
    "state_root": "TODO",
    "timestamp": "2023-07-03T20:09:59.000000Z",
    "total_difficulty": "58750003716598352816469",
    "transactions_count": 120,
    "transaction_fees": "306681898876578498",
    "type": "block",
    "uncles_hashes": [
      "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
    ],
    "withdrawals_count": 16
  }
]

Response

200 - application/json

blocks

base_fee_per_gas
string
required
Example:

"26618801760"

burnt_fees
string
required
Example:

"261263193229977120"

burnt_fees_percentage
number
required
Example:

85.19028810863084

difficulty
string
required
Example:

"0"

extra_data
string
required
Example:

"TODO"

gas_limit
string
required
Example:

"30000000"

gas_target_percentage
number
required
Example:

-34.56675333333333

gas_used
string
required
Example:

"9814987"

gas_used_percentage
number
required
Example:

32.71662333333333

hash
string
required
Example:

"0xf569ec751152b2f814001fc730f7797aa155e4bc3ba9cb6ba24bc2c8c9468c1a"

height
integer
required
Example:

17615720

miner
object
required
nonce
string
required
Example:

"0x0000000000000000"

parent_hash
string
required
Example:

"0xd464e02d81e2bdf6bc5fa9b8e33f0b564c464a82d821a3e56531f8636dc00dfa"

priority_fee
string
required
Example:

"45418705646601378"

rewards
object[]
required
size
integer
required
Example:

49997

state_root
string
required
Example:

"TODO"

timestamp
string
required
Example:

"2023-07-03T20:09:59.000000Z"

total_difficulty
string
required
Example:

"58750003716598352816469"

transactions_count
integer
required
Example:

120

transaction_fees
string
required
Example:

"306681898876578498"

type
string
required
Example:

"block"

uncles_hashes
string[]
required
withdrawals_count
integer
required
Example:

16