Query L1 Details

Learn how to query L1 details on the P-Chain.

Logo

Subnet Details

Query the data of the Subnet from the P-Chain using the Avalanche API

To query the L1 details, you can use the Data API from AvaCloud.

Using the Data API

The Data API provides several ways to access subnet information:

  1. REST API Endpoint:

    GET https://glacier-api.avax.network/v1/networks/{network}/subnets/{subnetId}
  2. Sample Request:

    curl -X GET "https://glacier-api.avax.network/v1/networks/{network}/subnets/{subnetId}" \
      -H "accept: application/json"
  3. Query Parameters:

    • network: Network name (e.g., mainnet or fuji)
    • subnetID: The ID of your subnet

The API will return comprehensive details about your L1 subnet in the following format:

{
  "createBlockTimestamp": 123,
  "createBlockIndex": "<string>",
  "subnetId": "<string>",
  "ownerAddresses": [
    "<string>"
  ],
  "threshold": 123,
  "locktime": 123,
  "subnetOwnershipInfo": {
    "locktime": 0,
    "threshold": 1,
    "addresses": [
      "avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
    ]
  },
  "isL1": true,
  "l1ConversionTransactionHash": "<string>",
  "l1ValidatorManagerDetails": {
    "blockchainId": "<string>",
    "contractAddress": "<string>"
  },
  "blockchains": [
    {
      "blockchainId": "<string>"
    }
  ]
}

Is this guide helpful?

On this page