> 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-get-block-by-number/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # eth_getBlockByNumber POST https://node-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Returns information of the block matching the given block number. Reference: https://docs.galleon8.com/api-reference/node-api/ethereum/api-endpoints/standard-api/eth-get-block-by-number ## Request ### Body (application/json) This endpoint expects an object. - `block` (any, required) — Block number or tag to look up. - `fullTransactions` (boolean, required) — Set to true to return full transaction objects instead of transaction hashes. ## Response ### 200 Block details, or null when the block is not found. - `number` (string, required, nullable) — Hex-encoded integer quantity. - `hash` (string, required, nullable) — 32-byte block hash. - `parentHash` (string, required) — 32-byte block hash. - `nonce` (string, required, nullable) — Hex-encoded byte data. - `sha3Uncles` (string, required) — Hex-encoded byte data. - `logsBloom` (string, required, nullable) — Hex-encoded byte data. - `transactionsRoot` (string, required) — Hex-encoded byte data. - `stateRoot` (string, required) — Hex-encoded byte data. - `receiptsRoot` (string, required) — Hex-encoded byte data. - `miner` (string, required) — 20-byte EVM address. - `difficulty` (string, required) — Hex-encoded integer quantity. - `extraData` (string, required) — Hex-encoded byte data. - `size` (string, required) — Hex-encoded integer quantity. - `gasLimit` (string, required) — Hex-encoded integer quantity. - `gasUsed` (string, required) — Hex-encoded integer quantity. - `timestamp` (string, required) — Hex-encoded integer quantity. - `transactions` (list of BlockTransactionsItems, required) - `uncles` (list of string, required) - `totalDifficulty` (string, optional, nullable) — Hex-encoded integer quantity. - `baseFeePerGas` (string, optional) — Hex-encoded integer quantity. ## Types ### BlockTransactionsItems ### Transaction EVM transaction object. - `hash` (string, required) — 32-byte transaction hash. - `nonce` (string, required) — Hex-encoded integer quantity. - `blockHash` (string, required, nullable) — 32-byte block hash. - `blockNumber` (string, required, nullable) — Hex-encoded integer quantity. - `transactionIndex` (string, required, nullable) — Hex-encoded integer quantity. - `from` (string, required) — 20-byte EVM address. - `to` (string, required, nullable) — 20-byte EVM address. - `value` (string, required) — Hex-encoded integer quantity. - `gas` (string, required) — Hex-encoded integer quantity. - `gasPrice` (string, required) — Hex-encoded integer quantity. - `input` (string, required) — Hex-encoded byte data. - `type` (string, optional) — Hex-encoded integer quantity. - `chainId` (string, optional) — Hex-encoded integer quantity. - `v` (string, optional) — Hex-encoded integer quantity. - `r` (string, optional) — Hex-encoded integer quantity. - `s` (string, optional) — Hex-encoded integer quantity. - `maxFeePerGas` (string, optional) — Hex-encoded integer quantity. - `maxPriorityFeePerGas` (string, optional) — Hex-encoded integer quantity. ## Examples **Request** ```json [ "latest", false ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "number": "0x10d4f", "hash": "0x9f1409b7d65c3d4d9e2df8b4c6f52f8f91a4e1b9a6fdb0f1aa8e6d43f63c1f55", "parentHash": "0x8f1409b7d65c3d4d9e2df8b4c6f52f8f91a4e1b9a6fdb0f1aa8e6d43f63c1f44", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot": "0x1111111111111111111111111111111111111111111111111111111111111111", "receiptsRoot": "0x2222222222222222222222222222222222222222222222222222222222222222", "miner": "0x0000000000000000000000000000000000000000", "difficulty": "0x0", "totalDifficulty": "0x0", "extraData": "0x", "size": "0x2d0", "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "timestamp": "0x64f5b9c0", "transactions": [ "0x4e3b9f0d2f6e2c7b8a9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d" ], "uncles": [], "baseFeePerGas": "0x3b9aca00" } } ``` **SDK Code** ```python import requests url = "https://node-api-docs-proxy.galleon8.workers.dev/" payload = ["latest", False] 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: '["latest",false]' }; 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 \"latest\",\n false\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 \"latest\",\n false\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 \"latest\",\n false\n]") .asString(); ``` ```php request('POST', 'https://node-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "latest", false ]', '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 \"latest\",\n false\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["latest", false] 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() ```