Polygon
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Polygon
Free tier covers personal projects. Pay-as-you-go scales without a card.
eth_getTransactionByBlockNumberAndIndex returns one transaction from Polygon PoS (chain ID 137) addressed by a block — given as a height or a tag like latest or pending — plus the zero-based index of the transaction within it. Polygon's MATIC-fee, EVM-equivalent design and ~2-second Bor blocks make this handy for sequential scanning when you are iterating by block number rather than resolving block hashes first. Point the request at https://polygon.therpc.io/YOUR_API_KEY and it returns the same transaction object as eth_getTransactionByHash, or null if the block or index is out of range.
0x0) of each Polygon block for MEV and ordering research.pending tag while Bor is still assembling it.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockTag | string | Yes | The block containing the transaction. |
| 2 | transactionIndex | string (hex) | Yes | Zero-based position of the transaction within the block. |
| Type | Description |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the Polygon playground.
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or transaction index is not a valid hex integer. |
"0x0", not the integer 0, for the first transaction.pending tag are not stable: which transactions appear and in what order depends on the node's current Bor mempool view and can differ between clients and between calls.Parameters
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0" for the first transaction)