JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.vertices.listLatest({
pageSize: 10,
blockchainId: "x-chain",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices"
headers = {"x-glacier-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices",
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-glacier-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://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-glacier-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://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-glacier-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"vertices": [
{
"vertexHash": "<string>",
"parentHashes": [
"<string>"
],
"vertexHeight": 123,
"vertexIndex": 123,
"vertexTimestamp": 123,
"txCount": 123,
"transactions": [
"<string>"
],
"vertexSizeBytes": 123
}
],
"chainInfo": {
"chainName": "p-chain",
"network": "mainnet"
},
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}{
"message": "<string>",
"statusCode": 500,
"error": "Internal Server Error"
}{
"message": "<string>",
"statusCode": 502,
"error": "Bad Gateway"
}{
"message": "<string>",
"statusCode": 503,
"error": "Service Unavailable"
}Vertices
List vertices
Lists latest vertices on the X-Chain.
GET
/
v1
/
networks
/
{network}
/
blockchains
/
{blockchainId}
/
vertices
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.vertices.listLatest({
pageSize: 10,
blockchainId: "x-chain",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices"
headers = {"x-glacier-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices",
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-glacier-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://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-glacier-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://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/vertices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-glacier-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"vertices": [
{
"vertexHash": "<string>",
"parentHashes": [
"<string>"
],
"vertexHeight": 123,
"vertexIndex": 123,
"vertexTimestamp": 123,
"txCount": 123,
"transactions": [
"<string>"
],
"vertexSizeBytes": 123
}
],
"chainInfo": {
"chainName": "p-chain",
"network": "mainnet"
},
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}{
"message": "<string>",
"statusCode": 500,
"error": "Internal Server Error"
}{
"message": "<string>",
"statusCode": 502,
"error": "Bad Gateway"
}{
"message": "<string>",
"statusCode": 503,
"error": "Service Unavailable"
}Authorizations
Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Path Parameters
A primary network blockchain id or alias.
Available options:
2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM, 2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm, x-chain Either mainnet or testnet/fuji.
Available options:
mainnet, fuji, testnet Query Parameters
A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
Required range:
1 <= x <= 100Was this page helpful?
⌘I