Skip to main content
POST
/
eth-rpc#eth_estimateGas
Estimate Gas
curl --request POST \
  --url 'https://eth.blockscout.com/api/eth-rpc?apikey=#eth_estimateGas' \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
      "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
      "value": "0x186a0"
    },
    "latest"
  ],
  "id": 1
}
'
{
  "jsonrpc": "2.0",
  "result": "0x5208",
  "id": 1
}

Authorizations

apikey
string
query
required

Optional API key for increased rate limits.

Without API key:

  • 5 requests per second (shared pool)
  • No registration required

With API key:

  • 10 requests per second per key
  • Up to 3 free keys per account
  • Get your API key at https://blockscout.com (login required)

Usage: Add apikey=YOUR_KEY to any request query string.

Body

application/json
jsonrpc
enum<string>
required
Available options:
2.0
Example:

"2.0"

method
enum<string>
required
Available options:
eth_estimateGas
Example:

"eth_estimateGas"

params
(string | boolean | object | integer)[]
required
Example:
[
{
"from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
"value": "0x186a0"
},
"latest"
]
id
required
Example:

1

Response

200 - application/json

Successful JSON-RPC response

jsonrpc
string
Example:

"2.0"

result
any

Method result (varies by method)

id
Example:

1