---
title: "trace_block"
description: "The 'trace_block' gets trace information about all the transactions in a given block. This can be useful for debugging purposes or for analyzing the behavior of a blockchain"
order: 153
---

# trace_block

## Overview

The **"trace_block"** gets trace information about all the transactions in a given block. This can be useful for debugging purposes or for analyzing the behavior of a blockchain

## Request

### shell

```shell
curl --request POST \
  --url https://ethereum-mainnet-geth-archive.node.coinapi.io \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'X-CoinAPI-Key: abk_3f2504e04f8941d39a0c0305e82c3301582005f7' \
  --data '
  {
    "jsonrpc": "2.0",
    "method": "trace_block",
    "stop": [],
    "id":1,
    "params": ["0x6"]
  }
  '
```


### csharp

```csharp
using RestSharp; {

var options = new RestClientOptions("https://ethereum-mainnet-geth-archive.node.coinapi.io");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json","X-CoinAPI-Key: abk_3f2504e04f8941d39a0c0305e82c3301582005f7");
request.AddJsonBody("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"trace_block\"}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content); }
```


### php

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://ethereum-mainnet-geth-archive.node.coinapi.io",
  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([
    'id' => 1,
    'jsonrpc' => '2.0',
    'method' => 'trace_block'
  ]),
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "content-type: application/json",
    "X-CoinAPI-Key": "abk_3f2504e04f8941d39a0c0305e82c3301582005f7"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
```


### python

```python
import requests

url = "https://ethereum-mainnet-geth-archive.node.coinapi.io"

payload = {
    "id": 1,
    "jsonrpc": "2.0",
    "method": "trace_block"
}
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "X-CoinAPI-Key" : "abk_3f2504e04f8941d39a0c0305e82c3301582005f7"
}

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

print(response.text)
```


### javascript

```javascript copy
const options = {
  method: 'POST',
  headers: {accept: 'application/json', 'content-type': 'application/json', 'X-CoinAPI-Key': 'abk_3f2504e04f8941d39a0c0305e82c3301582005f7'},
  body: JSON.stringify({id: 1, jsonrpc: '2.0', method: 'trace_block'})
};

fetch('https://ethereum-mainnet-geth-archive.node.coinapi.io', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```


### go

```go
package main

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

func main() {

	url := "https://ethereum-mainnet-geth-archive.node.coinapi.io"

	payload := strings.NewReader("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"trace_block\"}")

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")
  req.Header.Add("X-CoinAPI-Key", "abk_3f2504e04f8941d39a0c0305e82c3301582005f7")

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

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

	fmt.Println(string(body))

}
```


### ruby

```ruby copy
require 'uri'
require 'net/http'

url = URI("https://ethereum-mainnet-geth-archive.node.coinapi.io")

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

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request["X-CoinAPI-Key"] = 'abk_3f2504e04f8941d39a0c0305e82c3301582005f7'
request.body = "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"trace_block\"}"

response = http.request(request)
puts response.read_body
```


### java

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"trace_block\"}");
Request request = new Request.Builder()
  .url("https://ethereum-mainnet-geth-archive.node.coinapi.io")
  .post(body)
  .addHeader("accept", "application/json")
  .addHeader("content-type", "application/json")
  .addHeader("X-CoinAPI-Key", "abk_3f2504e04f8941d39a0c0305e82c3301582005f7")
  .build();

Response response = client.newCall(request).execute();
```


## Request Parameters

## Response

```json
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "action": {
                "author": "0x0193d941b50d91be6567c7ee1c0fe7af498b4137",
                "rewardType": "block",
                "value": "0x4563918244f40000"
            },
            "blockHash": "0x1f1aed8e3694a067496c248e61879cda99b0709a1dfbacd0b693750df06b326e",
            "blockNumber": 6,
            "result": null,
            "subtraces": 0,
            "traceAddress": [],
            "type": "reward"
        }
    ]
}
```

## Errors

- **Invalid Request:** This error is returned if the request format is incorrect.
- **Internal Error:** This error is returned if there's a server-side issue processing the request.

## Rate Limits

Please note that there are rate limits applied to the API to ensure fair usage. Free-tier users are limited to 100 requests per day, while premium users can make up to 1000 or more requests per day.

## Support

If you encounter any issues or have further questions regarding the trace_block method, please contact our support team at **support@coinapi.io**.