List L2 blocks in a Scroll batch
curl --request GET \
--url https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}', 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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}",
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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}"
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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}")
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{
"items": [
{
"base_fee_per_gas": "<string>",
"burnt_fees": "<string>",
"burnt_fees_percentage": 123,
"difficulty": "<string>",
"gas_limit": "<string>",
"gas_target_percentage": 123,
"gas_used": "<string>",
"gas_used_percentage": 123,
"hash": "<string>",
"height": 1,
"internal_transactions_count": 1,
"is_pending_update": true,
"miner": {
"ens_domain_name": "<string>",
"hash": "<string>",
"implementations": [
{
"address_hash": "<string>",
"name": "<string>"
}
],
"is_contract": true,
"is_scam": true,
"is_verified": true,
"metadata": {
"tags": [
{
"meta": {},
"name": "<string>",
"ordinal": 123,
"slug": "<string>",
"tagType": "<string>"
}
]
},
"name": "<string>",
"private_tags": [
{
"address_hash": "<string>",
"display_name": "<string>",
"label": "<string>"
}
],
"public_tags": [
{
"address_hash": "<string>",
"display_name": "<string>",
"label": "<string>"
}
],
"watchlist_names": [
{
"display_name": "<string>",
"label": "<string>"
}
]
},
"nonce": "<string>",
"parent_hash": "<string>",
"priority_fee": "<string>",
"rewards": [
{
"reward": "<string>"
}
],
"size": 1,
"timestamp": "2023-11-07T05:31:56Z",
"total_difficulty": "<string>",
"transaction_fees": "<string>",
"transactions_count": 1,
"uncles_hashes": [
{
"hash": "<string>"
}
],
"withdrawals_count": 1,
"arbitrum": {
"batch_number": 123,
"commitment_transaction": {
"hash": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"confirmation_transaction": {
"hash": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"delayed_messages": 123,
"l1_block_number": 123,
"send_count": 123,
"send_root": "<string>"
}
}
],
"next_page_params": {
"block_number": 22566361
}
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}blocks
List L2 blocks in a Scroll batch
Retrieves L2 blocks that are bound to a specific Scroll batch number.
GET
/
{chain_id}
/
api
/
v2
/
blocks
/
scroll-batch
/
{batch_number_param}
List L2 blocks in a Scroll batch
curl --request GET \
--url https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}', 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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}",
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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}"
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.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockscout.com/{chain_id}/api/v2/blocks/scroll-batch/{batch_number_param}")
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{
"items": [
{
"base_fee_per_gas": "<string>",
"burnt_fees": "<string>",
"burnt_fees_percentage": 123,
"difficulty": "<string>",
"gas_limit": "<string>",
"gas_target_percentage": 123,
"gas_used": "<string>",
"gas_used_percentage": 123,
"hash": "<string>",
"height": 1,
"internal_transactions_count": 1,
"is_pending_update": true,
"miner": {
"ens_domain_name": "<string>",
"hash": "<string>",
"implementations": [
{
"address_hash": "<string>",
"name": "<string>"
}
],
"is_contract": true,
"is_scam": true,
"is_verified": true,
"metadata": {
"tags": [
{
"meta": {},
"name": "<string>",
"ordinal": 123,
"slug": "<string>",
"tagType": "<string>"
}
]
},
"name": "<string>",
"private_tags": [
{
"address_hash": "<string>",
"display_name": "<string>",
"label": "<string>"
}
],
"public_tags": [
{
"address_hash": "<string>",
"display_name": "<string>",
"label": "<string>"
}
],
"watchlist_names": [
{
"display_name": "<string>",
"label": "<string>"
}
]
},
"nonce": "<string>",
"parent_hash": "<string>",
"priority_fee": "<string>",
"rewards": [
{
"reward": "<string>"
}
],
"size": 1,
"timestamp": "2023-11-07T05:31:56Z",
"total_difficulty": "<string>",
"transaction_fees": "<string>",
"transactions_count": 1,
"uncles_hashes": [
{
"hash": "<string>"
}
],
"withdrawals_count": 1,
"arbitrum": {
"batch_number": 123,
"commitment_transaction": {
"hash": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"confirmation_transaction": {
"hash": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"delayed_messages": 123,
"l1_block_number": 123,
"send_count": 123,
"send_root": "<string>"
}
}
],
"next_page_params": {
"block_number": 22566361
}
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}Authorizations
bearerAuthapiKeyAuth
API key passed as a Bearer token in the Authorization header.
Path Parameters
Batch number
Required range:
x >= 0The ID of the blockchain
Query Parameters
Number of items per page
Required range:
x >= 1Block number for paging
Required range:
x >= 0Was this page helpful?
List L2 blocks in an Optimism batch
Previous
Retrieves detailed information for a specific block identified by its number or hash.
Next
⌘I