> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotstuff.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Block

> Send POST request to /explorer with method: "block"

Retrieve detailed information about a specific block including its transactions. Can be queried by block hash or block height.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.hotstuff.trade/explorer \
    --header 'Content-Type: application/json' \
    --data '{
      "method": "block",
      "params": {
          "block_height": 162778
      }
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.hotstuff.trade/explorer"
  payload = {
      "method": "block",
      "params": {
          "block_height": 162778
      }
  }
  response = requests.post(url, json=payload)
  print(response.json())
  ```

  ```javascript Javascript theme={null}
  const url = "https://api.hotstuff.trade/explorer";
  const payload = {
    method: "block",
    params: {
      block_height: 162778,
    },
  };

  fetch(url, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(payload),
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
  ```

  ```php PHP theme={null}
  <?php
  $url = "https://api.hotstuff.trade/explorer";
  $payload = json_encode([
      "method" => "block",
      "params" => [
          "block_height" => 162778
      ]
  ]);

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
  $response = curl_exec($ch);
  curl_close($ch);
  print_r(json_decode($response, true));
  ?>
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      url := "https://api.hotstuff.trade/explorer"
      payload := map[string]interface{}{
          "method": "block",
          "params": map[string]interface{}{
              "block_height": 162778,
          },
      }

      jsonData, _ := json.Marshal(payload)
      resp, _ := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
      defer resp.Body.Close()
      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.HttpURLConnection;
  import java.net.URL;
  import java.io.*;

  URL url = new URL("https://api.hotstuff.trade/explorer");
  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  conn.setRequestMethod("POST");
  conn.setRequestProperty("Content-Type", "application/json");
  conn.setDoOutput(true);

  String jsonPayload = "{\"method\":\"block\",\"params\":{\"block_height\":162778}}";
  OutputStream os = conn.getOutputStream();
  os.write(jsonPayload.getBytes());
  os.flush();

  BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  String response = in.readLine();
  System.out.println(response);
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'

  uri = URI('https://api.hotstuff.trade/explorer')
  payload = {
    method: "block",
    params: {
      block_height: 162778
    }
  }

  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  request = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
  request.body = payload.to_json
  response = http.request(request)
  puts JSON.parse(response.body)
  ```
</RequestExample>


## OpenAPI

````yaml openapi/info/explorer/block.json POST /explorer
openapi: 3.0.3
info:
  title: Hotstuff Info API — Block
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
  - url: https://testnet-api.hotstuff.trade
security: []
paths:
  /explorer:
    post:
      summary: Block
      operationId: infoExplorerBlock
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                params:
                  type: object
                  properties:
                    block_height:
                      type: integer
                  required:
                    - block_height
              required:
                - method
                - params
              example:
                method: block
                params:
                  block_height: 162778
            examples:
              default:
                summary: Example request
                value:
                  method: block
                  params:
                    block_height: 162778
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  block_height:
                    type: integer
                  block_hash:
                    type: string
                  parent_hash:
                    type: string
                  change_log_hash:
                    type: string
                  timestamp:
                    type: integer
                  tx_count:
                    type: integer
                  created_at:
                    type: integer
                  transactions:
                    type: array
                    items:
                      type: object
                      properties:
                        tx_hash:
                          type: string
                        account:
                          type: string
                        block_height:
                          type: integer
                        block_hash:
                          type: string
                        tx_type:
                          type: integer
                        success:
                          type: boolean
                        timestamp:
                          type: integer
                        created_at:
                          type: integer
                      required:
                        - tx_hash
                        - account
                        - block_height
                        - block_hash
                        - tx_type
                        - success
                        - timestamp
                        - created_at
              example:
                block_height: 162778
                block_hash: >-
                  0x330ed752d267705a6a30f90b03dded51f7a6013fb61a9dbdae2d128ed8e0eb5d
                parent_hash: >-
                  0xb13f8567e07c8faad2695c953766e04bee36fa134c1a7a07e469244d79a995a8
                change_log_hash: >-
                  0x0000000000000000000000000000000000000000000000000000000000000000
                timestamp: 1764952788519
                tx_count: 1
                created_at: 1764952788
                transactions:
                  - tx_hash: >-
                      0x4cb07520655fd427da1574a0ac819b8d60e214b3e3a21fcbd07eee2f90b33029
                    account: '0x8f10718aDe446Eb99B57953854E1454D4a75A9de'
                    block_height: 162778
                    block_hash: >-
                      0x330ed752d267705a6a30f90b03dded51f7a6013fb61a9dbdae2d128ed8e0eb5d
                    tx_type: 1301
                    success: true
                    timestamp: 1764952788519
                    created_at: 1764952788
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: <error message>

````