> ## Documentation Index
> Fetch the complete documentation index at: https://podpora.cubee.cz/llms.txt
> Use this file to discover all available pages before exploring further.

# Aggregated electricity prices

> Retrieves aggregated electricity prices between two dates with specified granularity.



## OpenAPI

````yaml /api-reference/swagger-partner.json get /api/v1/aggregated-data/aggregated-prices
openapi: 3.0.4
info:
  title: Partner API
  description: API for partner services
  version: v1
servers:
  - url: https://api.partner.cubee.cz
    description: Partnerý API server
security: []
paths:
  /api/v1/aggregated-data/aggregated-prices:
    get:
      tags:
        - Aggregated Data
      summary: Aggregated electricity prices
      description: >-
        Retrieves aggregated electricity prices between two dates with specified
        granularity.
      operationId: Aggregated Prices
      parameters:
        - name: from
          in: query
          description: >-
            The start of the requested period for aggregated prices, including
            date and time in UTC.
          required: true
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: >-
            The end of the requested period for aggregated prices, including
            date and time in UTC.
          required: true
          schema:
            type: string
            format: date-time
        - name: cubeeSNs
          in: query
          description: List of serial numbers of Cubee devices to filter the results.
          schema:
            type: array
            items:
              type: string
        - name: granularity
          in: query
          description: 'Aggregation level. Allowed values: daily, monthly, all.'
          required: true
          schema:
            pattern: ^(daily|monthly|all)$
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregatedPriceResultModel'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: string
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    AggregatedPriceResultModel:
      type: object
      properties:
        from:
          type: string
          description: >-
            The start of the requested period for aggregated prices, including
            date and time in UTC.
          format: date-time
        to:
          type: string
          description: >-
            The end of the requested period for aggregated prices, including
            date and time in UTC.
          format: date-time
        periods:
          type: array
          items:
            $ref: '#/components/schemas/AggregatedPricePeriodModel'
          description: >-
            List of aggregated price periods within the specified date range,
            based on the chosen granularity (e.g., daily, monthly).
          nullable: true
        currency:
          type: string
          description: >-
            The currency in which the prices are expressed, following the ISO
            4217 currency codes. Default is "CZK".
          nullable: true
      additionalProperties: false
    AggregatedPricePeriodModel:
      type: object
      properties:
        date:
          type: string
          description: The date representing this aggregated price period.
          format: date
        totalBuyEnergyMWh:
          type: number
          description: >-
            Total amount of energy (in MWh) bought from the grid by all
            households during this period.
          format: double
          nullable: true
        totalBuyFullPrice:
          type: number
          description: >-
            Total amount paid by all households combined for the energy bought,
            including all fees and taxes.

            Currency is specified in the parent model.
          format: double
          nullable: true
        totalBuyPowerPrice:
          type: number
          description: >-
            Total amount paid by all households combined for the energy bought,
            covering only the commodity energy price ("silová elektřina" in
            Czech)

            and excluding regulated parts and taxes. Currency is specified in
            the parent model.
          format: double
          nullable: true
        totalSellEnergyMWh:
          type: number
          description: >-
            Total amount of energy (in MWh) sold to the grid by all households
            during this period.
          format: double
          nullable: true
        totalSellFullPrice:
          type: number
          description: >-
            Total amount received by all households combined for the energy
            sold, including all fees and taxes.

            Currency is specified in the parent model.
          format: double
          nullable: true
        totalSellPowerPrice:
          type: number
          description: >-
            Total amount received by all households combined for the energy
            sold, covering only the commodity energy price ("silová elektřina"
            in Czech)

            and excluding regulated parts and taxes. Currency is specified in
            the parent model.
          format: double
          nullable: true
      additionalProperties: false
      description: >-
        Represents aggregated energy data for a given date, including the total
        amounts of energy bought and sold by all households,

        the corresponding monetary values (both full and unregulated parts,
        known as "silová elektřina" in Czech).
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      scheme: bearer
      bearerFormat: JWT

````