# eth\_estimateGas

**Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.**

[**Ethereum.org API Reference**](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)

**Parameters**

See [eth\_call](https://app.gitbook.com/o/-Ml9lAiUWtXZF3GXO6N3/s/iLoE65E22qMx9VF67gCT/~/changes/83/rpc-api-docs/chains/ethereum/standard-json-rpc-api/eth_call) parameters, except that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.

**Returns**

`QUANTITY` - the amount of gas used.

## Example

#### Request

```
curl --request POST \
     --url https://endpoints.omniatech.io/v1/RPC_ENDPOINT \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x00",
      "gasPrice": "0x09184e72a000",
      "value": "0x00",
      "data": "0x"
    },
    {
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x00",
      "gasPrice": "0x09184e72a000",
      "value": "0x00",
      "data": "0x"
    }
  ]
}
'
```

#### Response

```
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x5208" // 21000
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omniatech.io/rpc-api-docs/chains/fantom/ethereum-standard-json-rpc-api/eth_estimategas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
