Skip to main content

eth_getTransactionByHash

Returns the information about a transaction by transaction hash on Polygon.

Why Polygon? Build on the most adopted Ethereum scaling solution with 45,000+ dApps and enterprise partnerships with $4B+ TVL, sub-$0.01 transactions, 8M+ daily transactions, and zkEVM for enhanced security.

Use Cases#

The eth_getTransactionByHash method is essential for:

  • Transaction tracking - Get details of pending or confirmed transactions
  • Payment verification - Verify transaction parameters
  • Debugging - Analyze transaction data for enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments
  • Block explorers - Display transaction information

Parameters#

ParameterTypeRequiredDescription
transactionHashDATAYes32-byte transaction hash

Request#

{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x1c9191ff3b87e14cc8f0e3b4081ba4ab42c12bb1153954c33298f3ecf7beab05"],
"id": 1
}

Returns#

FieldTypeDescription
hashDATATransaction hash
fromDATASender address
toDATARecipient address
valueQUANTITYValue in wei
gasQUANTITYGas provided
gasPriceQUANTITYGas price in wei
inputDATATransaction input data
nonceQUANTITYSender's nonce
blockHashDATABlock hash (null if pending)
blockNumberQUANTITYBlock number (null if pending)

Code Examples#

curl -X POST https://api-polygon-mainnet-full.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x1c9191ff3b87e14cc8f0e3b4081ba4ab42c12bb1153954c33298f3ecf7beab05"],
"id": 1
}'

Error Handling#

Error CodeMessageDescription
-32602Invalid paramsInvalid transaction hash format