Ava Labs Primary Network API
The Primary Network API from Ava Labs — 11 operation(s) for primary network.
The Primary Network API from Ava Labs — 11 operation(s) for primary network.
openapi: 3.1.0
info:
title: Data AVAX Supply Primary Network API
description: The Data API provides web3 application developers with multi-chain data related to Avalanche's primary network, Avalanche subnets, and Ethereum. With Data API, you can easily build products that leverage real-time and historical transaction and transfer history, native and token balances, and various types of token metadata. The API is in Beta and may be subject to change.</br></br>If you have feedback or feature requests for the API, please submit them <a href="https://portal.productboard.com/dndv9ahlkdfye4opdm8ksafi/tabs/4-glacier-api">here</a>. Bug reports can be submitted <a href="https://docs.google.com/forms/d/e/1FAIpQLSeJQrcp7QoNiqozMDKrVJGX5wpU827d3cVTgF8qa7t_J1Pb-g/viewform">here</a>, and any potential security issues can be reported <a href="https://immunefi.com/bounty/avalabs">here</a>.
version: 1.0.0
contact: {}
servers:
- url: https://glacier-api.avax.network
security:
- apiKey: []
- {}
tags:
- name: Primary Network
paths:
/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}:
get:
operationId: getAssetDetails
x-speakeasy-group: data.primaryNetwork
x-execution-weight: xl
summary: Get asset details
description: Gets asset details corresponding to the given asset id on the X-Chain.
parameters:
- name: blockchainId
required: true
in: path
description: A primary network blockchain id or alias.
example: x-chain
schema:
$ref: '#/components/schemas/XChainId'
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
- name: assetId
required: true
in: path
description: Asset ID for any asset on X-Chain
example: th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/XChainAssetDetails'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.getAssetDetails({\n blockchainId: \"x-chain\",\n assetId: \"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof\",\n });\n\n console.log(result);\n}\n\nrun();"
/v1/networks/{network}/addresses:listChainIds:
get:
operationId: getChainIdsForAddresses
x-speakeasy-group: data.primaryNetwork
x-execution-weight: xl
summary: Get chain interactions for addresses
description: Returns Primary Network chains that each address has touched in the form of an address mapped array. If an address has had any on-chain interaction for a chain, that chain's chain id will be returned.
parameters:
- name: addresses
required: true
in: query
description: A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji".
example: avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg
schema:
type: string
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ChainAddressChainIdMapListResponse'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.getChainIdsForAddresses({\n addresses: \"avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg\",\n });\n\n console.log(result);\n}\n\nrun();"
/v1/networks/{network}:
get:
operationId: getNetworkDetails
x-execution-weight: xl
x-speakeasy-group: data.primaryNetwork
summary: Get network details
description: Gets network details such as validator and delegator stats.
parameters:
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetNetworkDetailsResponse'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.getNetworkDetails({});\n\n console.log(result);\n}\n\nrun();"
/v1/networks/{network}/blockchains:
get:
operationId: listBlockchains
x-speakeasy-pagination:
type: cursor
inputs:
- name: pageToken
in: parameters
type: cursor
outputs:
nextCursor: $.nextPageToken
x-speakeasy-group: data.primaryNetwork
x-execution-weight: medium
summary: List blockchains
description: Lists all blockchains registered on the network.
parameters:
- name: pageToken
required: false
in: query
description: A page token, received from a previous list call. Provide this to retrieve the subsequent page.
schema:
type: string
- name: pageSize
required: false
in: query
description: The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 10000.
schema:
type: integer
default: 100
minimum: 1
maximum: 10000
example: '10'
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
- name: sortOrder
required: false
in: query
example: asc
description: The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
schema:
$ref: '#/components/schemas/SortOrder'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ListBlockchainsResponse'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.listBlockchains({\n pageSize: 10,\n sortOrder: \"asc\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();"
/v1/networks/{network}/blockchains/{blockchainId}:
get:
operationId: getBlockchainById
x-speakeasy-group: data.primaryNetwork
x-execution-weight: medium
summary: Get blockchain details by ID
description: Get details of the blockchain registered on the network.
parameters:
- name: blockchainId
required: true
in: path
description: The blockchain ID of the blockchain to retrieve.
example: 2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5
schema:
type: string
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Blockchain'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.getBlockchainById({\n blockchainId: \"2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5\",\n });\n\n console.log(result);\n}\n\nrun();"
/v1/networks/{network}/subnets:
get:
operationId: listSubnets
x-speakeasy-pagination:
type: cursor
inputs:
- name: pageToken
in: parameters
type: cursor
outputs:
nextCursor: $.nextPageToken
x-speakeasy-group: data.primaryNetwork
x-execution-weight: medium
summary: List subnets
description: Lists all subnets registered on the network.
parameters:
- name: pageToken
required: false
in: query
description: A page token, received from a previous list call. Provide this to retrieve the subsequent page.
schema:
type: string
- name: pageSize
required: false
in: query
description: The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 10000.
schema:
type: integer
default: 100
minimum: 1
maximum: 10000
example: '10'
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
- name: sortOrder
required: false
in: query
example: asc
description: The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
schema:
$ref: '#/components/schemas/SortOrder'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ListSubnetsResponse'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.listSubnets({\n pageSize: 10,\n sortOrder: \"asc\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();"
/v1/networks/{network}/subnets/{subnetId}:
get:
operationId: getSubnetById
x-speakeasy-group: data.primaryNetwork
x-execution-weight: medium
summary: Get Subnet details by ID
description: Get details of the Subnet registered on the network.
parameters:
- name: network
required: true
in: path
description: Either mainnet or testnet/fuji.
example: mainnet
schema:
$ref: '#/components/schemas/Network'
- name: subnetId
required: true
in: path
description: Subnet ID to fetch details for
example: 11111111111111111111111111111111LpoYY
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Subnet'
'400':
description: "Bad requests generally mean the client has passed invalid \n or malformed parameters. Error messages in the response could help in \n evaluating the error."
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'
'401':
description: "When a client attempts to access resources that require \n authorization credentials but the client lacks proper authentication \n in the request, the server responds with 401."
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'403':
description: "When a client attempts to access resources with valid\n credentials but doesn't have the privilege to perform that action, \n the server responds with 403."
content:
application/json:
schema:
$ref: '#/components/schemas/Forbidden'
'404':
description: "The error is mostly returned when the client requests\n with either mistyped URL, or the passed resource is moved or deleted, \n or the resource doesn't exist."
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
'429':
description: "This error is returned when the client has sent too many,\n and has hit the rate limit."
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequests'
'500':
description: "The error is a generic server side error that is \n returned for any uncaught and unexpected issues on the server side. \n This should be very rare, and you may reach out to us if the problem \n persists for a longer duration."
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'502':
description: "This is an internal error indicating invalid response \n received by the client-facing proxy or gateway from the upstream server."
content:
application/json:
schema:
$ref: '#/components/schemas/BadGateway'
'503':
description: "The error is returned for certain routes on a particular\n Subnet. This indicates an internal problem with our Subnet node, and may \n not necessarily mean the Subnet is down or affected."
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
tags:
- Primary Network
x-codeSamples:
- lang: javascript
label: JavaScript
source: "import { Avalanche } from \"@avalanche-sdk/chainkit\";\n\nconst avalanche = new Avalanche({\n network: \"mainnet\",\n});\n\nasync function run() {\n const result = await avalanche.data.primaryNetwork.getSubnetById({\n subnetId: \"11111111111111111111111111111111LpoYY\",\n });\n\n console.log(result);\n}\n\nrun();"
/v1/networks/{network}/validators:
get:
operationId: listValidators
x-speakeasy-pagination:
type: cursor
inputs:
- name: pageToken
in: parameters
type: cursor
outputs:
nextCursor: $.nextPageToken
x-speakeasy-group: data.primaryNetwork
x-execution-weight: medium
summary: List validators
description: Lists details for validators. By default, returns details for all validators. The nodeIds parameter supports substring matching. Filterable by validation status, delegation capacity, time remaining, fee percentage, uptime performance, and subnet id.
parameters:
- name: pageToken
required: false
in: query
description: A page token, received from a previous list call. Provide this to retrieve the subsequent page.
schema:
type: string
- name: pageSize
required: false
in: query
description: The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
schema:
type: integer
default: 10
minimum: 1
maximum: 100
example: '10'
- name: network
require
# --- truncated at 32 KB (87 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/ava-labs/refs/heads/main/openapi/ava-labs-primary-network-api-openapi.yml