Get a Bitcoin block by height or hash
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}', 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.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"totalPages": 123,
"itemsOnPage": 123,
"hash": "<string>",
"previousBlockHash": "<string>",
"height": 123,
"size": 123,
"time": 123,
"txCount": 123,
"chainFamily": "Bitcoin",
"txs": [
{
"txid": "<string>",
"vin": [
{
"txid": "<string>",
"vout": 123,
"sequence": 123,
"n": 123,
"addresses": [
"<string>"
],
"isAddress": true,
"value": "<string>",
"hex": "<string>"
}
],
"vout": [
{
"n": 123,
"value": "<string>",
"addresses": [
"<string>"
],
"isAddress": true,
"spent": true,
"hex": "<string>"
}
],
"blockHash": "<string>",
"blockHeight": 123,
"blockTime": 123,
"value": "<string>",
"fees": "<string>",
"tokenTransfers": [
{
"type": "<string>",
"from": "<string>",
"to": "<string>",
"token": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"value": "<string>"
}
],
"chainFamily": "Bitcoin",
"bitcoinSpecific": {
"version": 123,
"locktime": 123,
"weight": 123,
"vsize": 123,
"valueIn": "<string>",
"hex": "<string>",
"miscJson": "<string>"
},
"meta": {
"syncedAt": {
"bitcoin": "latest"
}
}
}
],
"bitcoinSpecific": {
"bits": "<string>",
"chainwork": "<string>",
"difficulty": "<string>",
"merkleRoot": "<string>",
"miner": "<string>",
"nonce": "<string>",
"weight": "<string>",
"witnessCommitment": "<string>"
},
"meta": {
"syncedAt": {
"bitcoin": "latest"
}
}
}Blockchain API
Get Block
Returns full Bitcoin block data including transactions, inputs, outputs, and UTXO-level detail.
GET
/
v1
/
chains
/
{chainAlias}
/
blocks
/
{blockIdentifier}
Get a Bitcoin block by height or hash
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}', 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.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/blocks/{blockIdentifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"totalPages": 123,
"itemsOnPage": 123,
"hash": "<string>",
"previousBlockHash": "<string>",
"height": 123,
"size": 123,
"time": 123,
"txCount": 123,
"chainFamily": "Bitcoin",
"txs": [
{
"txid": "<string>",
"vin": [
{
"txid": "<string>",
"vout": 123,
"sequence": 123,
"n": 123,
"addresses": [
"<string>"
],
"isAddress": true,
"value": "<string>",
"hex": "<string>"
}
],
"vout": [
{
"n": 123,
"value": "<string>",
"addresses": [
"<string>"
],
"isAddress": true,
"spent": true,
"hex": "<string>"
}
],
"blockHash": "<string>",
"blockHeight": 123,
"blockTime": 123,
"value": "<string>",
"fees": "<string>",
"tokenTransfers": [
{
"type": "<string>",
"from": "<string>",
"to": "<string>",
"token": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"value": "<string>"
}
],
"chainFamily": "Bitcoin",
"bitcoinSpecific": {
"version": 123,
"locktime": 123,
"weight": 123,
"vsize": 123,
"valueIn": "<string>",
"hex": "<string>",
"miscJson": "<string>"
},
"meta": {
"syncedAt": {
"bitcoin": "latest"
}
}
}
],
"bitcoinSpecific": {
"bits": "<string>",
"chainwork": "<string>",
"difficulty": "<string>",
"merkleRoot": "<string>",
"miner": "<string>",
"nonce": "<string>",
"weight": "<string>",
"witnessCommitment": "<string>"
},
"meta": {
"syncedAt": {
"bitcoin": "latest"
}
}
}For Bitcoin, pass
bitcoin (or bitcoin-mainnet) as chainAlias. The blockIdentifier accepts either a Bitcoin block height (all-digit values are treated as heights) or a block hash (any other value is forwarded as a hash).Path Parameters
Query Parameters
Response
200 - application/json

