eth_getBlockByHash
curl --request POST \
--url https://api.mainnet.abs.xyz/eth_getBlockByHash \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
false
]
}
'import requests
url = "https://api.mainnet.abs.xyz/eth_getBlockByHash"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", False]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_getBlockByHash',
params: ['0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae', false]
})
};
fetch('https://api.mainnet.abs.xyz/eth_getBlockByHash', 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://api.mainnet.abs.xyz/eth_getBlockByHash",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'method' => 'eth_getBlockByHash',
'params' => [
'0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae',
false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mainnet.abs.xyz/eth_getBlockByHash"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\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))
}HttpResponse<String> response = Unirest.post("https://api.mainnet.abs.xyz/eth_getBlockByHash")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.abs.xyz/eth_getBlockByHash")
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 \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x1b4",
"hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
"parentHash": "0x59f0ff194fe56f5b5fe5436df726c0f6201ce7d6364a04361c7324cceb322a67",
"nonce": "0x0000000000000000",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x3e8",
"gasLimit": "0x6691b7",
"gasUsed": "0x5208",
"timestamp": "0x5d9676a0",
"transactions": [],
"uncles": []
}
}Ethereum API
eth_getBlockByHash
Returns information about a block by hash
POST
/
eth_getBlockByHash
eth_getBlockByHash
curl --request POST \
--url https://api.mainnet.abs.xyz/eth_getBlockByHash \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
false
]
}
'import requests
url = "https://api.mainnet.abs.xyz/eth_getBlockByHash"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", False]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_getBlockByHash',
params: ['0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae', false]
})
};
fetch('https://api.mainnet.abs.xyz/eth_getBlockByHash', 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://api.mainnet.abs.xyz/eth_getBlockByHash",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'method' => 'eth_getBlockByHash',
'params' => [
'0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae',
false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mainnet.abs.xyz/eth_getBlockByHash"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\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))
}HttpResponse<String> response = Unirest.post("https://api.mainnet.abs.xyz/eth_getBlockByHash")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mainnet.abs.xyz/eth_getBlockByHash")
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 \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"eth_getBlockByHash\",\n \"params\": [\n \"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae\",\n false\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x1b4",
"hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
"parentHash": "0x59f0ff194fe56f5b5fe5436df726c0f6201ce7d6364a04361c7324cceb322a67",
"nonce": "0x0000000000000000",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x3e8",
"gasLimit": "0x6691b7",
"gasUsed": "0x5208",
"timestamp": "0x5d9676a0",
"transactions": [],
"uncles": []
}
}Body
application/json
Was this page helpful?
⌘I