Avalanche Data API Usage Metrics API

Usage metrics and logs for the Data API.

OpenAPI Specification

avalanche-data-api-usage-metrics-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Data AVAX Supply Data API Usage Metrics 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: Data API Usage Metrics
  description: Usage metrics and logs for the Data API.
paths:
  /v1/apiUsageMetrics:
    get:
      operationId: getApiUsageMetrics
      x-speakeasy-name-override: getUsage
      x-speakeasy-group: data.usageMetrics
      x-execution-weight: xxl
      summary: Get usage metrics for the Data API
      description: Gets metrics for Data API usage over a specified time interval aggregated at the specified time-duration granularity.
      parameters:
      - name: orgId
        required: false
        in: query
        description: Organization ID to fetch usage metrics for
        schema:
          type: string
      - name: startTimestamp
        required: false
        in: query
        description: The start time of the range as a UNIX timestamp. The requested start time  will be rounded down to 0:00 UTC of the day.
        example: 1739507200
        schema:
          minimum: 0
          type: integer
      - name: endTimestamp
        required: false
        in: query
        description: The end time of the range as a UNIX timestamp. The requested end time will be rounded down to 0:00 UTC of the day.
        example: 1739664000
        schema:
          minimum: 0
          type: integer
      - name: timeInterval
        required: false
        in: query
        description: Time interval granularity for data aggregation
        example: daily
        schema:
          $ref: '#/components/schemas/TimeIntervalGranularityExtended'
      - name: groupBy
        required: false
        in: query
        description: Query param for the criterion used for grouping metrics
        example: requestPath
        schema:
          $ref: '#/components/schemas/UsageMetricsGroupByEnum'
      - name: chainId
        required: false
        in: query
        description: Filter data by chain ID.
        schema:
          type: string
      - name: responseCode
        required: false
        in: query
        description: Filter data by response status code.
        schema:
          type: string
      - name: requestType
        required: false
        in: query
        description: Filter data by request type.
        schema:
          enum:
          - data
          - rpc
          type: string
      - name: apiKeyId
        required: false
        in: query
        description: Filter data by API key ID.
        schema:
          type: string
      - name: requestPath
        required: false
        in: query
        description: Filter data by request path.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageMetricsResponseDTO'
        '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:
      - Data API Usage Metrics
  /v1/apiLogs:
    get:
      operationId: getApiLogs
      x-speakeasy-name-override: getLogs
      x-speakeasy-pagination:
        type: cursor
        inputs:
        - name: pageToken
          in: parameters
          type: cursor
        outputs:
          nextCursor: $.nextPageToken
      x-speakeasy-group: data.usageMetrics
      x-execution-weight: xxl
      summary: Get logs for requests made by client
      description: Gets logs for requests made by client over a specified time interval for a specific organization.
      parameters:
      - name: orgId
        required: false
        in: query
        description: Organization ID to fetch usage metrics for
        schema:
          type: string
      - name: startTimestamp
        required: false
        in: query
        description: The start time of the range as a UNIX timestamp. The requested start time  will be rounded down to 0:00 UTC of the day.
        example: 1739507200
        schema:
          minimum: 0
          type: integer
      - name: endTimestamp
        required: false
        in: query
        description: The end time of the range as a UNIX timestamp. The requested end time will be rounded down to 0:00 UTC of the day.
        example: 1739664000
        schema:
          minimum: 0
          type: integer
      - name: chainId
        required: false
        in: query
        description: Filter data by chain ID.
        schema:
          type: string
      - name: responseCode
        required: false
        in: query
        description: Filter data by response status code.
        schema:
          type: string
      - name: requestType
        required: false
        in: query
        description: Filter data by request type.
        schema:
          enum:
          - data
          - rpc
          type: string
      - name: apiKeyId
        required: false
        in: query
        description: Filter data by API key ID.
        schema:
          type: string
      - name: requestPath
        required: false
        in: query
        description: Filter data by request path.
        schema:
          type: string
      - 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.
        schema:
          minimum: 1
          maximum: 100
          default: 10
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogsResponseDTO'
        '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:
      - Data API Usage Metrics
  /v1/subnetRpcUsageMetrics:
    get:
      operationId: getSubnetRpcUsageMetrics
      x-speakeasy-name-override: getSubnetRpcUsage
      x-speakeasy-group: data.usageMetrics
      x-execution-weight: xxl
      summary: Get usage metrics for the Subnet RPC
      description: Gets metrics for public Subnet RPC usage over a specified time interval aggregated at the specified time-duration granularity.
      parameters:
      - name: timeInterval
        required: false
        in: query
        description: "Time interval granularity for data aggregation for subnet\n     rpc metrics"
        example: daily
        schema:
          $ref: '#/components/schemas/SubnetRpcTimeIntervalGranularity'
      - name: startTimestamp
        required: false
        in: query
        description: The start time of the range as a UNIX timestamp. The requested start time  will be rounded down to 0:00 UTC of the day.
        example: 1739507200
        schema:
          minimum: 0
          type: integer
      - name: endTimestamp
        required: false
        in: query
        description: The end time of the range as a UNIX timestamp. The requested end time will be rounded down to 0:00 UTC of the day.
        example: 1739664000
        schema:
          minimum: 0
          type: integer
      - name: groupBy
        required: false
        in: query
        example: rpcMethod
        description: Query param for the criterion used for grouping metrics
        schema:
          $ref: '#/components/schemas/RpcUsageMetricsGroupByEnum'
      - name: chainId
        required: false
        in: query
        description: Filter data by chain ID.
        schema:
          type: string
      - name: responseCode
        required: false
        in: query
        description: Filter data by response status code.
        schema:
          type: string
      - name: rpcMethod
        required: false
        in: query
        description: Filter data by RPC method.
        schema:
          type: string
      - name: rlBypassApiToken
        required: false
        in: query
        description: Filter data by Rl Bypass API Token.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubnetRpcUsageMetricsResponseDTO'
        '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:
      - Data API Usage Metrics
  /v1/rpcUsageMetrics:
    get:
      operationId: getRpcUsageMetrics
      x-speakeasy-group: data.usageMetrics
      x-execution-weight: xxl
      summary: ''
      description: '**[Deprecated]**  Gets metrics for public Subnet RPC usage over a specified time interval aggregated at the specified time-duration granularity.


        ⚠️ **This operation will be removed in a future release.  Please use /v1/subnetRpcUsageMetrics endpoint instead**.'
      deprecated: true
      parameters:
      - name: timeInterval
        required: false
        in: query
        description: "Time interval granularity for data aggregation for subnet\n     rpc metrics"
        example: daily
        schema:
          $ref: '#/components/schemas/SubnetRpcTimeIntervalGranularity'
      - name: startTimestamp
        required: false
        in: query
        description: The start time of the range as a UNIX timestamp. The requested start time  will be rounded down to 0:00 UTC of the day.
        example: 1739507200
        schema:
          minimum: 0
          type: integer
      - name: endTimestamp
        required: false
        in: query
        description: The end time of the range as a UNIX timestamp. The requested end time will be rounded down to 0:00 UTC of the day.
        example: 1739664000
        schema:
          minimum: 0
          type: integer
      - name: groupBy
        required: false
        in: query
        example: rpcMethod
        description: Query param for the criterion used for grouping metrics
        schema:
          $ref: '#/components/schemas/RpcUsageMetricsGroupByEnum'
      - name: chainId
        required: false
        in: query
        description: Filter data by chain ID.
        schema:
          type: string
      - name: responseCode
        required: false
        in: query
        description: Filter data by response status code.
        schema:
          type: string
      - name: rpcMethod
        required: false
        in: query
        description: Filter data by RPC method.
        schema:
          type: string
      - name: rlBypassApiToken
        required: false
        in: query
        description: Filter data by Rl Bypass API Token.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubnetRpcUsageMetricsResponseDTO'
        '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:
      - Data API Usage Metrics
  /v1/primaryNetworkRpcUsageMetrics:
    get:
      operationId: getPrimaryNetworkRpcUsageMetrics
      x-speakeasy-name-override: getPrimaryNetworkRpcUsage
      x-speakeasy-ignore: true
      x-speakeasy-group: data.usageMetrics
      x-execution-weight: xxl
      summary: Get usage metrics for the Primary Network RPC
      description: Gets metrics for public Primary Network RPC usage over  a specified time interval aggregated at the specified  time-duration granularity.
      parameters:
      - name: timeInterval
        required: false
        in: query
        description: "Time interval granularity for data aggregation for subnet\n     rpc metrics"
        example: daily
        schema:
          $ref: '#/components/schemas/PrimaryNetworkRpcTimeIntervalGranularity'
      - name: startTimestamp
        required: false
        in: query
        description: The start time of the range as a UNIX timestamp. The requested start time  will be rounded down to 0:00 UTC of the day.
        example: 1739507200
        schema:
          minimum: 0
          type: integer
      - name: endTimestamp
        required: false
        in: query
        description: The end time of the range as a UNIX timestamp. The requested end time will be rounded down to 0:00 UTC of the day.
        example: 1739664000
        schema:
          minimum: 0
          type: integer
      - name: groupBy
        required: false
        in: query
        example: rpcMethod
        description: Query param for the criterion used for grouping metrics
        schema:
          $ref: '#/components/schemas/PrimaryNetworkRpcMetricsGroupByEnum'
      - name: responseCode
        required: false
        in: query
        description: Filter data by response status code.
        schema:
          type: string
      - name: requestPath
        required: false
        in: query
        description: Filter data by request path.
        schema:
          type: string
      - name: country
        required: false
        in: query
        description: Filter data by Country. Input must be a valid ISO 3166-1 alpha-2 country code. "XX" - Represents clients without country code data. "T1" - Represents clients using the Tor network.
        schema:
          type: string
      - name: continent
        required: false
        in: query
        description: Filter data by Continent. Input must be a valid ISO 3166-1 alpha-2 continent code.
        schema:
          type: string
      - name: userAgent
        required: false
        in: query
        description: Filter data by User Agent.
        schema:
          type: string
      - name: rpcMethod
        required: false
        in: query
        description: Filter data by RPC method.
        schema:
          type: string
      - name: network
        required: true
        in: query
        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/PrimaryNetworkRpcUsageMetricsResponseDTO'
        '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:
      - Data API Usage Metrics
