# zks_getFeeParams

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://zksync-mainnet.g.alchemy.com/v2/{apiKey}

Retrieves the current fee parameters.

Reference: https://www.alchemy.com/docs/chains/zksync/zk-sync-api-endpoints/zks-get-fee-params

## Result

**Fee parameters** (object): Current fee parameters.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "V2": {
      "config": {
        "minimal_l2_gas_price": 25000000,
        "compute_overhead_part": 0,
        "pubdata_overhead_part": 1,
        "batch_overhead_l1_gas": 800000,
        "max_gas_per_batch": 200000000,
        "max_pubdata_per_batch": 240000
      },
      "l1_gas_price": 46226388803,
      "l1_pubdata_price": 100780475095
    }
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://zksync-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zks_getFeeParams"
}'
```

### JavaScript

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

fetch('https://zksync-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://zksync-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "zks_getFeeParams"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://zksync-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getFeeParams\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://zksync-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getFeeParams\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://zksync-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zks_getFeeParams\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: zks_getFeeParams
summary: Retrieves the current fee parameters.
description: Retrieves the current fee parameters.
params: []
result:
  name: Fee parameters
  description: Current fee parameters.
  schema:
    type: object
    properties:
      V2:
        type: object
        description: Fee parameter configuration for the current version of the ZKsync protocol
        properties:
          config:
            type: object
            description: Settings related to transaction fee computation
            properties:
              minimal_l2_gas_price:
                type: integer
                format: uint64
                description: Minimal gas price on L2
              compute_overhead_part:
                type: number
                format: float64
                description: Compute overhead part in fee calculation
              pubdata_overhead_part:
                type: number
                format: float64
                description: Public data overhead part in fee calculation
              batch_overhead_l1_gas:
                type: integer
                format: uint64
                description: Overhead in L1 gas for a batch of transactions
              max_gas_per_batch:
                type: integer
                format: uint64
                description: Maximum gas allowed per batch
              max_pubdata_per_batch:
                type: integer
                format: uint64
                description: Maximum amount of public data allowed per batch
          l1_gas_price:
            type: integer
            format: uint64
            description: Current L1 gas price
          l1_pubdata_price:
            type: integer
            format: uint64
            description: Price of storing public data on L1
examples:
  - name: zks_getFeeParams example
    params: []
    result:
      name: Fee parameters
      value:
        V2:
          config:
            minimal_l2_gas_price: 25000000
            compute_overhead_part: 0
            pubdata_overhead_part: 1
            batch_overhead_l1_gas: 800000
            max_gas_per_batch: 200000000
            max_pubdata_per_batch: 240000
          l1_gas_price: 46226388803
          l1_pubdata_price: 100780475095
```
