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

# Decode logs and transactions​

Decode logs and transactions​

` POST /insights/v1/decode/{contractAddress} `

Decode logs and transactions​

Decode logs and transactions​

## Servers

- ` https://data-api.b3.fun/ ` — B3 Data API - Multi-Chain Proxy

## Parameters

### ` contract_address ` (path, required)

- ` value `: type ` string `

  - Title: address (hex or ENS)

  - example: ` "vitalik.eth" `

Example:

```json
"vitalik.eth"
```

### ` chain ` (query, optional)

Use chain_id instead

- ` value `: type ` array `

  - example: ` [20,56,1] `

  - ` array item `: type ` number `

Example:

```json
[
  20,
  56,
  1
]
```

### ` chain_id ` (query, optional)

The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. Optional, because a single chain can as well be specified as a subdomain

- ` value `: type ` array `

  - example: ` [20,56,1] `

  - ` array item `: type ` number `

Example:

```json
[
  20,
  56,
  1
]
```

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` transactions `: type ` array `

    - ` array item `: type ` object `

      - Required fields: ` data `

      - ` data `: type ` string `

  - ` logs `: type ` array `

    - ` array item `: type ` object `

      - Required fields: ` topics `

      - ` data `: type ` string `

      - ` topics `: type ` array `

        - ` array item `: type ` string `

## Responses

### ` 200 ` — Success

Content type: ` application/json `

- ` value `: type ` object `

  - ` data `: type ` object `

    - ` transactions `: type ` array `

      - ` array item `: type ` object `

        - Required fields: ` data `

        - ` data `: type ` string `

        - ` function_name `: type ` string `

        - ` args `: type ` array `

          - ` array item `: type ` unknown `; nullable

    - ` logs `: type ` array `

      - ` array item `: type ` object `

        - Required fields: ` topics `

        - ` data `: type ` string `

        - ` topics `: type ` array `

          - ` array item `: type ` string `

        - ` event_name `: type ` string `

        - ` args `: type ` array `

          - ` array item `: type ` unknown `; nullable

### ` 400 ` — Bad request

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 404 ` — Not found

### ` 500 ` — Internal server error

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://data-api.b3.fun//insights/v1/decode/{contractAddress}' \
  -H 'Content-Type: application/json' \
  -d '{
  "transactions": [
    {
      "data": "string"
    }
  ],
  "logs": [
    {
      "data": "string",
      "topics": [
        "string"
      ]
    }
  ]
}'
```

### JavaScript

```javascript
const response = await fetch('https://data-api.b3.fun//insights/v1/decode/{contractAddress}', {
  method: 'POST',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "transactions": [
      {
        "data": "string"
      }
    ],
    "logs": [
      {
        "data": "string",
        "topics": [
          "string"
        ]
      }
    ]
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.post('https://data-api.b3.fun//insights/v1/decode/{contractAddress}', json={
  "transactions": [
    {
      "data": "string"
    }
  ],
  "logs": [
    {
      "data": "string",
      "topics": [
        "string"
      ]
    }
  ]
})
print(response.json())
```