Granite Upgrade Activates in11d:16h:54m:17s
Data API Usage Metrics

Get usage metrics for the Primary Network RPC

Gets metrics for public Primary Network RPC usage over a specified time interval aggregated at the specified time-duration granularity.

GET
/v1/primaryNetworkRpcUsageMetrics
x-glacier-api-key<token>

Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://build.avax.network/console/utilities/data-api-keys.

In: header

Query Parameters

timeInterval?string

Time interval granularity for data aggregation for subnet rpc metrics

Value in"hourly" | "daily" | "weekly" | "monthly"
startTimestamp?integer

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.

Range0 <= value
endTimestamp?integer

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.

Range0 <= value
groupBy?string

Query param for the criterion used for grouping metrics

Value in"rpcMethod" | "requestPath" | "responseCode" | "country" | "continent" | "userAgent"
responseCode?string

Filter data by response status code.

requestPath?string

Filter data by request path.

country?string

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.

continent?string

Filter data by Continent. Input must be a valid ISO 3166-1 alpha-2 continent code.

userAgent?string

Filter data by User Agent.

rpcMethod?string

Filter data by RPC method.

networkstring

Either mainnet or testnet/fuji.

Value in"mainnet" | "fuji" | "testnet"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://data-api.avax.network/v1/primaryNetworkRpcUsageMetrics?timeInterval=daily&startTimestamp=1739507200&endTimestamp=1739664000&groupBy=rpcMethod&network=mainnet"
{
  "aggregateDuration": "string",
  "metrics": [
    {
      "timestamp": 0,
      "values": [
        {
          "totalRequests": 0,
          "apiCreditsUsed": 0,
          "requestsPerSecond": 0,
          "successRatePercent": 0,
          "medianResponseTimeMsecs": 0,
          "invalidRequests": 0,
          "apiCreditsWasted": 0,
          "groupedBy": "rpcMethod",
          "groupValue": "string"
        }
      ]
    }
  ],
  "network": "mainnet"
}
{
  "message": "string",
  "statusCode": 400,
  "error": "Bad Request"
}
{
  "message": "string",
  "statusCode": 401,
  "error": "Unauthorized"
}
{
  "message": "string",
  "statusCode": 403,
  "error": "Forbidden"
}
{
  "message": "string",
  "statusCode": 404,
  "error": "Not Found"
}
{
  "message": "string",
  "statusCode": 429,
  "error": "Too Many Requests"
}
{
  "message": "string",
  "statusCode": 500,
  "error": "Internal Server Error"
}
{
  "message": "string",
  "statusCode": 502,
  "error": "Bad Gateway"
}
{
  "message": "string",
  "statusCode": 503,
  "error": "Service Unavailable"
}

Is this guide helpful?