proxy/eth_gasPrice - 获取当前gas价格
使用proxy模块的eth_gasPrice方法获取当前的gas价格。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_gasPrice
- apikey:etherscan API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果,当前的gas价格,单位:wei
- error:错误信息
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_gasPrice&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 73,
"result": "0xee6b2800"
}