curl --request GET \
--url https://data-api.b3.fun/insights/v1/blocksimport requests
url = "https://data-api.b3.fun/insights/v1/blocks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/blocks")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.b3.fun/insights/v1/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{
"meta": {
"chain_ids": [
123
],
"page": 123,
"limit_per_chain": 123,
"total_items": 123,
"total_pages": 123,
"address": "<string>",
"signature": "<string>"
},
"data": [
{
"chain_id": 123,
"block_number": 123,
"block_hash": "<string>",
"parent_hash": "<string>",
"block_timestamp": 123,
"nonce": "<string>",
"sha3_uncles": "<string>",
"mix_hash": "<string>",
"miner": "<string>",
"state_root": "<string>",
"transactions_root": "<string>",
"receipts_root": "<string>",
"logs_bloom": "<string>",
"size": 123,
"extra_data": "<string>",
"difficulty": "<string>",
"total_difficulty": "<string>",
"transaction_count": 123,
"gas_limit": 123,
"gas_used": 123,
"withdrawals_root": "<string>",
"base_fee_per_gas": 123
}
],
"aggregations": null
}{
"error": "<string>"
}{
"error": "<string>"
}Get blocks
Get blocks
curl --request GET \
--url https://data-api.b3.fun/insights/v1/blocksimport requests
url = "https://data-api.b3.fun/insights/v1/blocks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/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://data-api.b3.fun/insights/v1/blocks")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.b3.fun/insights/v1/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{
"meta": {
"chain_ids": [
123
],
"page": 123,
"limit_per_chain": 123,
"total_items": 123,
"total_pages": 123,
"address": "<string>",
"signature": "<string>"
},
"data": [
{
"chain_id": 123,
"block_number": 123,
"block_hash": "<string>",
"parent_hash": "<string>",
"block_timestamp": 123,
"nonce": "<string>",
"sha3_uncles": "<string>",
"mix_hash": "<string>",
"miner": "<string>",
"state_root": "<string>",
"transactions_root": "<string>",
"receipts_root": "<string>",
"logs_bloom": "<string>",
"size": 123,
"extra_data": "<string>",
"difficulty": "<string>",
"total_difficulty": "<string>",
"transaction_count": 123,
"gas_limit": 123,
"gas_used": 123,
"withdrawals_root": "<string>",
"base_fee_per_gas": 123
}
],
"aggregations": null
}{
"error": "<string>"
}{
"error": "<string>"
}Query Parameters
Use chain_id instead
[20, 56, 1]
The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. Use repeated query parameters, e.g., ?chain_id=20&chain_id=56. Optional, because a single chain can as well be specified as a subdomain
[20, 56, 1]
Filter by block number
1000000
Filter by block number greater than or equal to
1000000
Filter by block number greater than
1000000
Filter by block number less than or equal to
1000000
Filter by block number less than
1000000
Filter by block timestamp
1715222400
Filter by block timestamp greater than or equal to
1715222400
Filter by block timestamp greater than
1715222400
Filter by block timestamp less than or equal to
1715222400
Filter by block timestamp less than
1715222400
Field to sort results by
block_number "block_number"
Sort order (asc or desc)
asc, desc "desc"
Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number
Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used)
"count() as count"
Filter by transaction hash
"0x218b632d932371478d1ae5a01620ebab1a2030f9dad6f8fba4a044ea6335a57e"
The number of items to return
0 < x <= 100020
Page number (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters.
x >= 00
HypeDuel