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

# Get Power History

Returns historical power metrics for a branch (location group) or connector. Data is sampled to a maximum of 400 points. Use the `from` and `to` parameters to zoom in on a specific time range for more granular data.

When the `from` and `to` parameters are omitted, the default range is the last 7 days.

<ParamField path="site" type="string" required>
  The UUID of the location.
</ParamField>

<ParamField query="type" type="string" required>
  The history type. Must be `branch` or `connector`.
</ParamField>

<ParamField query="entity_id" type="integer" required>
  The entity ID. Use the `site_group_id` when type is `branch`, or the `charger_id` when type is `connector`.
</ParamField>

<ParamField query="connector_id" type="integer">
  The connector ID. Required when `type` is `connector`.
</ParamField>

<ParamField query="from" type="string">
  Start date/time filter in ISO 8601 format (e.g., `2024-01-01T00:00:00Z`).
</ParamField>

<ParamField query="to" type="string">
  End date/time filter in ISO 8601 format. Must be after or equal to `from`.
</ParamField>

## Response

<ResponseField name="data" type="object[]">
  An array of data points, ordered by timestamp. Each point groups its measurands by phase.

  <Expandable title="data point">
    <ResponseField name="timestamp" type="string">
      The ISO 8601 timestamp of the data point.
    </ResponseField>

    <ResponseField name="L1" type="object">
      A map of measurand name to value (number) for phase L1. For branch history the measurands are `Current.Meter`, `Current.Available`, `Current.Requested`, and `Current.Allocated`; for connector history they are `Current.Requested`, `Current.Allocated`, and `Current.Import`. Only measurands present for that timestamp are included.
    </ResponseField>

    <ResponseField name="L2" type="object">
      The same structure as `L1`, for phase L2.
    </ResponseField>

    <ResponseField name="L3" type="object">
      The same structure as `L1`, for phase L3.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Metadata describing the returned range and series.

  <Expandable title="meta">
    <ResponseField name="from" type="string">
      The ISO 8601 start of the returned range.
    </ResponseField>

    <ResponseField name="to" type="string">
      The ISO 8601 end of the returned range.
    </ResponseField>

    <ResponseField name="type" type="string">
      The history type, either `branch` or `connector`.
    </ResponseField>

    <ResponseField name="entity_id" type="integer">
      The entity ID the data was queried for.
    </ResponseField>

    <ResponseField name="connector_id" type="integer">
      The connector ID, or `null` for branch history.
    </ResponseField>

    <ResponseField name="measurands" type="string[]">
      The measurands included for this history type.
    </ResponseField>

    <ResponseField name="phases" type="string[]">
      The phases included, always `L1`, `L2`, and `L3`.
    </ResponseField>

    <ResponseField name="total_points" type="integer">
      The total number of distinct timestamps in the requested range before sampling.
    </ResponseField>
  </Expandable>
</ResponseField>
