- [HTTP request](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.request_body)
- [Response body](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.response_body)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.BuildingInsights.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.aspect)
- [AdditionalInsights](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#AdditionalInsights)
- [LatLngBox](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox.SCHEMA_REPRESENTATION)
- [SolarPotential](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.SCHEMA_REPRESENTATION)
- [SizeAndSunshineStats](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats.SCHEMA_REPRESENTATION)
- [RoofSegmentSizeAndSunshineStats](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSizeAndSunshineStats)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSizeAndSunshineStats.SCHEMA_REPRESENTATION)
- [SolarPanel](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanel)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanel.SCHEMA_REPRESENTATION)
- [SolarPanelOrientation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelOrientation)
- [SolarPanelConfig](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig.SCHEMA_REPRESENTATION)
- [RoofSegmentSummary](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSummary)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSummary.SCHEMA_REPRESENTATION)
- [FinancialAnalysis](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialAnalysis)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialAnalysis.SCHEMA_REPRESENTATION)
- [Money](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money.SCHEMA_REPRESENTATION)
- [FinancialDetails](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialDetails)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialDetails.SCHEMA_REPRESENTATION)
- [LeasingSavings](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LeasingSavings)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LeasingSavings.SCHEMA_REPRESENTATION)
- [SavingsOverTime](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime.SCHEMA_REPRESENTATION)
- [CashPurchaseSavings](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings.SCHEMA_REPRESENTATION)
- [FinancedPurchaseSavings](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancedPurchaseSavings)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancedPurchaseSavings.SCHEMA_REPRESENTATION)
- [DetectedArrays](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectedArrays)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectedArrays.SCHEMA_REPRESENTATION)
- [DetectionStatus](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectionStatus)
- [SolarArray](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarArray)
  - [JSON representation](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarArray.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#try-it)

Locates the building whose centroid is closest to a query point. Returns an error with code `NOT_FOUND` if there are no buildings within approximately 50m of the query point.

### HTTP request

`GET https://solar.googleapis.com/v1/buildingInsights:findClosest`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `location` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` Required. The longitude and latitude from which the API looks for the nearest known building. |
| `requiredQuality` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#ImageryQuality`)`` Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only. |
| `exactQualityRequired` | `boolean` Optional. Whether to require exact quality of the imagery. If set to false, the `requiredQuality` field is interpreted as the minimum required quality, such that HIGH quality imagery may be returned when `requiredQuality` is set to MEDIUM. If set to true, `requiredQuality` is interpreted as the exact required quality and only `MEDIUM` quality imagery is returned if `requiredQuality` is set to `MEDIUM`. |
| `experiments[]` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/Experiment`)`` Optional. Specifies the pre-GA experiments to enable. Requests using this field are classified as a pre-GA offering under the [Google Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). See [launch stage descriptions](https://cloud.google.com/maps-platform/terms/launch-stages) for more details. |
| `additionalInsights[]` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#AdditionalInsights`)`` Optional. A list of `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.QUERY_PARAMETERS.additional_insights` to be included in the response. |

### Request body

The request body must be empty.

### Response body

Response message for `Solar.FindClosestBuildingInsights`. Information about the location, dimensions, and solar potential of a building.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "name": string, "center": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`) }, "boundingBox": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox`) }, "imageryDate": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`) }, "imageryProcessedDate": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`) }, "postalCode": string, "administrativeArea": string, "statisticalArea": string, "regionCode": string, "solarPotential": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential`) }, "imageryQuality": enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#ImageryQuality`), "detectedArrays": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectedArrays`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` The resource name for the building, of the format `buildings/{place_id}`. |
| `center` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` A point near the center of the building. |
| `boundingBox` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox`)`` The bounding box of the building. |
| `imageryDate` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`)`` Date that the underlying imagery was acquired. This is approximate. |
| `imageryProcessedDate` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`)`` When processing was completed on this imagery. |
| `postalCode` | `string` Postal code (e.g., US zip code) this building is contained by. |
| `administrativeArea` | `string` Administrative area 1 (e.g., in the US, the state) that contains this building. For example, in the US, the abbreviation might be "MA" or "CA." |
| `statisticalArea` | `string` Statistical area (e.g., US census tract) this building is in. |
| `regionCode` | `string` Region code for the country (or region) this building is in. |
| `solarPotential` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential`)`` Solar potential of the building. |
| `imageryQuality` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#ImageryQuality`)`` The quality of the imagery used to compute the data for this building. |
| `detectedArrays` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectedArrays`)`` Solar arrays detected on the building. This field is only populated if DETECTED_ARRAYS is included in the request's `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#body.QUERY_PARAMETERS.additional_insights`. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

