---
title: "Per-Transaction Attribution"
method: GET
path: "/api/v1/tx/{tx_hash}"
tags: ["Contract Intelligence"]
---

# Per-Transaction Attribution

`GET /api/v1/tx/{tx_hash}`

## Request

- Base URL: `https://cleartracedata.com` (the document declares no server; this is the origin it was published from)
- URL: `https://cleartracedata.com/api/v1/tx/{tx_hash}`
- Auth: none declared

**Public API: Classifies a single transaction against the attribution engine.**

Given a transaction hash, this fetches the transaction and its receipt from
Alchemy and applies the same four vectors used in our aggregate attribution
(calldata-suffix, proxy-router, fee-recipient, aggregator) to tell you
*which frontend/router originated the trade and how we know* — plus the
pools touched, fee recipients, and whether the tx was sandwiched.

Results are cached permanently (mined transactions are immutable). Fee
amounts are exact raw token units. With `price=true`, an APPROXIMATE USD
trade size is added (best-effort spot price, dominant leg) — never treat it
as a settlement figure.

## Path parameters

- `tx_hash` string, required

## Query parameters

- `chain` 'ethereum' | 'base' | 'arbitrum' | 'optimism': Blockchain to query.
- `deep` boolean: Use internal call traces to refine the classification (catches aggregators that sit as intermediates, e.g. a router reached through a separate settlement contract, and runs the calldata-suffix test per sub-call). Costs more Alchemy CU; trace support is strongest on Ethereum.
- `price` boolean: Add a best-effort, APPROXIMATE USD trade size (dominant priced leg via the free DefiLlama spot-price API). Adds latency; never a settlement figure.

## Response `200`

Live classification of a single transaction against the four attribution vectors.

- TxAttributionResponse
  - `tx_hash` string, required: The queried transaction hash (lower-cased).
  - `chain` string, required: The blockchain the lookup ran against.
  - `found` boolean, required: Whether the transaction was found and classified.
  - `status` integer, nullable: On-chain receipt status (1 = success, 0 = reverted).
  - `primary_vector` string, nullable: The dominant attribution vector: proxy, aggregator, fee_recipient, calldata_suffix, direct, or unclassified.
  - `vectors` string[]: All attribution vectors this transaction matches.
  - `originator` TxOriginator
    - `address` string, required: The contract the transaction called (tx_to).
    - `name` string, nullable: Resolved label for that contract, if known.
  - `is_direct` boolean: Whether the caller hit a DEX pool directly.
  - `is_proxy` boolean: Whether the trade routed through a proxy/router (hidden-frontend signal).
  - `is_aggregator` boolean: Whether a known aggregator router was involved.
  - `aggregator_name` string, nullable: Name of the matched aggregator, if any.
  - `has_calldata_suffix` boolean: Whether the calldata carries a non-ABI-aligned suffix fingerprint.
  - `fee_recipients` TxFeeRecipient[]: Addresses that skimmed a fee out of the swap.
    - `address` string, required: The fee-collecting address.
    - `name` string, nullable: Resolved label for the recipient, if known.
    - `token_contract` string, required: The ERC-20 contract the fee was paid in.
    - `raw_amount` string, required: Exact token amount transferred (raw integer, no decimals/USD applied).
  - `pools` string[]: Liquidity pools (Swap-event emitters) touched by the transaction.
  - `routing_legs` integer: Number of Swap events (pool legs) in the transaction.
  - `sandwiched` boolean: Whether this transaction appears as a victim in our detected sandwich set.
  - `trace_used` boolean: Whether internal traces were used to refine the classification (deep mode).
  - `deep` boolean: Whether deep (trace-based) classification was requested.
  - `estimated_volume_usd` number, nullable: Best-effort, APPROXIMATE USD trade size (dominant priced leg, DefiLlama spot price). Null when pricing was not requested or no leg could be priced. Never use as a settlement figure.
  - `volume_estimate_basis` string, nullable: How estimated_volume_usd was derived, when present.
  - `price` boolean: Whether best-effort USD sizing was requested.
  - `cached` boolean: Whether this result was served from cache.
  - `originating_frontend` OriginatingFrontend
    - `bucket` string, required: Taxonomy class: named_frontend, aggregator_api_direct, wallet_embedded, bots_mev, or unattributed.
    - `frontend_name` string, nullable: Resolved frontend/aggregator identity, when confident.
    - `method` string, required: How the frontend was attributed: calldata_suffix, fee_recipient, aggregator, router_heuristic, or none.
    - `confidence` string, required: Attribution-method strength: high (suffix), medium (router/fee), low (inferred), or none.
    - `attributed` boolean, required: True when the swap was confidently placed into a class (bucket != unattributed).
    - `fingerprinted` boolean: True when a calldata fingerprint proves a frontend tagged the swap but its identity could not be resolved.
  - `note` string, nullable: Diagnostic note (e.g. when Alchemy is unconfigured or the tx is unknown).

---

[API](https://skmtc.dev/cleartracedata/apis/cleartrace-api.md) · [All operations](https://skmtc.dev/cleartracedata/apis/cleartrace-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cleartracedata/apis/cleartrace-api/revisions/2073a5a38ab5?raw)
