Alchemy Logo

eth_estimateGas

POST
/{apiKey}

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.

linea_estimateGas uses the same inputs as the standard eth_estimateGas, but returns the recommended gas limit, the base fee per gas, and the priority fee per gas. We recommend using linea_estimateGas for more accurate results.

Path Parameters

apiKeystringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

Transactionobjectrequired

The transaction object for which to estimate gas usage.

Blockstring or enumoptional

The block number or tag at which to estimate gas usage. Defaults to 'latest' if not provided.

Responses

200

The estimated amount of gas required for the transaction, as a hexadecimal string.

Was this page helpful?