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

# Get Battery History

> Query battery telemetry history for a device.

Returns battery telemetry records for a device. The `id` path parameter accepts either `short_id` or `hardware_id`.

## Path parameters

<ParamField path="id" type="string" required>
  Device identifier — either `short_id` or `hardware_id`.
</ParamField>

## Query parameters

<ParamField query="limit" type="number" default="100">
  Max records to return. Ignored when `from`/`to` are provided.
</ParamField>

<ParamField query="from" type="string">
  ISO 8601 date string (start of range). Required together with `to`.
</ParamField>

<ParamField query="to" type="string">
  ISO 8601 date string (end of range). Required together with `from`.
</ParamField>

## Response

Returns an array of battery telemetry records.

<ResponseField name="[]" type="object[]">
  <Expandable title="Battery record">
    <ResponseField name="_id" type="string" required>Record identifier.</ResponseField>
    <ResponseField name="hardware_id" type="string" required>Hardware identifier.</ResponseField>
    <ResponseField name="timestamp" type="string" required>ISO 8601 timestamp.</ResponseField>
    <ResponseField name="battery_voltage" type="number" required>Battery voltage reading.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Latest 50 records theme={null}
  curl -H "X-API-Key: YOUR_API_KEY" \
    "https://your-api-host/devices/ABC123/battery?limit=50"
  ```

  ```bash Date range query theme={null}
  curl -H "X-API-Key: YOUR_API_KEY" \
    "https://your-api-host/devices/ABC123/battery?from=2025-12-01T00:00:00Z&to=2025-12-17T00:00:00Z"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "_id": "...",
      "hardware_id": "ABC123",
      "timestamp": "2025-12-17T10:30:00.000Z",
      "battery_voltage": 12.4
    }
  ]
  ```
</ResponseExample>
