> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/bnb-getgasprice",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# eth_gasPrice | BNB Chain

BNB API method that returns the current gas base fee of the network. The gas price is the quantity of the native token the transaction's sender must pay per unit of gas consumed. The value returned is in Wei.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `none`

## Response

* `quantity` — the integer value of the current gas base fee, returned in Wei

## `eth_gasPrice` code examples

<CodeGroup>
  ```javascript web3.js theme={"system"}
  const { Web3 } = require("web3");
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const web3 = new Web3(NODE_URL);

  async function getGasPrice() {
      const baseFee = await web3.eth.getGasPrice();
      const feeInGwei = web3.utils.fromWei(baseFee, "gwei")
      console.log(`The base gas fee is: ${baseFee} Wei`);
      console.log(`The base gas fee is: ${feeInGwei} Gwei`);
    }
    
    getGasPrice()
  ```

  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(node_url);

  async function getGasPrice() {
    const baseFee = await provider.send("eth_gasPrice");
    console.log(`The base gas fee is: ${baseFee} Wei`);
  }

  getGasPrice()
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3  
  node_url = "CHAINSTACK_NODE_URL"

  web3 = Web3(Web3.HTTPProvider(node_url)) 
  print(web3.eth.gas_price)  
  ```
</CodeGroup>

## Use case

You can use `eth_gasPrice` to calculate the total gas value to send with a transaction based on the base and priority fee system. Ethereum's London hard fork implemented This concept with EIP-1559.

EIP-1559 aimed to solve the problem of network congestion by implementing a dynamic fee market mechanism, which adjusts the fee required to process a transaction based on network demand. With the current system, the total gas price comprises a **base fee** determined by the network's load and a **priority fee** added by the user.

<Note>
  **Note**

  The `eth_gasPrice` method returns the base fee.
</Note>


## OpenAPI

````yaml /openapi/bnb_node_api/eth_gasPrice.json POST /35848e183f3e3303c8cfeacbea831cab
openapi: 3.0.0
info:
  title: BNB Node API
  version: 1.0.0
  description: This is an API for interacting with an BNB node.
servers:
  - url: https://bsc-mainnet.core.chainstack.com
security: []
paths:
  /35848e183f3e3303c8cfeacbea831cab:
    post:
      tags:
        - upload
      summary: eth_gasPrice
      operationId: getGasPrice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_gasPrice
                params:
                  type: array
                  default: []
      responses:
        '200':
          description: The value of the current gas base fee in Wei.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````