Get Blocks
curl --request GET \
--url https://api.rated.network/v0/eth/blocks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.rated.network/v0/eth/blocks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rated.network/v0/eth/blocks', 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.rated.network/v0/eth/blocks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.rated.network/v0/eth/blocks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.rated.network/v0/eth/blocks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rated.network/v0/eth/blocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"page": {
"from": 123,
"to": 123,
"size": 10
},
"total": 1,
"data": [
{
"epoch": 1,
"consensusSlot": 1,
"consensusBlockRoot": "<string>",
"executionBlockNumber": 1,
"executionBlockHash": "<string>",
"validatorIndex": 1,
"feeRecipient": "<string>",
"totalType0Transactions": 1,
"totalType2Transactions": 1,
"totalTransactions": 1,
"totalGasUsed": 1,
"baseFeePerGas": 1,
"totalBurntFees": 1,
"totalType2TxFees": 1,
"totalType0TxFees": 1,
"totalPriorityFees": 1,
"baselineMev": 1,
"executionProposerDuty": "<string>",
"executionRewards": 1,
"missedExecutionRewards": 1,
"consensusProposerDuty": "<string>",
"consensusRewards": 1,
"missedConsensusRewards": 1,
"totalRewards": 1,
"totalRewardsMissed": 1,
"totalType1Transactions": 1,
"totalType1TxFees": 1,
"blockTimestamp": "2023-11-07T05:31:56Z",
"totalSanctionedTransactions": 1,
"totalPriorityFeesValidator": 1,
"relays": [
"<string>"
],
"blockBuilderPubkeys": [
"<string>"
],
"totalType3Transactions": 1,
"totalType3TxFees": 1,
"totalPriorityFeesWei": 1,
"totalPriorityFeesValidatorWei": 1,
"baselineMevWei": 1,
"executionRewardsWei": 1,
"totalType4Transactions": 1,
"totalType4TxFees": 1
}
],
"next": "<string>"
}{
"detail": [
{
"msg": "<string>",
"type": "<string>",
"loc": [
"<string>"
]
}
]
}Blocks
List of slots and blocks
GET
/
v0
/
eth
/
blocks
Get Blocks
curl --request GET \
--url https://api.rated.network/v0/eth/blocks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.rated.network/v0/eth/blocks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rated.network/v0/eth/blocks', 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.rated.network/v0/eth/blocks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.rated.network/v0/eth/blocks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.rated.network/v0/eth/blocks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rated.network/v0/eth/blocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"page": {
"from": 123,
"to": 123,
"size": 10
},
"total": 1,
"data": [
{
"epoch": 1,
"consensusSlot": 1,
"consensusBlockRoot": "<string>",
"executionBlockNumber": 1,
"executionBlockHash": "<string>",
"validatorIndex": 1,
"feeRecipient": "<string>",
"totalType0Transactions": 1,
"totalType2Transactions": 1,
"totalTransactions": 1,
"totalGasUsed": 1,
"baseFeePerGas": 1,
"totalBurntFees": 1,
"totalType2TxFees": 1,
"totalType0TxFees": 1,
"totalPriorityFees": 1,
"baselineMev": 1,
"executionProposerDuty": "<string>",
"executionRewards": 1,
"missedExecutionRewards": 1,
"consensusProposerDuty": "<string>",
"consensusRewards": 1,
"missedConsensusRewards": 1,
"totalRewards": 1,
"totalRewardsMissed": 1,
"totalType1Transactions": 1,
"totalType1TxFees": 1,
"blockTimestamp": "2023-11-07T05:31:56Z",
"totalSanctionedTransactions": 1,
"totalPriorityFeesValidator": 1,
"relays": [
"<string>"
],
"blockBuilderPubkeys": [
"<string>"
],
"totalType3Transactions": 1,
"totalType3TxFees": 1,
"totalPriorityFeesWei": 1,
"totalPriorityFeesValidatorWei": 1,
"baselineMevWei": 1,
"executionRewardsWei": 1,
"totalType4Transactions": 1,
"totalType4TxFees": 1
}
],
"next": "<string>"
}{
"detail": [
{
"msg": "<string>",
"type": "<string>",
"loc": [
"<string>"
]
}
]
}This endpoint gives a paginated list of all slots and blocks.
Here’s how to interpret the inputs required to operate it 👇
| Parameter | Description |
|---|---|
from | Start slot (integer) |
size | The number of results included per page |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Available options:
mainnet, hoodi, holesky ⌘I