---
title: "Get a transaction by hash"
method: GET
path: "/{chain}/transactions/{hash}"
tags: ["Chain"]
---

# Get a transaction by hash

`GET /{chain}/transactions/{hash}`

## Request

- Base URL: `https://api.blockvectra.com/v1/data`
- URL: `https://api.blockvectra.com/v1/data/{chain}/transactions/{hash}`
- Auth: API key in header `x-api-key`

Fetch a transaction by its 32-byte transaction hash. With `?include_logs=true`, receipt event logs for this transaction are included in the response. No pagination. A hash that resolves to a block below `coverage.from_block` is `422 no_coverage`; a hash missing from the lookup (for instance a transaction in a partition not attached yet) is `404`.

## Path parameters

- `chain` string, required
- `hash` string, required: 32-byte hash. `0x`/`0X` prefix optional; either hex digit case is accepted.

## Query parameters

- `include_logs` 'true' | 'false'

## Response `200`

The transaction (with `logs` included when `?include_logs=true`).

- TransactionPointEnvelope: `next_cursor` is never present (this endpoint has no pagination).
  - `data` TransactionWithLogs, required
    - `block_number` integer, required
    - `tx_index` integer, required
    - `hash` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `block_timestamp` string, date-time, required: `YYYY-MM-DDTHH:MM:SSZ`, UTC, second precision.
    - `type` integer, required: EIP-2718 transaction type byte.
    - `from` string, required: 20-byte address, canonical form always `0x` + 40 lowercase hex digits.
    - `to` string, required: 20-byte address, canonical form always `0x` + 40 lowercase hex digits.
    - `value` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `nonce` integer, required
    - `gas` integer, required
    - `gas_price` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `max_fee_per_gas` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `max_priority_fee_per_gas` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `input` string, required: Raw bytes of any length, `0x` + an even number of lowercase hex digits (`"0x"` alone for zero bytes).
    - `status` integer, nullable, required: 1 = success, 0 = reverted (EIP-658 receipt status byte), null when receipt_root is nonzero (before Byzantium); stored status is then a placeholder.
    - `gas_used` integer, required
    - `cumulative_gas_used` integer, required
    - `effective_gas_price` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `contract_address` string, required: 20-byte address, canonical form always `0x` + 40 lowercase hex digits.
    - `log_count` integer, required
    - `gas_used_for_l1` integer, nullable, required: L2-specific; `null` on chains with no L1 data-fee accounting.
    - `l1_block_number` integer, nullable, required
    - `extra` ExtraJson, required: Additional chain-specific fields as a JSON object; `{}` when there are none. Shape varies by chain.
    - `logs` Log[]: Present only when the request had `?include_logs=true`.
      - `log_index` integer, required
      - `address` string, required: 20-byte address, canonical form always `0x` + 40 lowercase hex digits.
      - `topics` Hash32[], required: 0-4 entries; contiguous from `topic0` (an on-chain log's topics never have a gap).
      - `data` string, required: Raw bytes of any length, `0x` + an even number of lowercase hex digits (`"0x"` alone for zero bytes).
      - `extra` ExtraJson, required: Additional chain-specific fields as a JSON object; `{}` when there are none. Shape varies by chain.
  - `meta` Meta, required: Metadata present on every success response.
    - `chain` string, required: Chain identifier; the value of the `{chain}` path parameter.
    - `chain_slug` string, required: Canonical uppercase chain slug; `chain` is always its lowercase form.
    - `chain_external_id` string, required: CAIP-2 formatted external chain identifier (`eip155:{chain_id}`).
    - `as_of_block` integer, required: The newest fully written block (the `blocks` table's maximum height); the only serving bound for block-scoped endpoints. For snapshot endpoints (balances, holders, nfts, dex prices, stocks) it is the service's current indexed head, not the block height of the snapshot: read the snapshot time from `meta.refreshed_at`, and treat the data as stale when `refreshed_at` is `null`.
    - `safe_block` integer, nullable, required: A marker only: the node's consensus `safe` block. Always present; `null` while no value is known (the node has no such tag, or the indexer has not read one yet). Only grows, never below `finalized_block`, and may be above or below `as_of_block`. It never truncates, rejects or bounds a response; see Finality in the API description.
    - `finalized_block` integer, nullable, required: A marker only: the node's consensus `finalized` block. Always present; `null` while no value is known (the node has no such tag, or the indexer has not read one yet). Only grows, and may be above or below `as_of_block`. It never truncates, rejects or bounds a response; see Finality in the API description.
    - `coverage` 'full' | 'partial', required: `"partial"` appears only from `GET /{chain}/addresses/{address}/transactions` and `GET /{chain}/addresses/{address}/transfers`, when `clamp=true` narrowed the served window, and from those two, `GET /{chain}/tokens/{token}/transfers` and `GET /{chain}/dex/swaps` when the block window starts before the lower bound of the dataset the endpoint reads -- the chain's first indexed block, or higher while that dataset is still being backfilled (see Coverage in the API description and each endpoint's window description). Every other endpoint reports `"full"`.
    - `refreshed_at` string, date-time, required: `YYYY-MM-DDTHH:MM:SSZ`, UTC, second precision.

## Other responses

- `400`: `error.code = "bad_request"`: `{hash}` does not parse as a 32-byte hash (`0x` prefix optional, either digit case), or `include_logs` is present but is neither `true` nor `false`.
- `401`: HTTP 401: a missing API key returns missing_api_key; an unknown, disabled, or revoked key returns the same invalid_api_key error envelope. error.code and error.data.reason contain the reason. Rejected requests are not billed.
- `402`: Payment required: the paid balance or the free grant is exhausted. The response body is `{"error":{"code":"insufficient_balance"}}`. Rejected requests are not billed.
- `404`: `error.code = "not_found"`: either `{chain}` is unknown or not public, or no transaction with this `{hash}` exists in the lookup table (a transaction submitted moments ago may take a few seconds to be indexed; `message` says so -- retry briefly before treating it as permanent). If the hash is found in the lookup table but resolves to a block above `as_of_block`, it returns `409 not_indexed_yet` instead.
- `409`: `error.code = "not_indexed_yet"` when the block this transaction resolved to is above `as_of_block` (`tx_hash_lookup` is written earlier than `blocks` commits; during the batch commit window this is stably hit before the block becomes visible, retry shortly); `meta.finalized_block` never rejects an indexed transaction. On a chain with no indexed block at all it is `not_indexed_yet` without `indexed_through` (see "Errors").
- `422`: `error.code = "no_coverage"`: no data here, which is permanent except while a dataset is being backfilled (a windowed endpoint's lower bound can move down as the backfill proceeds, so retry later). Either the chain does not have this endpoint's capability, or the requested block (or whole block window) is before the chain's first covered block (`coverage.from_block`) -- for the windowed endpoints, the lower bound of the dataset they read, which is that block or higher while the dataset is still being backfilled -- or the capability needs history from genesis (`balances`, `holders`, `nfts`) and `coverage.from_block` is not `0` yet or the indexed blocks have holes, or (traces) the block falls in a permanent trace coverage gap. A block window entirely before the lower bound is reported as this `422` even when its `to_block` is also above `as_of_block`. See Coverage in the API description (the history start in examples is a placeholder; read `GET /chains` `coverage.from_block` at runtime).
- `429`: Rate limited. `{"error":{"code":"rate_limited"}}` when the key CU rate limit is exceeded (the response includes `Retry-After`) or the account call rate limit is exceeded (no `Retry-After`). `{"error":{"code":"cost_exceeds_burst"}}` when a single request exceeds the key burst capacity; split the request, retrying as sent never succeeds. Rejected requests are not billed.
- `503`: `error.code = "unavailable"`: the service is temporarily unavailable, timed out, busy on this chain (no query slot freed up in time, see `limits.max_concurrent_queries` in `GET /chains`), or shutting down (see "Errors" above). Always carries an HTTP `Retry-After` header (seconds); wait at least that long before retrying.

---

[API](https://skmtc.dev/blockvectra/apis/blockvectra-data-api.md) · [All operations](https://skmtc.dev/blockvectra/apis/blockvectra-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/blockvectra/apis/blockvectra-data-api/revisions/c5b949e955b5?raw)
