> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Get Gas Price \[fee.getGasPrice]

Returns the current price of gas (in wei).

## Usage

This example returns the current price of gas (in wei).

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const gasPrice = await client.fee.getGasPrice()
// @log: 2000000000n
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(publicActions())
```
:::

### Standalone Action

Call `Actions.fee.getGasPrice` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem'
import { client } from './viem.config'

const gasPrice = await Actions.fee.getGasPrice(client)
// @log: 2000000000n
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```
:::

## Return Value

`bigint`

The current gas price, in wei.
