Horizon API
Fee stats
The fee stats endpoint provides information about per-operation fee stats over the last 5 ledgers.
GET
/
fee_stats
Retrieve Fee Stats
curl --request GET \
--url 'https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats'import requests
url = "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"last_ledger": "43277313",
"last_ledger_base_fee": "100",
"ledger_capacity_usage": "1",
"fee_charged": {
"max": "5500",
"min": "5000",
"mode": "5000",
"p10": "5000",
"p20": "5000",
"p30": "5000",
"p40": "5000",
"p50": "5001",
"p60": "5001",
"p70": "5066",
"p80": "5066",
"p90": "5500",
"p95": "5500",
"p99": "5500"
},
"max_fee": {
"max": "616065406",
"min": "5000",
"mode": "10003",
"p10": "10000",
"p20": "10003",
"p30": "10003",
"p40": "20005",
"p50": "20005",
"p60": "50020",
"p70": "50020",
"p80": "150000",
"p90": "500000",
"p95": "500000",
"p99": "1490000"
}
}Retrieve Fee Stats
curl --request GET \
--url 'https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats'import requests
url = "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://{network}.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/fee_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"last_ledger": "43277313",
"last_ledger_base_fee": "100",
"ledger_capacity_usage": "1",
"fee_charged": {
"max": "5500",
"min": "5000",
"mode": "5000",
"p10": "5000",
"p20": "5000",
"p30": "5000",
"p40": "5000",
"p50": "5001",
"p60": "5001",
"p70": "5066",
"p80": "5066",
"p90": "5500",
"p95": "5500",
"p99": "5500"
},
"max_fee": {
"max": "616065406",
"min": "5000",
"mode": "10003",
"p10": "10000",
"p20": "10003",
"p30": "10003",
"p40": "20005",
"p50": "20005",
"p60": "50020",
"p70": "50020",
"p80": "150000",
"p90": "500000",
"p95": "500000",
"p99": "1490000"
}
}