Home

Estimate gas for a transaction

POST
https://vinu.nownodes.io/

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Simulates a transaction and returns an estimate of how much gas would be used.

State access is limited to recent blocks - these are full nodes, not archive nodes. In practice only the last dozen or so blocks resolve; deeper block parameters return -32000 missing trie node <hash> (path ). earliest also works, since genesis state is kept. Use latest or pending for anything that must not fail: the pruning boundary moves continuously, so a height taken from eth_blockNumber can already be out of range by the time you query it.

Block, transaction and receipt history is complete back to block 1 - only state is pruned.

Changed in the 29 August 2026 network upgrade.

  • The search ceiling is capped at the per-transaction gas limit params.MaxTxGasLimit. A request asking for more is silently capped, so an estimate can now come back lower than the caller's gas hint instead of tracking it.
  • Each probe of the binary search now runs under a 5 second timeout (previously unbounded). A heavy call that used to return a slow estimate can now fail instead - budget for a retry.

Body

application/json
jsonrpcstringrequired

JSON-RPC protocol version

methodstringrequired

The method name

paramsArray<object | string>required

The transaction call object and an optional block tag.

Show child attributes
One of
fromstring

Address the transaction is sent from (optional)

tostringrequired

Destination address of the call

gasstring

Gas limit provided for execution (optional)

gasPricestring

Gas price in wei (optional)

valuestring

Amount of ETH to send, in hexadecimal wei (optional)

datastring

The compiled input data for the transaction (optional)

Optional block tag (e.g., "latest", "earliest", or a block number)

string
idintegerrequired

Request identifier

Response

200OK

Estimated gas amount

405Method Not Allowed

Method not served by this endpoint. The body is the plain-text string Method Not Allowed, not JSON.

422Unprocessable Entity

Missing API key - the api-key header was absent. The body is the plain-text string Missing API_key, not JSON.