Guides

Fetch a transaction

Transaction lookups are the second most common RPC call after tip/block. Always handle null / not found — the tx may still be mempool-only or outside full-node retention.

eth_getTransactionByHashgetTransactiongetrawtransaction

← All guides

Steps

  1. Collect the transaction hash / signature / txid from your app or a block.
  2. Call the family get-transaction method (and receipt method on EVM if you need logs/status).
  3. If the result is null, retry later (pending) or check you are on the correct network slug.
  4. For status and logs on EVM, also call eth_getTransactionReceipt.

EVM — transaction by hash (curl)

curl

curl https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": [
    "0x0000000000000000000000000000000000000000000000000000000000000001"
  ]
}'

EVM — transaction by hash (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getTransactionByHash',
    params: [
      "0x0000000000000000000000000000000000000000000000000000000000000001"
    ],
  }),
});

const data = await response.json();
console.log(data);

EVM — receipt (curl)

curl

curl https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionReceipt",
  "params": [
    "0x0000000000000000000000000000000000000000000000000000000000000001"
  ]
}'

EVM — receipt (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getTransactionReceipt',
    params: [
      "0x0000000000000000000000000000000000000000000000000000000000000001"
    ],
  }),
});

const data = await response.json();
console.log(data);

Solana — getTransaction (curl)

curl

curl https://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransaction",
  "params": [
    "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3vEHuknHXmXd22n3sN76rs",
    {
      "encoding": "json",
      "maxSupportedTransactionVersion": 0
    }
  ]
}'

Solana — getTransaction (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'getTransaction',
    params: [
      "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3vEHuknHXmXd22n3sN76rs",
      {
        "encoding": "json",
        "maxSupportedTransactionVersion": 0
      }
    ],
  }),
});

const data = await response.json();
console.log(data);

Tips

  • Replace example hashes with real ones from your network — placeholders return null.
  • Bitcoin: getrawtransaction "txid" true for JSON; verbose false returns hex.
  • TRON: wallet/gettransactionbyid with value: { value: "<txid>" } shape — see TRON guide.

Related