## AdditionalInsights

Additional building information such as roof geometry and solar panel arrays that can be returned in BuildingInsights.

| Enums ||
|---|---|
| `ADDITIONAL_INSIGHTS_UNSPECIFIED` | The default value. The default BuildingInsights will be returned. |
| `DETECTED_ARRAYS` | Determines whether the response will include the detected arrays. If specified, the `detectedArrays` field will be populated in the response. |

## LatLngBox

A bounding box in lat/lng coordinates.

| JSON representation |
|---|
| ``` { "sw": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`) }, "ne": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`) } } ``` |

| Fields ||
|---|---|
| `sw` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` The southwest corner of the box. |
| `ne` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` The northeast corner of the box. |

## SolarPotential

Information about the solar potential of a building. A number of fields in this are defined in terms of "panels". The fields `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_capacity_watts`, `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_height_meters`, and `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_width_meters` describe the parameters of the model of panel used in these calculations.

| JSON representation |
|---|
| ``` { "maxArrayPanelsCount": integer, "panelCapacityWatts": number, "panelHeightMeters": number, "panelWidthMeters": number, "panelLifetimeYears": integer, "maxArrayAreaMeters2": number, "maxSunshineHoursPerYear": number, "carbonOffsetFactorKgPerMwh": number, "wholeRoofStats": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`) }, "buildingStats": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`) }, "roofSegmentStats": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSizeAndSunshineStats`) } ], "solarPanels": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanel`) } ], "solarPanelConfigs": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig`) } ], "financialAnalyses": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialAnalysis`) } ] } ``` |

| Fields ||
|---|---|
| `maxArrayPanelsCount` | `integer` Size of the maximum array - that is, the maximum number of panels that can fit on the roof. |
| `panelCapacityWatts` | `number` Capacity, in watts, of the panel used in the calculations. |
| `panelHeightMeters` | `number` Height, in meters in portrait orientation, of the panel used in the calculations. |
| `panelWidthMeters` | `number` Width, in meters in portrait orientation, of the panel used in the calculations. |
| `panelLifetimeYears` | `integer` The expected lifetime, in years, of the solar panels. This is used in the financial calculations. |
| `maxArrayAreaMeters2` | `number` Size, in square meters, of the maximum array. |
| `maxSunshineHoursPerYear` | `number` Maximum number of sunshine hours received per year, by any point on the roof. Sunshine hours are a measure of the total amount of insolation (energy) received per year. 1 sunshine hour = 1 kWh per kW (where kW refers to kW of capacity under Standard Testing Conditions). |
| `carbonOffsetFactorKgPerMwh` | `number` Equivalent amount of CO2 produced per MWh of grid electricity. This is a measure of the carbon intensity of grid electricity displaced by solar electricity. |
| `wholeRoofStats` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`)`` Total size and sunlight quantiles for the part of the roof that was assigned to some roof segment. Despite the name, this may not include the entire building. See `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.building_stats`. |
| `buildingStats` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`)`` Size and sunlight quantiles for the entire building, including parts of the roof that were not assigned to some roof segment. Because the orientations of these parts are not well characterised, the roof area estimate is unreliable, but the ground area estimate is reliable. It may be that a more reliable whole building roof area can be obtained by scaling the roof area from `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.whole_roof_stats` by the ratio of the ground areas of `buildingStats` and `wholeRoofStats`. |
| `roofSegmentStats[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSizeAndSunshineStats`)`` Size and sunlight quantiles for each roof segment. |
| `solarPanels[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanel`)`` Each `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanel` describes a single solar panel. They are listed in the order that the panel layout algorithm placed this. This is usually, though not always, in decreasing order of annual energy production. |
| `solarPanelConfigs[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig`)`` Each `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig` describes a different arrangement of solar panels on the roof. They are in order of increasing number of panels. The `SolarPanelConfig` with `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig.FIELDS.panels_count`=N is based on the first N panels in the `solarPanels` list. This field is only populated if at least 4 panels can fit on a roof. |
| `financialAnalyses[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialAnalysis`)`` A `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialAnalysis` gives the savings from going solar assuming a given monthly bill and a given electricity provider. They are in order of increasing order of monthly bill amount. This field will be empty for buildings in areas for which the Solar API does not have enough information to perform financial computations. |

## SizeAndSunshineStats

Size and sunniness quantiles of a roof, or part of a roof.

| JSON representation |
|---|
| ``` { "areaMeters2": number, "sunshineQuantiles": [ number ], "groundAreaMeters2": number } ``` |

