---
title: "Get usage metrics for the Data API"
method: GET
path: "/v1/apiUsageMetrics"
tags: ["Data API Usage Metrics"]
---

# Get usage metrics for the Data API

`GET /v1/apiUsageMetrics`

Gets metrics for Data API usage over a specified time interval aggregated at the specified time-duration granularity.

## Query parameters

- `orgId` string
- `startTimestamp` integer
- `endTimestamp` integer
- `timeInterval` 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'
- `groupBy` 'requestPath' | 'responseCode' | 'chainId' | 'apiKeyId' | 'requestType'
- `chainId` string
- `responseCode` string
- `requestType` 'data' | 'rpc'
- `apiKeyId` string
- `requestPath` string

## Response `200`

Successful response

- UsageMetricsResponseDTO
  - `aggregateDuration` string, required — Duration in which the metrics value is aggregated
  - `orgId` string, required — Org ID for which the metrics are aggregated
  - `metrics` Metric[], required — Metrics values
    - `timestamp` number, required — The timestamp of the metrics value
    - `values` UsageMetricsValueDTO[], required — The metrics values for the timestamp
      - `groupedBy` 'requestPath' | 'responseCode' | 'chainId' | 'apiKeyId' | 'requestType' | 'None', required — Column name used for data aggregation
      - `groupValue` union — The value of the column used for data aggregation
        - string
        - number
      - `totalRequests` number, required — The total number of requests
      - `requestsPerSecond` number, required — The number of requests per second
      - `successRatePercent` number, required — The success rate percentage
      - `medianResponseTimeMsecs` number, required — The median response time in milliseconds
      - `invalidRequests` number, required — The number of invalid requests
      - `apiCreditsUsed` number, required — The number of API credits used
      - `apiCreditsWasted` number, required — The number of API credits wasted on invalid requests

## Other responses

- `400` — Bad requests generally mean the client has passed invalid or malformed parameters. Error messages in the response could help in evaluating the error.
- `401` — When a client attempts to access resources that require authorization credentials but the client lacks proper authentication in the request, the server responds with 401.
- `403` — When a client attempts to access resources with valid credentials but doesn't have the privilege to perform that action, the server responds with 403.
- `404` — The error is mostly returned when the client requests with either mistyped URL, or the passed resource is moved or deleted, or the resource doesn't exist.
- `429` — This error is returned when the client has sent too many, and has hit the rate limit.
- `500` — The error is a generic server side error that is returned for any uncaught and unexpected issues on the server side. This should be very rare, and you may reach out to us if the problem persists for a longer duration.
- `502` — This is an internal error indicating invalid response received by the client-facing proxy or gateway from the upstream server.
- `503` — The error is returned for certain routes on a particular Subnet. This indicates an internal problem with our Subnet node, and may not necessarily mean the Subnet is down or affected.

---

[API](https://skmtc.net/avax/apis/data-api.md) · [All operations](https://skmtc.net/avax/apis/data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/avax/data-api/revisions/745a94fa47f5/schema)
