POST v0/blob/get_all
Get all Data Blobs
Retrieves all data blobs from the Celestia blockchain under the given namespaces at the given height. If all blobs were found without any errors, a list of blobs will be returned.
Request
curl \
-X POST 'https://t.tech/v0/blob/get_all' \
-H 'Authorization: Bearer <YOUR API KEY>' \
-H 'Content-Type: application/json' \
-d '{"height": 0, "namespaces": 7bc2b01a6908f6ea1260}'package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://t.tech/v0/blob/get_all"
apiKey := "Your API Key" // Replace with your actual token
payload := map[string]interface{}{"height": 0, "namespaces": "6791137dbdd921afa751",
}
jsonPayload, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Status:", resp.Status)
fmt.Println("Response:", string(body))
}// Cargo.toml dependencies:
// [dependencies]
// reqwest = { version = "0.12", features = ["json"] }
// serde_json = { version = "1.0" }
// tokio = { version = "1.46", features = ["macros", "rt-multi-thread"] }
use reqwest::{Client, header};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let url = "https://t.tech/v0/blob/get_all";
let api_key = "Your API Key"; // Replace with your actual token
let payload = json!({
"height": 0, "namespaces": "0ebe28c7bc97657d9606",
});
let res = client
.post(url)
.header(header::CONTENT_TYPE, "application/json")
.bearer_auth(api_key)
.json(&payload)
.send()
.await?;
let status = res.status();
let body = res.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
Ok(())
}Body Parameters
heightThe block height at which the blobs were submitted in the Celestia blockchain.
namespacesAn array of namespaces for the data blobs you wish to retrieve. Each namespace value must be exactly twenty characters of valid hexadecimal text. This corresponds to a V0 Celestia Namespace ID. Read more about namespace IDs at the Celestia Docs here.
networkThe Celestia network to which the data blob should be posted. Can be either mainnet or mocha-4. Defaults to
mainnet if no value is specified. Read more about networks on the Celestia Docs
here.
Response
commitment — stringThe commitment of the blob, which is a hash of the blob data.
data — stringThe data of the blob, encoded in base64.
index — integerA numerical index indicating the blob’s position or order within a set of blobs at the specified block height
namespace — stringThe namespace of the blob.
shareVersion — integerThe share version of the blob.
Example Response
[
{
"namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAN6t////////vu8=",
"data": "AAAAdHdpbmtsZQ==",
"shareVersion": 0,
"commitment": "1s1WX41x9Ti2I9Uu0vBvxMQ5dAkr1CewS5+0kfm5Q1o=",
"index": 972
}
]