API Reference

eth_getTransactionByHash - Polygon

Polygon API - Returns the information about a transaction requested by transaction hash. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending.

Parameters

DATA, 32 Bytes - hash of a transaction

params: ["0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195"];

Returns

Object - A transaction object, or null when no transaction was found:

  • blockHash: DATA, 32 Bytes - Hash of the block where this transaction was in. Null when its pending.
  • blockNumber: QUANTITY - Block number where this transaction was in. Null when it's pending.
  • from: DATA, 20 Bytes - Address of the sender.
  • gas: QUANTITY - Gas provided by the sender.
  • gasPrice: QUANTITY - Gas price provided by the sender in Wei.
  • hash: DATA, 32 Bytes - Hash of the transaction.
  • input: DATA - The data send along with the transaction.
  • nonce: QUANTITY - The number of transactions made by the sender prior to this one.
  • to: DATA, 20 Bytes - Address of the receiver. null when it's a contract creation transaction.
  • transactionIndex: QUANTITY - Integer of the transactions index position in the block. Null when its pending.
  • value: QUANTITY - Value transferred in Wei.
  • v: QUANTITY - ECDSA recovery id
  • r: DATA, 32 Bytes - ECDSA signature r
  • s: DATA, 32 Bytes - ECDSA signature s

Example

Request

curl https://polygon-mainnet.unifra.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d'{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195,"id":0}'
URL: https://polygon-mainnet.unifra.io/v1/your-api-key
RequestType: POST
Body:
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByHash",
    "params":["0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195"],
    "id":0
}

Result

{
	"jsonrpc": "2.0",
	"id": 0,
	"result": {
		"blockHash": "0xb5acef6bbf84c1c0ec7a5009757e3a09ee25ec129b564d11fb976ce75f426c59",
		"blockNumber": "0xd7b488",
		"from": "0x7b5fc677cf27a807adf2ebcef72db3b935df6c0a",
		"gas": "0xb352c",
		"gasPrice": "0x9502f900",
		"hash": "0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195",
		"input": "0x405cec6700000000000000000000000024cf788254bb130bacb6ff519ef875b1d4b0008e000000000000000000000000ab45c5a4b0c941a2f231c04c3f49182e1a25405200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000009502f900000000000000000000000000000000000000000000000000000000000004ffa0000000000000000000000000000000000000000000000000000000000000104f0000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000002a434ee9791000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000010000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000750fd34fbb97abe5492338a3918552291a799ca0000000000000000000000000000000000000000000000000000000002114a0c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000750fd34fbb97abe5492338a3918552291a799ca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000006440993b26000000000000000000000000000000000000000000000000000000002114a0c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005fd8004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041dc112fa5131cb8f424321830c246c7aec27a5f86968d6eaace1926600716676633ec1f49b2d2eaea0ba7c10d9d97922f13e92002ab2e0610fc17d6ff3e4c60761b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"nonce": "0x3059e",
		"to": "0xd216153c06e857cd7f72665e0af1d7d82172f494",
		"transactionIndex": "0x4",
		"value": "0x0",
		"type": "0x0",
		"v": "0x1c",
		"r": "0x39aeddb2b67676e65e7d6f43fd57c731e17534fcfea0eb40d37be1224a8bb8f0",
		"s": "0x284defe0787533fc62c637acd2d9e89b2609350c1c26fd4dbb5386242e85a795"
	}
}
Language
Click Try It! to start a request and see the response here!