Skip to main content
GET
/
{chain_id}
/
api
/
v2
/
arbitrum
/
batches
/
{batch_number}
Get batch by number.
curl --request GET \
  --url https://api.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_number} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_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.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_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.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_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.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_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.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_number}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.blockscout.com/{chain_id}/api/v2/arbitrum/batches/{batch_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
{
  "after_acc_hash": "<string>",
  "before_acc_hash": "<string>",
  "commitment_transaction": {
    "block_number": 1,
    "hash": "<string>",
    "timestamp": "2023-11-07T05:31:56Z"
  },
  "data_availability": {},
  "end_block_number": 1,
  "number": 1,
  "start_block_number": 1,
  "transactions_count": 1
}
{
"message": "Resource not found"
}
{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header.

Path Parameters

batch_number
integer
required

Batch number.

Required range: x >= 0
chain_id
string
required

The ID of the blockchain

Response

Batch info.

Detailed Arbitrum batch info.

after_acc_hash
string
required

Accumulator hash of the sequencer inbox after this batch was appended. Must equal before_acc_hash of the next batch.

Pattern: ^0x([A-Fa-f0-9]{64})$
before_acc_hash
string
required

Accumulator hash of the sequencer inbox before this batch was appended. Forms a hash chain: must equal after_acc_hash of the previous batch.

Pattern: ^0x([A-Fa-f0-9]{64})$
commitment_transaction
CommitmentTransaction · object
required

Parent chain transaction that committed the batch.

data_availability
Base · object
required

Data availability information. Structure varies by batch_data_container type.

end_block_number
integer
required

Last Rollup block included in the batch.

Required range: x >= 0
number
integer
required

Sequential identifier assigned to this batch by the sequencer.

Required range: x >= 0
start_block_number
integer
required

First Rollup block included in the batch.

Required range: x >= 0
transactions_count
integer
required

Number of transactions in the batch.

Required range: x >= 0