<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "EnergyKit",
  "identifier" : "/documentation/EnergyKit/ElectricityInsightQuery",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "EnergyKit"
    ],
    "preciseIdentifier" : "s:9EnergyKit23ElectricityInsightQueryV"
  },
  "title" : "ElectricityInsightQuery"
}
-->

# ElectricityInsightQuery

A structure describing a query that you use to obtain environmental impact
information in the form of electricity insight records.

```
struct ElectricityInsightQuery
```

## Topics

### Creating an insight query request

[`init(options: ElectricityInsightQuery.Options, range: DateInterval, granularity: ElectricityInsightQuery.Granularity, flowDirection: ElectricityFlowDirection)`](/documentation/EnergyKit/ElectricityInsightQuery/init(options:range:granularity:flowDirection:))

Creates an electricity insight query request.

### Adding optional insight records

[`struct Options`](/documentation/EnergyKit/ElectricityInsightQuery/Options-swift.struct)

A set of options that specify optional information to include in electricity insight records
returned from the insight service.

[`let options: ElectricityInsightQuery.Options`](/documentation/EnergyKit/ElectricityInsightQuery/options-swift.property)

The optional information to
include in returned electricity insight records.

### Getting the query request information

[`enum Granularity`](/documentation/EnergyKit/ElectricityInsightQuery/Granularity-swift.enum)

The specific temporal granularity of electricity insight records.

[`let granularity: ElectricityInsightQuery.Granularity`](/documentation/EnergyKit/ElectricityInsightQuery/granularity-swift.property)

The temporal granularity
for returned electricity insight records.

[`let flowDirection: ElectricityFlowDirection`](/documentation/EnergyKit/ElectricityInsightQuery/flowDirection)

A property that specifies whether the response contains imported or exported energy.

[`let range: DateInterval`](/documentation/EnergyKit/ElectricityInsightQuery/range)

The requested date range.

### Decoding

## Relationships

### Conforms To

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Decodable`](/documentation/Swift/Decodable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)