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

# `trace_transaction`

Provides transaction processing of type [trace](/services/reference/ethereum/json-rpc-methods/trace-methods/#trace)for the specified transaction. Use this API to improve smart contract performance by analyzing its internal transactions and execution steps. You can use this information to identify bottlenecks and optimize the contract for better performance. This method uses [300 credits](/services/get-started/pricing/) from your daily balance.

## Parameters[​](#parameters "Direct link to Parameters")

- `transaction hash`: _[Required]_ The transaction hash.

## Returns[​](#returns "Direct link to Returns")

- A list of [traces](/services/reference/ethereum/json-rpc-methods/trace-methods/#trace) in the order called by the transaction.

## Example[​](#example "Direct link to Example")

Replace `<YOUR-API-KEY>` with an API key from your [Infura dashboard](https://app.infura.io/).

### Request[​](#request "Direct link to Request")

- curl
- WSS

```
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "trace_transaction","params": ["0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7"],"id": 1}'

```

```
wscat -c wss://linea-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "trace_transaction","params": ["0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7"],"id": 1}'

```

### Response[​](#response "Direct link to Response")

- JSON

```
{
  "jsonrpc": "2.0",
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
        "gas": "0xffad82",
        "input": "0x0000000000000000000000000000000000000999",
        "to": "0x0020000000000000000000000000000000000000",
        "value": "0x0"
      },
      "blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd",
      "blockNumber": 6,
      "result": {
        "gasUsed": "0x7536",
        "output": "0x"
      },
      "subtraces": 1,
      "traceAddress": [],
      "transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e",
      "transactionPosition": 0,
      "type": "call"
    }
  ]
}

```
