Skip to main content

eth_getTransactionByHash

Overview

The 'eth_getTransactionByHash' method returns information about a transaction for a given hash.

Request

curl --request POST \
--url https://ethereum-mainnet-geth-archive.node.coinapi.io \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": [
"0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"
],
"method": "eth_getTransactionByHash"
}'

Request Parameters

  • 'transaction hash': [Required] A string representing the hash (32 bytes) of a transaction.

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2",
"blockNumber": "0x5daf3b",
"hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
"from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d",
"gas": "0xc350",
"gasPrice": "0x4a817c800",
"input": "0x68656c6c6f21",
"nonce": "0x15",
"r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
"s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c",
"to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb",
"transactionIndex": "0x41",
"type": "0x0",
"v": "0x25",
"value": "0xf3dbb76162000"
}
}

A transaction object, or 'null' when no transaction was found. The transaction object will consist of the following keys and their values:

  • 'accessList': [Optional] A list of addresses and storage keys accessed by the transaction. See access list transactions.
  • 'blockHash': 32 bytes. A hash of the block including this transaction. 'null' when it's pending.
  • 'blockNumber': The number of the block including this transaction. 'null' when it's pending.
  • 'chainID': [Optional] Chain ID specifying the network. Returned only for EIP-1559 transactions.
  • 'from': 20 bytes. The address of the sender.
  • 'gas': Gas provided by the sender.
  • 'gasPrice': Gas price provided by the sender in Wei.
  • 'hash': 32 bytes. The hash of the transaction.
  • 'input': The data sent along with the transaction.
  • 'maxPriorityFeePerGas': [Optional] Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions.
  • 'maxFeePerGas': [Optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See EIP-1559 transactions.
  • 'nonce': The number of transactions made by the sender prior to this one.
  • 'r': 32 bytes. The ECDSA signature 'r'.
  • 's': 32 bytes. The ECDSA signature 's'.
  • 'to': 20 bytes. The address of the receiver. 'null' when it's a contract creation transaction.
  • 'transactionIndex': The transaction's index position in the block, in hexadecimal. 'null' when it's pending.
  • 'type': The transaction type.
  • 'v': The ECDSA recovery ID.
  • 'value': The value transferred in Wei.