Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 990 Bytes

eth_gasprice.md

File metadata and controls

56 lines (44 loc) · 990 Bytes
description
Returns the current price per gas in wei.

eth_gasPrice

{% hint style="info" %} If you are curious about the difference in gas price between this method and the eth gas station, check out this GitHub issue. {% endhint %}

Parameters

none

Returns

QUANTITY - integer of the current gas price in wei.

Example

Request

{% tabs %} {% tab title="Curl" %}

curl https://eth-mainnet.alchemyapi.io/v2/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":0}'

{% endtab %}

{% tab title="Postman" %}

URL: https://eth-mainnet.alchemyapi.io/v2/your-api-key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_gasPrice",
    "params":[],
    "id":0
}

{% endtab %} {% endtabs %}

Result

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x98bca5a00"
}