Skip to main content
POST
/
submit-batch-query
Submit a batch query
curl --request POST \
  --url https://api.herodotus.cloud/submit-batch-query \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "destinationChainId": "SN_SEPOLIA",
  "fee": "0",
  "data": {
    "11155111": {
      "block:5856869": {
        "header": [
          "STATE_ROOT",
          "TIMESTAMP"
        ]
      },
      "timestamp:1703799420": {
        "accounts": {
          "vitalik.eth": {
            "slots": [],
            "props": [
              "BALANCE",
              "NONCE",
              "STORAGE_ROOT"
            ]
          },
          "0xd8da6bf26964af9d7eed9e03e53415d37aa96045": {
            "slots": [],
            "props": [
              "BALANCE"
            ]
          }
        }
      },
      "block:5030420": {
        "header": [
          "PARENT_HASH"
        ],
        "accounts": {
          "0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b": {
            "slots": [
              "0x0000000000000000000000000000000000000000000000000000000000000001",
              "0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0"
            ],
            "props": []
          }
        }
      }
    }
  },
  "webhook": {
    "url": "https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}
'
import requests

url = "https://api.herodotus.cloud/submit-batch-query"

payload = {
"destinationChainId": "SN_SEPOLIA",
"fee": "0",
"data": { "11155111": {
"block:5856869": { "header": ["STATE_ROOT", "TIMESTAMP"] },
"timestamp:1703799420": { "accounts": {
"vitalik.eth": {
"slots": [],
"props": ["BALANCE", "NONCE", "STORAGE_ROOT"]
},
"0xd8da6bf26964af9d7eed9e03e53415d37aa96045": {
"slots": [],
"props": ["BALANCE"]
}
} },
"block:5030420": {
"header": ["PARENT_HASH"],
"accounts": { "0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b": {
"slots": ["0x0000000000000000000000000000000000000000000000000000000000000001", "0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0"],
"props": []
} }
}
} },
"webhook": {
"url": "https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f",
"headers": { "Content-Type": "application/json" }
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destinationChainId: 'SN_SEPOLIA',
fee: '0',
data: {
'11155111': {
'block:5856869': {header: ['STATE_ROOT', 'TIMESTAMP']},
'timestamp:1703799420': {
accounts: {
'vitalik.eth': {slots: [], props: ['BALANCE', 'NONCE', 'STORAGE_ROOT']},
'0xd8da6bf26964af9d7eed9e03e53415d37aa96045': {slots: [], props: ['BALANCE']}
}
},
'block:5030420': {
header: ['PARENT_HASH'],
accounts: {
'0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b': {
slots: [
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0'
],
props: []
}
}
}
}
},
webhook: {
url: 'https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f',
headers: {'Content-Type': 'application/json'}
}
})
};

fetch('https://api.herodotus.cloud/submit-batch-query', 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.herodotus.cloud/submit-batch-query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destinationChainId' => 'SN_SEPOLIA',
'fee' => '0',
'data' => [
'11155111' => [
'block:5856869' => [
'header' => [
'STATE_ROOT',
'TIMESTAMP'
]
],
'timestamp:1703799420' => [
'accounts' => [
'vitalik.eth' => [
'slots' => [

],
'props' => [
'BALANCE',
'NONCE',
'STORAGE_ROOT'
]
],
'0xd8da6bf26964af9d7eed9e03e53415d37aa96045' => [
'slots' => [

],
'props' => [
'BALANCE'
]
]
]
],
'block:5030420' => [
'header' => [
'PARENT_HASH'
],
'accounts' => [
'0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b' => [
'slots' => [
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0'
],
'props' => [

]
]
]
]
]
],
'webhook' => [
'url' => 'https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f',
'headers' => [
'Content-Type' => 'application/json'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.herodotus.cloud/submit-batch-query"

payload := strings.NewReader("{\n \"destinationChainId\": \"SN_SEPOLIA\",\n \"fee\": \"0\",\n \"data\": {\n \"11155111\": {\n \"block:5856869\": {\n \"header\": [\n \"STATE_ROOT\",\n \"TIMESTAMP\"\n ]\n },\n \"timestamp:1703799420\": {\n \"accounts\": {\n \"vitalik.eth\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\",\n \"NONCE\",\n \"STORAGE_ROOT\"\n ]\n },\n \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\"\n ]\n }\n }\n },\n \"block:5030420\": {\n \"header\": [\n \"PARENT_HASH\"\n ],\n \"accounts\": {\n \"0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b\": {\n \"slots\": [\n \"0x0000000000000000000000000000000000000000000000000000000000000001\",\n \"0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0\"\n ],\n \"props\": []\n }\n }\n }\n }\n },\n \"webhook\": {\n \"url\": \"https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f\",\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.herodotus.cloud/submit-batch-query")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"destinationChainId\": \"SN_SEPOLIA\",\n \"fee\": \"0\",\n \"data\": {\n \"11155111\": {\n \"block:5856869\": {\n \"header\": [\n \"STATE_ROOT\",\n \"TIMESTAMP\"\n ]\n },\n \"timestamp:1703799420\": {\n \"accounts\": {\n \"vitalik.eth\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\",\n \"NONCE\",\n \"STORAGE_ROOT\"\n ]\n },\n \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\"\n ]\n }\n }\n },\n \"block:5030420\": {\n \"header\": [\n \"PARENT_HASH\"\n ],\n \"accounts\": {\n \"0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b\": {\n \"slots\": [\n \"0x0000000000000000000000000000000000000000000000000000000000000001\",\n \"0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0\"\n ],\n \"props\": []\n }\n }\n }\n }\n },\n \"webhook\": {\n \"url\": \"https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f\",\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.herodotus.cloud/submit-batch-query")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destinationChainId\": \"SN_SEPOLIA\",\n \"fee\": \"0\",\n \"data\": {\n \"11155111\": {\n \"block:5856869\": {\n \"header\": [\n \"STATE_ROOT\",\n \"TIMESTAMP\"\n ]\n },\n \"timestamp:1703799420\": {\n \"accounts\": {\n \"vitalik.eth\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\",\n \"NONCE\",\n \"STORAGE_ROOT\"\n ]\n },\n \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\": {\n \"slots\": [],\n \"props\": [\n \"BALANCE\"\n ]\n }\n }\n },\n \"block:5030420\": {\n \"header\": [\n \"PARENT_HASH\"\n ],\n \"accounts\": {\n \"0x69030ef8C2744b37a096fAf2A4C78B4dAec1308b\": {\n \"slots\": [\n \"0x0000000000000000000000000000000000000000000000000000000000000001\",\n \"0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0\"\n ],\n \"props\": []\n }\n }\n }\n }\n },\n \"webhook\": {\n \"url\": \"https://webhook.site/1f3a9b5d-5c8c-4e2a-9d7e-6c3c5a0a0e2f\",\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "internalId": "<string>"
}
{
"error": "<unknown>",
"info": "<unknown>",
"httpPart": "<unknown>"
}
{
"error": "<unknown>"
}

Authorizations

api-key
string
header
required

Body

application/json
destinationChainId
enum<string>
required
Available options:
STARKNET,
300,
11155111,
11155420,
SN_SEPOLIA,
421614,
4801
fee
string
required
data
object
required
webhook
object

Response

Default Response

internalId
string
required