---
updatedAt: 2026-07-29T09:19:42.000Z
---

# Get party profit and loss

Returns the party's profit and loss over the range: rewards earned, fees burned, traffic cost, and the net, with a daily series. net = rewards_earned_usd - fees_burned_usd - traffic_cost_usd.

# 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/parties/{party_id}/pnl": {
      "get": {
        "tags": [
          "Parties"
        ],
        "summary": "Get party profit and loss",
        "description": "Returns the party's profit and loss over the range: rewards earned, fees burned, traffic cost, and the net, with a daily series. net = rewards_earned_usd - fees_burned_usd - traffic_cost_usd.",
        "operationId": "party_pnl_v1",
        "parameters": [
          {
            "name": "party_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PartyId"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-28T13:25:25.423562719Z"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-07-28T13:25:25.423563290Z"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PartyStatsGranularity"
            },
            "example": "1d"
          }
        ],
        "responses": {
          "200": {
            "description": "Party profit and loss series.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartyPnlPoint"
                  }
                }
              }
            }
          },
          "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}$"
      },
      "PartyPnlPoint": {
        "type": "object",
        "required": [
          "record_time",
          "rewards_earned_usd",
          "fees_burned_usd",
          "traffic_cost_usd",
          "net_usd"
        ],
        "properties": {
          "fees_burned_usd": {
            "type": "string"
          },
          "net_usd": {
            "type": "string"
          },
          "record_time": {
            "type": "string",
            "format": "date-time"
          },
          "rewards_earned_usd": {
            "type": "string"
          },
          "traffic_cost_usd": {
            "type": "string"
          }
        }
      },
      "PartyStatsGranularity": {
        "type": "string",
        "enum": [
          "1h",
          "1d",
          "1w",
          "1m"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Parties",
      "description": "Party details"
    }
  ],
  "externalDocs": {
    "url": "https://swagger.io/resources/open-api/",
    "description": "OpenAPI Documentation Reference"
  }
}
```