TriportRPC

eth_getTransactionByHash

Polygon / https://triport.io/polygon

Minimum tier: Free

Polygon method guide

Last updated:

eth_getTransactionByHash looks up a single Polygon transaction by its 32-byte hash and returns the full transaction object. Use it to confirm that a transaction you broadcast was accepted, 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, blockHash, blockNumber, and transactionIndex 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.

Polygon's block time is roughly 2.1 seconds (vs ~12s on Ethereum), so a freshly submitted transaction is usually mined within a couple of blocks. When you poll for inclusion, poll at about the block interval — every ~2 seconds — rather than tighter, to avoid burning your RPS budget on a transaction that is not yet mined. For latency-sensitive pending detection, prefer a WebSocket newPendingTransactions subscription over polling this method. To read the execution outcome (status, gas used, logs) once mined, use eth_getTransactionReceipt.

Parameters

This method takes no parameters.

Returns

eth_getTransactionByHash return value
FieldType
resultobject

Examples

curl https://triport.io/polygon \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":[]}'
const res = await fetch("https://triport.io/polygon", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": []
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/polygon",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":[]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: Polygon.
  3. Clusters: mainnet.
  4. Credit cost: 1 per call.

FAQ

What does eth_getTransactionByHash do?
Returns the transaction object for a given transaction hash on Polygon, or null if the transaction is unknown or still pending.
How many credits does eth_getTransactionByHash cost?
eth_getTransactionByHash costs 1 credit(s) per call on Triport by default.
Is eth_getTransactionByHash available over WebSocket?
eth_getTransactionByHash is an HTTP JSON-RPC method.