eth_getTransactionByHash — Ethereum JSON-RPC
Returns the transaction object for a given transaction hash, or null if the transaction is unknown or still pending.
https://triport.io/eth- Network
- Ethereum
- Auth
- x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
- Rate limit
- free — 10 RPS sustained · up to 20 burst (free) / 20 RPS sustained · up to 40 burst (basic) / 100 RPS sustained · up to 200 burst (pro) / 250 RPS sustained · up to 500 burst (business); Burst capacity
Endpoint and plans: Ethereum RPC endpoint.
eth_getTransactionByHash looks up a single transaction by its 32-byte hash and
returns the full transaction object. Use it to confirm that a transaction you
broadcast (for example via eth_sendRawTransaction) was accepted by the network,
to read back its calldata and value, or to find which block it landed in.
The method resolves both mined and pending transactions. If the hash has
been seen in the mempool but not yet included in a block, the blockHash,
blockNumber, and transactionIndex fields are returned as null while the
rest of the object is populated. If the hash is completely unknown to the node —
never broadcast, dropped, or replaced — the result is null.
A null result is not an error: the JSON-RPC envelope still returns HTTP 200
with "result": null. To read execution outcome (status, gas used, logs) you
need eth_getTransactionReceipt, which is only
available once the transaction is mined.
Parameters
The params array takes a single positional element.
txHashstringrequired0x-prefixed hex (66 characters total).Response
When the transaction is unknown or has not yet been seen:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}hashstringnoncestring0x-hex.blockHashstring | nullnull while pending.blockNumberstring | null0x-hex; null while pending.transactionIndexstring | null0x-hex; null while pending.fromstringtostring | nullnull for contract-creation transactions.valuestring0x-hex.gasstring0x-hex.gasPricestring0x-hex.inputstring0x-hex.Errors
Triport returns standard JSON-RPC error envelopes. The codes most relevant to this method:
| Code | Meaning | When it happens |
|---|---|---|
401 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
429 | rate_limited | The per-tier RPS limit was exceeded. The data block carries limit_rps, retry_after_sec, and upgrade_url. |
A malformed or wrong-length txHash is rejected as an invalid-params error
before the lookup runs. See the shared errors reference for
the full error envelope and the complete code list.
Examples
JavaScript (fetch)
const res = await fetch("https://triport.io/eth", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_getTransactionByHash",
params: [
"0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
],
}),
});
const { result } = await res.json();
if (result === null) {
console.log("transaction unknown or pending");
} else {
console.log(`included in block ${result.blockNumber}`);
}Notes
- A
blockHash/blockNumberofnullmeans the transaction is still in the mempool. Poll until those fields populate to detect inclusion, then calleth_getTransactionReceiptfor the execution status, effective gas used, and emitted logs. - All numeric fields (
nonce,value,gas,gasPrice,blockNumber,transactionIndex) are quantity-encoded0x-hex strings, not JSON numbers. - To fetch a transaction by its position instead of its hash, use
eth_getTransactionByBlockHashAndIndexoreth_getTransactionByBlockNumberAndIndex. - This method is shared with the
eth_read_rpccategory, so it draws from the same per-tier RPS budget as the other Ethereum read methods. - Token transfer shows
value0? The amount is in the call data and theTransferlog — see why an ERC-20 transfer shows value 0.