Home

Estimate Gas for Transaction

POST
https://eth-sepolia.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.

Body

application/json

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

Request payload for Estimate Gas for Transaction.

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

Single JSON-RPC parameter value accepted by this method.

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

401Unauthorized

Unauthorized: API key is present but rejected by the NOWNodes gateway.

405Method Not Allowed

Method Not Allowed. Returned by the NOWNodes gateway for malformed or unsupported gateway-level requests.

422Unprocessable Entity

Missing API key. The NOWNodes gateway returns plain text for this error.

500Internal Server Error

Upstream node or gateway error.