---
updatedAt: 2026-07-29T09:33:28.000Z
---

# Get validator traffic statistics with configurable granularity

Returns traffic statistics for the validator over the requested range and granularity.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CantonView Public API",
    "description": "Public API for accessing Canton Network explorer data through CCView",
    "contact": {
      "name": "API Maintainer",
      "email": "cantonview@pixelplex.io"
    },
    "license": {
      "name": ""
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://ccview.io",
      "description": "Production HTTPS server"
    }
  ],
  "paths": {
    "/api/traffic/validators/{id}": {
      "get": {
        "tags": [
          "Traffic"
        ],
        "summary": "Get validator traffic statistics with configurable granularity",
        "description": "Returns traffic statistics for the validator over the requested range and granularity.",
        "operationId": "traffic_ranged_by_validator_v1",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PartyId"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RewardsRangeGranularity"
                }
              ],
              "default": "1h"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-28T13:25:25.424110418Z"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-28T13:25:25.424111459Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberTrafficStatisticAggregate"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "message",
                    "timestamp"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Detailed message description.",
                      "example": "message error"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32",
                      "description": "HTTP status code.",
                      "maximum": 599,
                      "minimum": 400
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of error occurrence."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "message",
                    "timestamp"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Detailed message description.",
                      "example": "message error"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32",
                      "description": "HTTP status code.",
                      "maximum": 599,
                      "minimum": 400
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of error occurrence."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "message",
                    "timestamp"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Detailed message description.",
                      "example": "message error"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32",
                      "description": "HTTP status code.",
                      "maximum": 599,
                      "minimum": 400
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of error occurrence."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "message",
                    "timestamp"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Detailed message description.",
                      "example": "message error"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32",
                      "description": "HTTP status code.",
                      "maximum": 599,
                      "minimum": 400
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of error occurrence."
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "message",
                    "timestamp"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Detailed message description.",
                      "example": "message error"
                    },
                    "status": {
                      "type": "integer",
                      "format": "int32",
                      "description": "HTTP status code.",
                      "maximum": 599,
                      "minimum": 400
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of error occurrence."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MemberTrafficStatisticAggregate": {
        "type": "object",
        "required": [
          "series",
          "traffic_status",
          "total_traffic",
          "total_paid",
          "avg_traffic_usage"
        ],
        "properties": {
          "avg_traffic_usage": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrafficRange"
            }
          },
          "total_paid": {
            "type": "string"
          },
          "total_traffic": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "traffic_status": {
            "$ref": "#/components/schemas/TrafficStatus"
          }
        }
      },
      "PartyId": {
        "type": "string",
        "title": "PartyId",
        "format": "hint::hash",
        "description": "Party ID in format `hint::hash`\n \n- `hint` - human-readable prefix (optional, for debugging)\n \n- `hash` - cryptographic identifier (the real identity)",
        "example": "dev_test::122035334a67f4de9d2aecdd5b83485cbaee20682e3f0491bdf12b0a32d81cc93c90",
        "examples": [
          "dev_test::122035334a67f4de9d2aecdd5b83485cbaee20682e3f0491bdf12b0a32d81cc93c90"
        ],
        "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*::1220[a-f0-9]{64}$"
      },
      "RewardsRangeGranularity": {
        "type": "string",
        "enum": [
          "1h",
          "1d",
          "1w",
          "1m"
        ]
      },
      "TrafficRange": {
        "type": "object",
        "required": [
          "record_time",
          "total_traffic",
          "total_paid"
        ],
        "properties": {
          "record_time": {
            "type": "string",
            "format": "date-time"
          },
          "total_paid": {
            "type": "string"
          },
          "total_traffic": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "TrafficStatus": {
        "type": "object",
        "required": [
          "total_consumed",
          "total_limit",
          "total_purchased",
          "usage_percent"
        ],
        "properties": {
          "last_updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "total_consumed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "total_limit": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "total_purchased": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "usage_percent": {
            "type": "number",
            "format": "float"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Traffic",
      "description": "Network traffic statistics"
    }
  ],
  "externalDocs": {
    "url": "https://swagger.io/resources/open-api/",
    "description": "OpenAPI Documentation Reference"
  }
}
```