> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.galleon8.com/api-reference/node-api/ethereum/api-endpoints/standard-api/eth-fee-history/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # eth_feeHistory POST https://node-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range. Reference: https://docs.galleon8.com/api-reference/node-api/ethereum/api-endpoints/standard-api/eth-fee-history ## Request ### Body (application/json) This endpoint expects an object. - `blockCount` (string, required) — Number of blocks in the requested fee history. - `newestBlock` (any, required) — Newest block number or tag for the fee history range. - `rewardPercentiles` (list of double, optional) — Optional priority fee percentiles to sample for each block. ## Response ### 200 Historical fee data for the requested block range. - `oldestBlock` (string, required) — Hex-encoded integer quantity. - `baseFeePerGas` (list of string, required) - `gasUsedRatio` (list of double, required) - `reward` (list of list of string, optional) ## Examples **Request** ```json [ "0x4", "latest", [ 10, 50, 90 ] ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "oldestBlock": "0x10d4c", "baseFeePerGas": [ "0x3b9aca00", "0x3c6bf526", "0x3d2f31ac", "0x3e1d2c80", "0x3f0f4a40" ], "gasUsedRatio": [ 0.42, 0.55, 0.61, 0.49 ], "reward": [ [ "0x77359400", "0x9502f900", "0xb2d05e00" ], [ "0x77359400", "0x9502f900", "0xb2d05e00" ], [ "0x77359400", "0x9502f900", "0xb2d05e00" ], [ "0x77359400", "0x9502f900", "0xb2d05e00" ] ] } } ``` **SDK Code** ```python import requests url = "https://node-api-docs-proxy.galleon8.workers.dev/" payload = ["0x4", "latest", [10, 50, 90]] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://node-api-docs-proxy.galleon8.workers.dev/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["0x4","latest",[10,50,90]]' }; 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://node-api-docs-proxy.galleon8.workers.dev/" payload := strings.NewReader("[\n \"0x4\",\n \"latest\",\n [\n 10,\n 50,\n 90\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://node-api-docs-proxy.galleon8.workers.dev/") 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 \"0x4\",\n \"latest\",\n [\n 10,\n 50,\n 90\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://node-api-docs-proxy.galleon8.workers.dev/") .header("Content-Type", "application/json") .body("[\n \"0x4\",\n \"latest\",\n [\n 10,\n 50,\n 90\n ]\n]") .asString(); ``` ```php request('POST', 'https://node-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "0x4", "latest", [ 10, 50, 90 ] ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://node-api-docs-proxy.galleon8.workers.dev/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"0x4\",\n \"latest\",\n [\n 10,\n 50,\n 90\n ]\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["0x4", "latest", [10, 50, 90]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://node-api-docs-proxy.galleon8.workers.dev/")! 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() ```