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

# Get device analysed data

> Returns analysed/processed data for a specific device.

### Working Hours

The `workingHours` metric in the analysed data represents the total duration (in seconds) that a device was actively operating. Specifically, it is calculated by measuring the time periods where the device was powered ON and met at least one of the following conditions:

* **Active Load**: The device was drawing an active electrical load (`kW > 0`).
* **Energy Consumption**: There was a positive increase in energy consumption (`kWh` delta > 0) during that time interval.

This metric helps distinguish between the time a device is merely powered on (idle) versus when it is actively working and consuming power.


## OpenAPI

````yaml GET /devices/{deviceId}/analysed-data
openapi: 3.0.1
info:
  title: Electra API
  description: Electra public API documentation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.electra.systems/v1/public
security:
  - bearerAuth: []
paths:
  /devices/{deviceId}/analysed-data:
    get:
      description: Returns analysed/processed data for a specific device.
      parameters:
        - name: deviceId
          in: path
          required: true
          description: The device ID or alias
          schema:
            type: string
        - name: limit
          in: query
          description: The maximum number of results to return
          schema:
            type: integer
            format: int32
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            format: int32
        - name: startDate
          in: query
          description: Start date for data retrieval (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: End date for data retrieval (ISO 8601 format)
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Analysed data retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysedDataResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AnalysedDataResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
          example: Analysed data retrieved
        data:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsItem'
          description: List of analysed/processed device data records
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    AnalyticsItem:
      type: object
      properties:
        _id:
          type: string
        deviceId:
          type: string
        type:
          type: string
          enum:
            - daily
            - monthly
            - yearly
        date:
          type: string
        month:
          type: integer
        year:
          type: integer
        points:
          type: integer
        co2:
          type: number
          description: Carbon emissions in kgCO2e
          example: 142.5
        data:
          type: object
          description: Aggregated metrics (consumption, uptime, etc.)
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````