components:
  schemas:
    Forbidden:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
          - 403
        error:
          type: string
          description: The type of error
          examples:
          - Forbidden
      required:
      - message
      - statusCode
      - error
    TimeIntervalGranularityExtended:
      type: string
      enum:
      - minute
      - hourly
      - daily
      - weekly
      - monthly
    BadRequest:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
          - 400
        error:
          type: string
          description: The type of error
          examples:
          - Bad Request
      required:
      - message
      - statusCode
      - error
    UsageMetricsResponseDTO:
      type: object
      properties:
        aggregateDuration:
          type: string
          description: Duration in which the metrics value is aggregated
        orgId:
          type: string
          description: Org ID for which the metrics are aggregated
        metrics:
          description: Metrics values
          type: array
          items:
            $ref: '#/components/schemas/Metric'
      required:
      - aggregateDuration
      - orgId
      - metrics
    RpcUsageMetricsGroupByEnum:
      type: string
      enum:
      - rpcMethod
      - responseCode
      - rlBypassToken
    RpcUsageMetricsValueAggregated:
      type: object
      properties:
        totalRequests:
          type: number
          description: The total number of requests
        apiCreditsUsed:
          type: number
          description: The number of API credits used
        requestsPerSecond:
          type: number
          description: The number of requests per second
        successRatePercent:
          type: number
          description: The success rate percentage
        medianResponseTimeMsecs:
          type: number
          description: The median response time in milliseconds
        invalidRequests:
          type: number
          description: The number of invalid requests
        apiCreditsWasted:
          type: number
          description: The number of API credits wasted on invalid requests
        groupedBy:
          type: string
          description: Column name used for data aggregation
          enum:
          - rpcMethod
          - responseCode
          - rlBypassToken
          - requestPath
          - country
          - continent
          - userAgent
          - None
        groupValue:
          description: The value of the column used for data aggregation
          oneOf:
          - type: string
          - type: number
      required:
      - totalRequests
      - apiCreditsUsed
      - requestsPerSecond
      - successRatePercent
      - medianResponseTimeMsecs
      - invalidRequests
      - apiCreditsWasted
      - groupedBy
    InternalServerError:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
          - 500
        error:
          type: string
          description: The type of error
          examples:
          - Internal Server Error
      required:
      - message
      - statusCode
      - error
    RpcMetrics:
      type: object
      properties:
        timestamp:
          type: number
          description: The timestamp of the metrics value
        values:
          description: The metrics values for the timestamp
          type: array
          items:
            $ref: '#/components/schemas/RpcUsageMetricsValueAggregated'


# --- truncated at 32 KB (43 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/avalanche/refs/heads/main/openapi/avalanche-data-api-usage-metrics-api-openapi.yml