> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/api-reference/json-rpc/eth-gasprice.md).

# eth\_gasPrice

POST `https://mainnet.valuechain.xyz`

Returns the current gas price in wei per gas.

See [Gas & Fees](/documentation/for-developers/developers/valuechain-evm/gas-and-fees.md). EIP-1559 is enabled; the base fee is paid to the block builder, not burned.

## Parameters

None.

## Result

**Gas price** (quantity): Hex-encoded price per gas in wei of SOSO. This is not the total transaction fee.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1e8480"
}
```

## Code examples

### cURL

```bash
curl --request POST \
  --url https://mainnet.valuechain.xyz \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_gasPrice", "params": []}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"jsonrpc": "2.0", "id": 1, "method": "eth_gasPrice", "params": []})
};

fetch('https://mainnet.valuechain.xyz', options)
  .then((res) => res.json())
  .then((res) => console.log(res))
  .catch((err) => console.error(err));
```

### Python

```python
import requests

url = "https://mainnet.valuechain.xyz"
payload = {
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_gasPrice",
  "params": []
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
```
