Transaction Details

GET/gateway/v1/onchain/tx

Look up one transaction by hash. Example: `chain=ethereum` with a 0x-prefixed 64-character hash.

All numeric fields are hex-encoded. Convert them with `parseInt(hex, 16)`.

Supported chains: `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, `cyber`.

Query Parameters

hashstringrequired

Transaction hash (0x-prefixed hex)

Example: 0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060
chainenum<string>required

Chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, or `cyber`.

Available options:ethereumpolygonbscarbitrumoptimismbaseavalanchefantomlineacyber
Example: ethereum
includestring

Comma-separated enrichments to attach. Currently valid: `labels` — adds `from_label` and `to_label` fields with entity information for the from/to addresses.

Example: labels
Transaction Details
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/onchain/tx?hash=0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060&chain=ethereum&include=labels', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataResponseOnchainTxItem.json",
  "data": [
    {
      "accessList": [
        {
          "address": "<string>",
          "storageKeys": []
        }
      ],
      "blobVersionedHashes": [],
      "blockHash": "<string>",
      "blockNumber": "<string>",
      "chainId": "<string>",
      "from": "<string>",
      "from_label": {
        "address": "<string>",
        "entity_name": "<string>",
        "entity_type": "<string>",
        "labels": [
          {
            "confidence": 123,
            "label": "<string>"
          }
        ]
      },
      "gas": "<string>",
      "gasPrice": "<string>",
      "hash": "<string>",
      "input": "<string>",
      "maxFeePerBlobGas": "<string>",
      "maxFeePerGas": "<string>",
      "maxPriorityFeePerGas": "<string>",
      "nonce": "<string>",
      "r": "<string>",
      "s": "<string>",
      "to": "<string>",
      "to_label": {
        "address": "<string>",
        "entity_name": "<string>",
        "entity_type": "<string>",
        "labels": [
          {
            "confidence": 123,
            "label": "<string>"
          }
        ]
      },
      "transactionIndex": "<string>",
      "type": "<string>",
      "v": "<string>",
      "value": "<string>",
      "yParity": "<string>"
    }
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>",
    "has_more": true,
    "limit": 123,
    "offset": 123,
    "total": 123,
    "watermark": 123
  }
}