Skip to main content
GET
/
v2
/
subnets
/
{subnetId}
/
validators:getAddresses
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";

const avalanche = new Avalanche();

async function run() {
  const result = await avalanche.metrics.subnets.getValidators({
    startTimestamp: 1689541049,
    endTimestamp: 1689800249,
    pageSize: 10,
    subnetId: "11111111111111111111111111111111LpoYY",
    network: "mainnet",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();
{
  "addresses": [
    {
      "addresses": [
        "<string>"
      ],
      "sortKey": "<string>"
    }
  ],
  "nextPageToken": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://developers.avacloud.io/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

subnetId
string
required

The subnet ID to filter by.

Query Parameters

startTimestamp
integer

Query param for retrieving items after a specific timestamp.

Required range: x >= 0
endTimestamp
integer

Query param for retrieving items before a specific timestamp.

Required range: x >= 0
pageToken
string

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

pageSize
integer
default:1000

The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 5000.

Required range: 1 <= x <= 5000
network
enum<string>

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet

Response

Successful response

addresses
object[]
required

List of addresses that match provided criteria.

nextPageToken
string

A token, which can be sent as pageToken to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.