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

# Get party's allocated traffic

Returns the party's allocated traffic over the range: each party's share of validator traffic computed by activity, so consumers do not reimplement the allocation.

# 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/parties/{id}": {
      "get": {
        "tags": [
          "Traffic"
        ],
        "summary": "Get party's allocated traffic",
        "description": "Returns the party's allocated traffic over the range: each party's share of validator traffic computed by activity, so consumers do not reimplement the allocation.",
        "operationId": "party_traffic_allocation_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.424143193Z"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-28T13:25:25.424143904Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartyTrafficAllocation"
                }
              }
            }
          },
          "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": {
      "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}$"
      },
      "PartyTrafficAllocation": {
        "type": "object",
        "required": [
          "series",
          "total_traffic",
          "total_paid"
        ],
        "properties": {
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartyTrafficAllocationRange"
            },
            "description": "Series of allocated traffic per bucket."
          },
          "total_paid": {
            "type": "string",
            "format": "decimal",
            "description": "Total amulet paid allocated to the party across the requested range.",
            "example": 4574.1764705876,
            "minimum": 0
          },
          "total_traffic": {
            "type": "integer",
            "format": "integer",
            "description": "Total traffic (bytes) allocated to the party across the requested range.",
            "example": 12960000,
            "minimum": 0
          }
        }
      },
      "PartyTrafficAllocationRange": {
        "type": "object",
        "required": [
          "record_time",
          "allocated_traffic",
          "allocated_paid",
          "activity_share"
        ],
        "properties": {
          "activity_share": {
            "type": "string",
            "format": "decimal",
            "description": "The party's share of hosted activity in this bucket, in range [0, 1].",
            "example": 0.15,
            "maximum": 1,
            "minimum": 0
          },
          "allocated_paid": {
            "type": "string",
            "format": "decimal",
            "description": "Amulet paid allocated to the party in this bucket.",
            "example": 207.9411764703,
            "minimum": 0
          },
          "allocated_traffic": {
            "type": "integer",
            "format": "integer",
            "description": "Traffic (bytes) allocated to the party in this bucket: the hosting validator's total\ntraffic in this bucket, multiplied by the party's share of hosted activity.",
            "example": 588000,
            "minimum": 0
          },
          "record_time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RewardsRangeGranularity": {
        "type": "string",
        "enum": [
          "1h",
          "1d",
          "1w",
          "1m"
        ]
      }
    },
    "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"
  }
}
```