> ## 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 historic data

> Returns historic data for a specific device.



## OpenAPI

````yaml GET /devices/{deviceId}/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}/data:
    get:
      description: Returns historic 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 (max 200)
          schema:
            type: integer
            format: int32
            maximum: 200
        - 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: Data data retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedHistory'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PaginatedHistory:
      type: object
      properties:
        message:
          type: string
        data:
          type: object
          properties:
            docs:
              type: array
              items:
                $ref: '#/components/schemas/History'
            totalDocs:
              type: integer
              description: Total no of documents available
            limit:
              type: integer
              description: Number of docs to be returned
            totalPages:
              type: integer
              description: Total available pages
            page:
              type: integer
              description: Current page
            pagingCounter:
              type: number
              description: Returns the paging counter
            hasPrevPage:
              type: boolean
              description: Returns true if there is a next page
            hasNextPage:
              type: boolean
              description: Returns true if there is a previous page
            prevPage:
              type: number
              description: Returns the previous page number
            nextPage:
              type: number
              description: Returns the previous page number
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    History:
      type: object
      properties:
        deviceId:
          description: Unique device Id
          type: string
        data:
          type: object
          properties:
            clientId:
              type: string
              description: The client ID associated with the data
            id:
              type: integer
              description: Unique identifier for the data
            deviceID:
              type: string
              description: Unique identifier of the device
            sn:
              type: string
              description: Serial number of the device
            tp:
              type: string
              format: date-time
              description: Timestamp when the data was recorded (ISO 8601 format)
            status:
              type: integer
              description: Status of the device; 0 for inactive, 1 for active
            v1:
              type: number
              format: float
              description: Voltage for phase 1
            v2:
              type: number
              format: float
              description: Voltage for phase 2
            v3:
              type: number
              format: float
              description: Voltage for phase 3
            i1:
              type: number
              format: float
              description: Current for phase 1
            i2:
              type: number
              format: float
              description: Current for phase 2
            i3:
              type: number
              format: float
              description: Current for phase 3
            signalstrength:
              type: integer
              description: Signal strength of the device (measured in dBm)
            kwh:
              type: number
              format: float
              description: Energy consumption in kilowatt-hours (kWh)
            pf:
              type: number
              format: float
              description: Power factor of the device
            freq:
              type: number
              format: float
              description: Frequency in hertz (Hz)
            bt:
              type: number
              format: float
              description: Battery level of the device (percentage or voltage)
          required:
            - clientId
            - id
            - deviceID
            - sn
            - tp
            - status
            - signalstrength
          description: Schema representing data sent by a device
        createdAt:
          description: Timestamp showing when the device was added to the system
          type: string
          format: date-time
        updatedAt:
          description: Timestamp showing when the device details was last modified
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````