Avalanche Primary Network API

The Primary Network API from Avalanche — 11 operation(s) for primary network.

OpenAPI Specification

avalanche-primary-network-api-openapi.yml Raw ↑
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://data-api.avax.network
security:
- apiKey: []
- {}
tags:
- name: Primary Network
  description: ''
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
  /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
  /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
  /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
  /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
  /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
  /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
  /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
        required: true
        in: path
        description: Either mainnet or testnet/fuji.
        example: mainnet
        schema:
          $ref: '#/components/schemas/Network'
      - name: nodeIds
        required: false
        in: query
        description: A comma separated list of node ids to filter by. Supports substring matching.
        example: NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs
        schema:
          type: string
      - name: sortBy
        required: false
        in: query
        description: 'Which property to sort by, in conjunction with sortOrder.


          Note: Delegation fee is only available for mainnet validators. Set `subnetId` to `11111111111111111111111111111111LpoYY`  to use this option.'
        schema:
          $ref: '#/components/schemas/SortByOption'
      - 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'
      - name: validationStatus
        required: false
        in: query
        description: Validation status of the node.
        example: completed
        schema:
          $ref: '#/components/schemas/ValidationStatusType'
      - name: minDelegationCapacity
        required: false
        in: query
        description: The minimum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000
        example: '0'
        schema:
          type: string
      - name: maxDelegationCapacity
        required: false
        in: query
        description: The maximum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000.
        example: '720000000000000000'
        schema:
          type: string
      - name: minTimeRemaining
        required: false
        in: query
        description: The minimum validation time remaining, in seconds, used to filter the set of nodes being returned.
        example: 0
        schema:
          type: number
          maximum: 2147483647
          minimum: 0
      - name: maxTimeRemaining
        required: false
        in: query
        description: The maximum validation time remaining, in seconds, used to filter the set of nodes being returned.
        example: 2147483647
        schema:
          type: number
          maximum: 2147483647
          minimum: 0
      - name: minFeePercentage
        required: false
        in: query
        description: The minimum fee percentage, used to filter the set of nodes being returned. If this field is populated no subnet validations will be returned, as their fee percentage is null, since subnet delegations are not supported. Default is 2.0, as

# --- truncated at 32 KB (89 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/avalanche/refs/heads/main/openapi/avalanche-primary-network-api-openapi.yml