GetBlockHeaderByHeight Access API Method
Parameters
Height
integer
REQUIRED
Loading...
Returns
block
object
Loading...
id
string
Loading...
parent_id
string
Loading...
height
integer
Loading...
timestamp
object
Loading...
seconds
integer
Loading...
nanos
integer
Loading...
payload_hash
string
Loading...
view
integer
Loading...
parent_voter_ids
string
Loading...
parent_voter_sig_data
string
Loading...
proposer_id
string
Loading...
proposer_sig_data
string
Loading...
chain_id
string
Loading...
parent_voter_indices
string
Loading...
Request
1package main23import (4"context"5"fmt"6"log"78"github.com/onflow/flow/protobuf/go/flow/access"9)1011func main() {1213// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.14client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15ctx := context.Background()16if err != nil {17log.Fatalf("err: %v", err)18}1920// Get Block Header by height21headerResp, err := client.GetBlockHeaderByHeight(ctx, &access.GetBlockHeaderByHeightRequest{Height: 54702736})22if err != nil {23log.Fatal("Get Block Header by height failed: ", err)24}25fmt.Printf("latest block header ID: %x \n", headerResp.Block.Id)2627}
1package main23import (4"context"5"fmt"6"log"78"github.com/onflow/flow/protobuf/go/flow/access"9)1011func main() {1213// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.14client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15ctx := context.Background()16if err != nil {17log.Fatalf("err: %v", err)18}1920// Get Block Header by height21headerResp, err := client.GetBlockHeaderByHeight(ctx, &access.GetBlockHeaderByHeightRequest{Height: 54702736})22if err != nil {23log.Fatal("Get Block Header by height failed: ", err)24}25fmt.Printf("latest block header ID: %x \n", headerResp.Block.Id)2627}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free