Ethereum
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Ethereum
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_getTransactionByBlockNumberAndIndex returns the transaction at a given position inside a block, with the block addressed by its height or by a tag like latest, finalized, or pending. It's the sibling of the by-hash lookup, but keyed on number instead of hash, which is what you usually want for scanning forward through Ethereum mainnet (chain ID 1, gas paid in ETH) where heights are simple to iterate. Give it a block number and a zero-based hex index, and the node returns the full transaction object sitting at that slot, the same shape eth_getTransactionByHash produces. Querying by number lets you reach symbolic tags like pending that no fixed hash exists for. The endpoint is https://ethereum.therpc.io/YOUR_API_KEY.
0x0 from each height to study top-of-block placement, the slot MEV researchers care about most.pending block's contents by index to see what a client expects to include next from the mempool before the slot is sealed.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | blockTag | string | Oui | The block containing the transaction. |
| 2 | transactionIndex | string (hex) | Oui | 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 Ethereum playground.
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or transaction index is not a valid hex integer. |
"0x0" for the first transaction, never a decimal 0. Same goes for higher positions — "0xf", not 15.pending block is a client's local guess, not a finalized fact. Its ordering and even which transactions appear differ between geth, erigon, nethermind and besu, so don't treat a pending-tag result as canonical.Paramètres
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0" for the first transaction)