# eth_getBlobSidecars

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://bnb-mainnet.g.alchemy.com/v2/{apiKey}

Returns the blob sidecars for a given block, identified by block hash or block number.

Reference: https://www.alchemy.com/docs/chains/bnb-smart-chain/bnb-smart-chain-api-endpoints/eth-get-blob-sidecars

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Block Identifier | string | No | A block hash or block number to retrieve blob sidecars for. |

## Result

**Blob Sidecars** (object[]): An array of blob sidecar objects.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "eth_getBlobSidecars",
  "params": [
    "0x41a5d8ffcc7ba7bbf3670caff9a2d95a63a4f31be905f86f5c44e25c2dfb30ed"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "index": "0x0",
      "blob": "0x...",
      "kzgCommitment": "0x...",
      "kzgProof": "0x..."
    }
  ],
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://bnb-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlobSidecars",
  "params": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'eth_getBlobSidecars', params: ['string']})
};

fetch('https://bnb-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://bnb-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlobSidecars",
    "params": ["string"]
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://bnb-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getBlobSidecars\",\n  \"params\": [\n    \"string\"\n  ]\n}")

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

	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))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://bnb-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getBlobSidecars\",\n  \"params\": [\n    \"string\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://bnb-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getBlobSidecars\",\n  \"params\": [\n    \"string\"\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: eth_getBlobSidecars
description: Returns the blob sidecars for a given block, identified by block hash or block number.
params:
  - name: Block Identifier
    description: A block hash or block number to retrieve blob sidecars for.
    schema:
      oneOf:
        - title: 32 byte hex value
          type: string
          pattern: ^0x[0-9a-f]{64}$
        - title: hex encoded unsigned integer
          type: string
          pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
result:
  name: Blob Sidecars
  description: An array of blob sidecar objects.
  schema:
    type: array
    items:
      type: object
      required:
        - index
        - blob
        - kzgCommitment
        - kzgProof
      properties:
        index:
          title: hex encoded unsigned integer
          type: string
          pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        blob:
          title: hex encoded bytes
          type: string
          pattern: ^0x[0-9a-f]*$
        kzgCommitment:
          title: 48 hex encoded bytes
          type: string
          pattern: ^0x[0-9a-f]{96}$
        kzgProof:
          title: 96 hex encoded bytes
          type: string
          pattern: ^0x[0-9a-f]{192}$
examples:
  - name: eth_getBlobSidecars example
    params:
      - name: Block Identifier
        value: '0x41a5d8ffcc7ba7bbf3670caff9a2d95a63a4f31be905f86f5c44e25c2dfb30ed'
    result:
      name: Blob Sidecars
      value:
        - index: '0x0'
          blob: 0x...
          kzgCommitment: 0x...
          kzgProof: 0x...
```
