# What a transaction paid

`GET /api/tx-fee` · Optional key

What one TRON transaction paid: energy (staked, rented, burned), bandwidth, TRX burned and the USD value.

The USD value uses the TRX price on the transaction's day when we have it (`priceAt: "time"`), else today's (`"current"`). `pending: true` means the transaction isn't in a block yet. Confirmed answers are cached at the edge for a day.

## Request

Base URL: `https://feebolt.com`. Works without a key (per-IP limits). With an API key the limits are per key and higher.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tx` | string | yes | The transaction hash: 64 characters, 0-9 and a-f. |

## Examples

```bash
# Optional: add -H "Authorization: Bearer $FEEBOLT_API_KEY" for per-key limits
curl "https://feebolt.com/api/tx-fee?tx=5b02c0f8e9d1a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091ae19c"
```

```js
const res = await fetch("https://feebolt.com/api/tx-fee?tx=5b02c0f8e9d1a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091ae19c", {
  headers: {
    // optional: Authorization: `Bearer ${process.env.FEEBOLT_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.message);
```

```python
import requests

r = requests.get(
    "https://feebolt.com/api/tx-fee?tx=5b02c0f8e9d1a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091ae19c",
)
r.raise_for_status()
data = r.json()
```

## Response: 200 OK

The fee breakdown.

```json
{
  "txid": "5b02c0f8e9d1a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091ae19c",
  "found": true,
  "block": 78412093,
  "time": 1795895286725,
  "type": "TriggerSmartContract",
  "result": "SUCCESS",
  "ok": true,
  "from": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
  "to": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "usdt": {
    "amount": 250,
    "to": "TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC"
  },
  "trxAmount": null,
  "feeLimitTrx": 100,
  "energy": {
    "total": 64285,
    "fromStake": 64285,
    "fromDeployer": 0,
    "burned": 0,
    "penalty": 49635
  },
  "bandwidth": {
    "bytes": 345,
    "free": 345,
    "burned": 0
  },
  "feeTrx": 0,
  "energyFeeTrx": 0,
  "bandwidthFeeTrx": 0,
  "otherFeeTrx": 0,
  "trxUsd": 0.299702,
  "priceAt": "time",
  "priceSource": "coingecko",
  "pending": false
}
```

## Errors

| HTTP | error | When |
| --- | --- | --- |
| 400 | `bad_txid` | tx isn't 64 hex characters. |
| 404 | `not_found` | No order (or transaction) with that id. |
| 429 | `rate_limited` | Too many calls (per IP, or per key with a key). Wait for Retry-After seconds. |
| 502 / 503 | `upstream` | The TRON node didn't answer (503 when it rate-limited us). Retry in a few seconds. |

## Rate limits

- Without a key: 20 at once, then 1 every 5 s, per IP.
- With an API key: 100 at once, then 1 per second, per key.
- Cached a day at the edge once confirmed.
- CORS open (`Access-Control-Allow-Origin: *`): callable from a browser.

---

HTML: https://feebolt.com/developers/tx-fee/ · OpenAPI: https://feebolt.com/developers/openapi.json · All docs as one Markdown file: https://feebolt.com/developers/full.md
