# zks_getL1GasPrice - Lens

> Example code for the zks_getL1GasPrice JSON-RPC method. Complete guide on how to use zks_getL1GasPrice JSON-RPC in GetBlock Web3 documentation.

Returns the L1 gas price that Lens currently uses to compute the data-availability portion of transaction fees.

## Parameters

> **Info:** This method takes an empty `params` array.

## Request

#### cURL

```bash
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "zks_getL1GasPrice",
    "params": [],
    "id": "getblock.io"
}'
```

#### Axios

#### example.js

```javascript
const axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', { jsonrpc: '2.0', method: 'zks_getL1GasPrice', params: [], id: 'getblock.io' }, { headers: { 'Content-Type': 'application/json' } });
console.log(response.data.result);
```

#### Request

#### example.py

```python
import requests
response = requests.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', headers={'Content-Type': 'application/json'}, json={'jsonrpc': '2.0', 'method': 'zks_getL1GasPrice', 'params': [], 'id': 'getblock.io'})
print(response.json())
```

#### Rust

#### example.rs

```rust
use reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").json(&json!({"jsonrpc":"2.0","method":"zks_getL1GasPrice","params":[],"id":"getblock.io"})).send().await?.json::<Value>().await?;
    println!("{}", res["result"]);
    Ok(())
}
```

## Response

```json
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x3b9aca00"
}
```

## Response Fields

| Field | Type | Description |
| --- | --- | --- |
| result | string | L1 gas price in wei (hex) |

## Use Cases

* **Fee Modelling**: Factor L1 costs into fee estimates
* **Monitoring**: Track the L1 fee component

## Error Handling

| Error | Message | Description |
| --- | --- | --- |
| -32602 / Invalid params | Invalid params | A parameter was malformed |
| 403 / RBAC: access denied | Access denied | The GetBlock access token is missing or incorrect |
