Lookup Block By Number
curl --request GET \
--url https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}', 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://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"block": {
"base_fee_per_gas": "10000000000",
"difficulty": "0",
"extra_data": "0x...",
"gas_limit": "30000000",
"gas_used": "15000000",
"hash": "0x2c9759ce3126199512631f50cb01e40717c880cb094a8974f62f100978fe7071",
"logs_bloom": "0x000...",
"miner": "0x312e67b47a2a29ae200184949093d92369f80b53",
"nonce": "0x0000000000000000",
"number": 18000000,
"parent_hash": "0x2c9759ce3126199512631f50cb01e40717c880cb094a8974f62f100978fe7071",
"receipt_root": "0x...",
"sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": 100000,
"state_root": "0x...",
"timestamp": "2023-11-07T05:31:56Z",
"total_difficulty": "58750003716598352816469",
"transaction_count": 150,
"transactions_root": "0x...",
"withdrawals_root": "0x..."
}
}Blocks
Lookup Block By Number
Retrieves the full details of a specific block, identified by its block number or the “latest” tag.
GET
/
v2
/
{chain_name}
/
blocks
/
{block_number}
Lookup Block By Number
curl --request GET \
--url https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}', 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://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.data.ormilabs.com/v2/{chain_name}/blocks/{block_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"block": {
"base_fee_per_gas": "10000000000",
"difficulty": "0",
"extra_data": "0x...",
"gas_limit": "30000000",
"gas_used": "15000000",
"hash": "0x2c9759ce3126199512631f50cb01e40717c880cb094a8974f62f100978fe7071",
"logs_bloom": "0x000...",
"miner": "0x312e67b47a2a29ae200184949093d92369f80b53",
"nonce": "0x0000000000000000",
"number": 18000000,
"parent_hash": "0x2c9759ce3126199512631f50cb01e40717c880cb094a8974f62f100978fe7071",
"receipt_root": "0x...",
"sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": 100000,
"state_root": "0x...",
"timestamp": "2023-11-07T05:31:56Z",
"total_difficulty": "58750003716598352816469",
"transaction_count": 150,
"transactions_root": "0x...",
"withdrawals_root": "0x..."
}
}Authorizations
Enter your API key in the format: Bearer <api_key>. Providing an API key may grant higher rate limits or access to additional features. The API will function without an API key for basic access.
Path Parameters
The block number. It can be numeric like 1231321 or "latest".
Pattern:
^(\d+|latest)$Example:
"18000000"
The name or ID of the blockchain.
Available options:
ethereum, apechain, arbitrum, avalanche, base, bsc, polygon Example:
"ethereum"
Response
Successfully retrieved block details.
Show child attributes
Show child attributes
⌘I