| Fields ||
|---|---|
| `areaMeters2` | `number` The area of the roof or roof segment, in m\^2. This is the roof area (accounting for tilt), not the ground footprint area. |
| `sunshineQuantiles[]` | `number` Quantiles of the pointwise sunniness across the area. If there are N values here, this represents the (N-1)-iles. For example, if there are 5 values, then they would be the quartiles (min, 25%, 50%, 75%, max). Values are in annual kWh/kW like `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.max_sunshine_hours_per_year`. |
| `groundAreaMeters2` | `number` The ground footprint area covered by the roof or roof segment, in m\^2. |

## RoofSegmentSizeAndSunshineStats

Information about the size and sunniness quantiles of a roof segment.

| JSON representation |
|---|
| ``` { "stats": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`) }, "center": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`) }, "boundingBox": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox`) }, "pitchDegrees": number, "azimuthDegrees": number, "planeHeightAtCenterMeters": number } ``` |

| Fields ||
|---|---|
| `stats` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SizeAndSunshineStats`)`` Total size and sunlight quantiles for the roof segment. |
| `center` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` A point near the center of the roof segment. |
| `boundingBox` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LatLngBox`)`` The bounding box of the roof segment. |
| `pitchDegrees` | `number` Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground. |
| `azimuthDegrees` | `number` Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a "flat" roof segment (`pitchDegrees` very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North). |
| `planeHeightAtCenterMeters` | `number` The height of the roof segment plane, in meters above sea level, at the point designated by `center`. Together with the pitch, azimuth, and center location, this fully defines the roof segment plane. |

## SolarPanel

SolarPanel describes the position, orientation, and production of a single solar panel. See the `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_height_meters`, `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_width_meters`, and `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_capacity_watts` fields in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential` for information on the parameters of the panel.

| JSON representation |
|---|
| ``` { "center": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`) }, "orientation": enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelOrientation`), "yearlyEnergyDcKwh": number, "segmentIndex": integer } ``` |

| Fields ||
|---|---|
| `center` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/LatLng`)`` The centre of the panel. |
| `orientation` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelOrientation`)`` The orientation of the panel. |
| `yearlyEnergyDcKwh` | `number` How much sunlight energy this layout captures over the course of a year, in DC kWh. |
| `segmentIndex` | `integer` Index in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.roof_segment_stats` of the `RoofSegmentSizeAndSunshineStats` which corresponds to the roof segment that this panel is placed on. |

## SolarPanelOrientation

The orientation of a solar panel. This must be interpreted relative to the azimuth of the roof segment that the panel is placed on.

| Enums ||
|---|---|
| `SOLAR_PANEL_ORIENTATION_UNSPECIFIED` | No panel orientation is known. |
| `LANDSCAPE` | A `LANDSCAPE` panel has its long edge perpendicular to the azimuth direction of the roof segment that it is placed on. |
| `PORTRAIT` | A `PORTRAIT` panel has its long edge parallel to the azimuth direction of the roof segment that it is placed on. |

## SolarPanelConfig

SolarPanelConfig describes a particular placement of solar panels on the roof.

| JSON representation |
|---|
| ``` { "panelsCount": integer, "yearlyEnergyDcKwh": number, "roofSegmentSummaries": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSummary`) } ] } ``` |

| Fields ||
|---|---|
| `panelsCount` | `integer` Total number of panels. Note that this is redundant to (the sum of) the corresponding fields in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPanelConfig.FIELDS.roof_segment_summaries`. |
| `yearlyEnergyDcKwh` | `number` How much sunlight energy this layout captures over the course of a year, in DC kWh, assuming the panels described above. |
| `roofSegmentSummaries[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#RoofSegmentSummary`)`` Information about the production of each roof segment that is carrying at least one panel in this layout. `roofSegmentSummaries[i]` describes the i-th roof segment, including its size, expected production and orientation. |

## RoofSegmentSummary

Information about a roof segment on the building, with some number of panels placed on it.

| JSON representation |
|---|
| ``` { "panelsCount": integer, "yearlyEnergyDcKwh": number, "pitchDegrees": number, "azimuthDegrees": number, "segmentIndex": integer } ``` |

