> For a complete page index, fetch https://docs.conduit.xyz/llms.txt # eth_feeHistory POST https://rpc.plume.org/YOUR_API_KEY Content-Type: application/json Returns the base fee per gas, gas used ratio, blob base fee per gas (EIP-4844), blob gas used ratio (EIP-4844), and optionally per-block reward percentiles for the requested block range. Used to estimate appropriate gas prices and tip values. The response arrays are sized relative to `blockCount`: - `baseFeePerGas` and `blobBaseFeePerGas` have length `blockCount + 1` (one extra entry for the next block). - `gasUsedRatio` and `blobGasUsedRatio` have length `blockCount`. - `reward` (when `rewardPercentiles` is provided) has length `blockCount`; each entry is an array with one value per requested percentile. ⚡ Compute Units: [10 CU](https://docs.conduit.xyz/rpc-nodes/information/compute-units) Reference: https://docs.conduit.xyz/rpc-nodes/json-rpc-reference/eth-fee-history ## Request ### Body (application/json) This endpoint expects an object. - `blockCount` (string, required) — Number of blocks in the requested range (1-1024). Hex-encoded. - `newestBlock` (BlockNumberOrTag, required) — Highest block of the requested range, or one of "latest", "earliest", "pending", "finalized", "safe" - `rewardPercentiles` (list of double, optional) — Optional. Array of monotonically increasing percentile values [0, 100]. When provided, the response includes `reward` with the effective priority fee at each percentile for each block. ## Response ### 200 Fee history object - `oldestBlock` (string, required) — Lowest block number of the returned range. - `baseFeePerGas` (list of string, required) — Base fee per gas for each block, plus the next block's base fee. Length = blockCount + 1. - `gasUsedRatio` (list of double, required) — Ratio of gas used to gas limit for each block. Length = blockCount. - `blobBaseFeePerGas` (list of string, optional) — EIP-4844 blob base fee per gas for each block, plus the next block's. Length = blockCount + 1. Returned by post-Dencun nodes. - `blobGasUsedRatio` (list of double, optional) — EIP-4844 ratio of blob gas used to the per-block target for each block. Length = blockCount. Returned by post-Dencun nodes. - `reward` (list of list of string, optional) — Effective priority fee (tip) per gas at each requested percentile, per block. Only present when `rewardPercentiles` is supplied. Outer length = blockCount, inner length = rewardPercentiles.length. ## Types ### BlockNumberOrTag ## Examples **Request** ```json [ "0x5", "latest", [ 25, 50, 75 ] ] ``` **Response** ```json { "id": "1", "jsonrpc": "2.0", "result": { "baseFeePerGas": [ "0xe8d4a51000", "0xe8d4a51000", "0xe8d4a51000", "0xe8d4a51000", "0xe8d4a51000", "0xe8d4a51000" ], "gasUsedRatio": [ 0.000035268333333333336, 0.000035268333333333336, 0.00007705833333333333, 0.00015409666666666666, 0.00022733583333333333 ], "oldestBlock": "0x28401ce", "reward": [ [ "0x0", "0x0", "0x0" ], [ "0x0", "0x0", "0x0" ], [ "0x0", "0x0", "0x0" ], [ "0x0", "0x0", "0x0" ], [ "0x0", "0x0", "0x0" ] ] } } ``` **SDK Code** ```python import requests url = "https://rpc.plume.org/YOUR_API_KEY" payload = ["0x5", "latest", [25, 50, 75]] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://rpc.plume.org/YOUR_API_KEY'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["0x5","latest",[25,50,75]]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://rpc.plume.org/YOUR_API_KEY" payload := strings.NewReader("[\n \"0x5\",\n \"latest\",\n [\n 25,\n 50,\n 75\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(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://rpc.plume.org/YOUR_API_KEY") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "[\n \"0x5\",\n \"latest\",\n [\n 25,\n 50,\n 75\n ]\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://rpc.plume.org/YOUR_API_KEY") .header("Content-Type", "application/json") .body("[\n \"0x5\",\n \"latest\",\n [\n 25,\n 50,\n 75\n ]\n]") .asString(); ``` ```php request('POST', 'https://rpc.plume.org/YOUR_API_KEY', [ 'body' => '[ "0x5", "latest", [ 25, 50, 75 ] ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://rpc.plume.org/YOUR_API_KEY"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"0x5\",\n \"latest\",\n [\n 25,\n 50,\n 75\n ]\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["0x5", "latest", [25, 50, 75]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://rpc.plume.org/YOUR_API_KEY")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```