getblock
curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getblock",
"params": [
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
],
"id": 1
}
'import requests
url = "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload = {
"jsonrpc": "1.0",
"method": "getblock",
"params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"],
"id": 1
}
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: '1.0',
method: 'getblock',
params: ['000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'],
id: 1
})
};
fetch('https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8', 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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8",
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' => '1.0',
'method' => 'getblock',
'params' => [
'000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'
],
'id' => 1
]),
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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload := strings.NewReader("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
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\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"result": {},
"error": {},
"id": 123
}Bitcoin node API
getblock | Bitcoin
The getblock method retrieves a block from the blockchain by its hash or height. Available on Bitcoin via Chainstack JSON-RPC nodes.
POST
/
788f110831fe13808302bd79796d55e8
getblock
curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getblock",
"params": [
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
],
"id": 1
}
'import requests
url = "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload = {
"jsonrpc": "1.0",
"method": "getblock",
"params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"],
"id": 1
}
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: '1.0',
method: 'getblock',
params: ['000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'],
id: 1
})
};
fetch('https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8', 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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8",
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' => '1.0',
'method' => 'getblock',
'params' => [
'000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'
],
'id' => 1
]),
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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload := strings.NewReader("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\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://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
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\": \"1.0\",\n \"method\": \"getblock\",\n \"params\": [\n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"result": {},
"error": {},
"id": 123
}The
getblock method retrieves a block from the blockchain by its hash or height. If the verbosity parameter is omitted, the method returns a serialized block in hex format. If the verbosity parameter is set to 1, the method returns an Object with information about the block. If the verbosity parameter is set to 2, the method returns an Object with information about the block and information about each transaction.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
blockhash(required) — a string representing the hash of the block to retrieve.verbosity(optional, default=1) — an integer specifying the level of detail to include in the response:0— returns a serialized block in hex format.1— returns an Object with information about the block.2— returns an Object with information about the block and information about each transaction.
Response
result— the requested block data, either as a serialized block in hex format, or as a JSON object with the following fields:hash— the block hash.confirmations— the number of confirmations.size— the block size in bytes.strippedsize— the block size excluding witness data.weight— the block weight.height— the block height or index.version— the block version.versionHex— the block version formatted in hexadecimal.merkleroot— the merkle root.tx— the transaction ids (verbosity=1) or full transaction details (verbosity=2).time— the block time in seconds since epoch (Jan 1 1970 GMT).mediantime— the median block time in seconds since epoch (Jan 1 1970 GMT).nonce— the nonce.bits— the bits.difficulty— the difficulty.chainwork— the expected number of hashes required to produce the current chain
Body
application/json
Last modified on June 22, 2026
Was this page helpful?