Alchemy Logo

eth_estimateGas

POST
/{apiKey}

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

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?