| Fields ||
|---|---|
| `panelsCount` | `integer` The total number of panels on this segment. |
| `yearlyEnergyDcKwh` | `number` How much sunlight energy this part of the layout captures over the course of a year, in DC kWh, assuming the panels described above. |
| `pitchDegrees` | `number` Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground. |
| `azimuthDegrees` | `number` Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a "flat" roof segment (`pitchDegrees` very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North). |
| `segmentIndex` | `integer` Index in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.roof_segment_stats` of the corresponding `RoofSegmentSizeAndSunshineStats`. |

## FinancialAnalysis

Analysis of the cost and benefits of the optimum solar layout for a particular electric bill size.

| JSON representation |
|---|
| ``` { "monthlyBill": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "defaultBill": boolean, "averageKwhPerMonth": number, "financialDetails": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialDetails`) }, "leasingSavings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LeasingSavings`) }, "cashPurchaseSavings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings`) }, "financedPurchaseSavings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancedPurchaseSavings`) }, "panelConfigIndex": integer } ``` |

| Fields ||
|---|---|
| `monthlyBill` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` The monthly electric bill this analysis assumes. |
| `defaultBill` | `boolean` Whether this is the bill size selected to be the default bill for the area this building is in. Exactly one `FinancialAnalysis` in `BuildingSolarPotential` should have `defaultBill` set. |
| `averageKwhPerMonth` | `number` How much electricity the house uses in an average month, based on the bill size and the local electricity rates. |
| `financialDetails` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancialDetails`)`` Financial information that applies regardless of the financing method used. |
| `leasingSavings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#LeasingSavings`)`` Cost and benefit of leasing the solar panels. |
| `cashPurchaseSavings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings`)`` Cost and benefit of buying the solar panels with cash. |
| `financedPurchaseSavings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#FinancedPurchaseSavings`)`` Cost and benefit of buying the solar panels by financing the purchase. |
| `panelConfigIndex` | `integer` Index in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.solar_panel_configs` of the optimum solar layout for this bill size. This can be -1 indicating that there is no layout. In this case, the remaining submessages will be omitted. |

## Money

Represents an amount of money with its currency type.

| JSON representation |
|---|
| ``` { "currencyCode": string, "units": string, "nanos": integer } ``` |

| Fields ||
|---|---|
| `currencyCode` | `string` The three-letter currency code defined in ISO 4217. |
| `units` | `string (https://developers.google.com/discovery/v1/type-format format)` The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| `nanos` | `integer` Number of nano (10\^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |

## FinancialDetails

Details of a financial analysis. Some of these details are already stored at higher levels (e.g., out of pocket cost). Total money amounts are over a lifetime period defined by the `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential.FIELDS.panel_lifetime_years` field in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarPotential`. Note: The out of pocket cost of purchasing the panels is given in the `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings.FIELDS.out_of_pocket_cost` field in `https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#CashPurchaseSavings`.

| JSON representation |
|---|
| ``` { "initialAcKwhPerYear": number, "remainingLifetimeUtilityBill": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "federalIncentive": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "stateIncentive": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "utilityIncentive": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "lifetimeSrecTotal": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "costOfElectricityWithoutSolar": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "netMeteringAllowed": boolean, "solarPercentage": number, "percentageExportedToGrid": number } ``` |

| Fields ||
|---|---|
| `initialAcKwhPerYear` | `number` How many AC kWh we think the solar panels will generate in their first year. |
| `remainingLifetimeUtilityBill` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Utility bill for electricity not produced by solar, for the lifetime of the panels. |
| `federalIncentive` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Amount of money available from federal incentives; this applies if the user buys (with or without a loan) the panels. |
| `stateIncentive` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Amount of money available from state incentives; this applies if the user buys (with or without a loan) the panels. |
| `utilityIncentive` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Amount of money available from utility incentives; this applies if the user buys (with or without a loan) the panels. |
| `lifetimeSrecTotal` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Amount of money the user will receive from Solar Renewable Energy Credits over the panel lifetime; this applies if the user buys (with or without a loan) the panels. |
| `costOfElectricityWithoutSolar` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Total cost of electricity the user would have paid over the lifetime period if they didn't install solar. |
| `netMeteringAllowed` | `boolean` Whether net metering is allowed. |
| `solarPercentage` | `number` Percentage (0-100) of the user's power supplied by solar. Valid for the first year but approximately correct for future years. |
| `percentageExportedToGrid` | `number` The percentage (0-100) of solar electricity production we assumed was exported to the grid, based on the first quarter of production. This affects the calculations if net metering is not allowed. |

## LeasingSavings

Cost and benefit of leasing a particular configuration of solar panels with a particular electricity usage.

| JSON representation |
|---|
| ``` { "leasesAllowed": boolean, "leasesSupported": boolean, "annualLeasingCost": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "savings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`) } } ``` |

| Fields ||
|---|---|
| `leasesAllowed` | `boolean` Whether leases are allowed in this juristiction (leases are not allowed in some states). If this field is false, then the values in this message should probably be ignored. |
| `leasesSupported` | `boolean` Whether leases are supported in this juristiction by the financial calculation engine. If this field is false, then the values in this message should probably be ignored. This is independent of `leasesAllowed`: in some areas leases are allowed, but under conditions that aren't handled by the financial models. |
| `annualLeasingCost` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Estimated annual leasing cost. |
| `savings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`)`` How much is saved (or not) over the lifetime period. |

## SavingsOverTime

Financial information that's shared between different financing methods.

| JSON representation |
|---|
| ``` { "savingsYear1": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "savingsYear20": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "presentValueOfSavingsYear20": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "savingsLifetime": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "presentValueOfSavingsLifetime": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "financiallyViable": boolean } ``` |

| Fields ||
|---|---|
| `savingsYear1` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Savings in the first year after panel installation. |
| `savingsYear20` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Savings in the first twenty years after panel installation. |
| `presentValueOfSavingsYear20` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Using the assumed discount rate, what is the present value of the cumulative 20-year savings? |
| `savingsLifetime` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Savings in the entire panel lifetime. |
| `presentValueOfSavingsLifetime` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Using the assumed discount rate, what is the present value of the cumulative lifetime savings? |
| `financiallyViable` | `boolean` Indicates whether this scenario is financially viable. Will be false for scenarios with poor financial viability (e.g., money-losing). |

## CashPurchaseSavings

Cost and benefit of an outright purchase of a particular configuration of solar panels with a particular electricity usage.

| JSON representation |
|---|
| ``` { "outOfPocketCost": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "upfrontCost": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "rebateValue": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "savings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`) }, "paybackYears": number } ``` |

| Fields ||
|---|---|
| `outOfPocketCost` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Initial cost before tax incentives: the amount that must be paid out-of-pocket. Contrast with `upfrontCost`, which is after tax incentives. |
| `upfrontCost` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Initial cost after tax incentives: it's the amount that must be paid during first year. Contrast with `outOfPocketCost`, which is before tax incentives. |
| `rebateValue` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` The value of all tax rebates. |
| `savings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`)`` How much is saved (or not) over the lifetime period. |
| `paybackYears` | `number` Number of years until payback occurs. A negative value means payback never occurs within the lifetime period. |

## FinancedPurchaseSavings

Cost and benefit of using a loan to buy a particular configuration of solar panels with a particular electricity usage.

| JSON representation |
|---|
| ``` { "annualLoanPayment": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "rebateValue": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`) }, "loanInterestRate": number, "savings": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`) } } ``` |

| Fields ||
|---|---|
| `annualLoanPayment` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` Annual loan payments. |
| `rebateValue` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#Money`)`` The value of all tax rebates (including Federal Investment Tax Credit (ITC)). |
| `loanInterestRate` | `number` The interest rate on loans assumed in this set of calculations. |
| `savings` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SavingsOverTime`)`` How much is saved (or not) over the lifetime period. |

## DetectedArrays

Information about solar arrays detected on the building.

| JSON representation |
|---|
| ``` { "detectionStatus": enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectionStatus`), "arrays": [ { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarArray`) } ], "latestCaptureDate": { object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`) } } ``` |

| Fields ||
|---|---|
| `detectionStatus` | ``enum (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#DetectionStatus`)`` Indicates the detection status of solar arrays for this building. |
| `arrays[]` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest#SolarArray`)`` A list of solar arrays detected on the building. |
| `latestCaptureDate` | ``object (`https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers#Date`)`` The date indicating when the latest solar array data was captured. |

## DetectionStatus

Indicates the detection status of solar arrays for this building.

| Enums ||
|---|---|
| `DETECTION_STATUS_UNSPECIFIED` | Unspecified status. |
| `DETECTION_STATUS_DATA_UNAVAILABLE` | Detected solar array data is unavailable for this building. |
| `DETECTION_STATUS_ARRAYS_DETECTED` | At least one solar array has been detected for this building. |
| `DETECTION_STATUS_NO_ARRAYS_DETECTED` | No solar arrays detected for this building. |

## SolarArray

Details of a single detected solar array.

| JSON representation |
|---|
| ``` { "polygonGeojson": { object } } ``` |

| Fields ||
|---|---|
| `polygonGeojson` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` A GeoJSON representation of the building area where solar panels were detected. The GeoJSON data must be in RFC 7946 format and represent a Polygon for a single contiguous area. The Polygon will be represented by several loops when it contains holes. Example: { "type": "Polygon", "coordinates": \[ \[ \[-1, -1\], \[-1, 0\], \[0, 0\], \[-1, -1\] \] \] } |