# getRecentPrioritizationFees

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

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

Returns a list of prioritization fees from recent blocks.

Reference: https://www.alchemy.com/docs/chains/solana/solana-api-endpoints/get-recent-prioritization-fees

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Account addresses | string[] | No | An array of up to 128 account addresses. If provided, the response will reflect a fee to land a transaction locking all of the provided accounts as writable. |

## Result

**Prioritization fees** (object[]): An array of prioritization fees observed in recent blocks.

## Code Examples

### cURL

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

### JavaScript

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

fetch('https://solana-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://solana-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getRecentPrioritizationFees",
    "params": [["string"]]
}
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://solana-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getRecentPrioritizationFees\",\n  \"params\": [\n    [\n      \"string\"\n    ]\n  ]\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://solana-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getRecentPrioritizationFees\",\n  \"params\": [\n    [\n      \"string\"\n    ]\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://solana-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\": \"getRecentPrioritizationFees\",\n  \"params\": [\n    [\n      \"string\"\n    ]\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: getRecentPrioritizationFees
description: Returns a list of prioritization fees from recent blocks.
params:
  - name: Account addresses
    required: false
    description: An array of up to 128 account addresses. If provided, the response will reflect a fee to land a transaction locking all of the provided accounts as writable.
    schema:
      type: array
      items:
        title: Pubkey
        type: string
        description: Base-58 encoded public key.
result:
  name: Prioritization fees
  description: An array of prioritization fees observed in recent blocks.
  schema:
    title: Recent Prioritization Fees
    type: array
    description: An array of prioritization fees observed in recent blocks.
    items:
      title: Recent Prioritization Fee
      type: object
      properties:
        slot:
          type: integer
          description: Slot in which the fee was observed.
        prioritizationFee:
          type: integer
          description: The per-compute-unit fee in micro-lamports.
```
