The Solar API returns rooftop solar data for buildings. Its `buildingInsights` endpoint returns a building's location, dimensions, and solar potential. Its `dataLayers` endpoint returns URLs for GeoTIFF rasters of an area, such as a digital surface model, aerial imagery, a building mask, flux maps, and hourly shade, which you download with the `geoTiff` endpoint.

## Solar API: key facts

- **Product:** Solar API
- **Also known as:** Google Maps Platform Solar API
- **Category:** Environment
- **Platform:** Web service (REST)
- **Runs on:** Server (backend code)
- **Launch stage:** GA
- **Lifecycle:** Active
- **Overview:** [Solar API overview](https://developers.google.com/maps/documentation/solar/overview.md.txt)
- **Regional availability:** Limited. Coverage varies by country and imagery quality (`HIGH`, `MEDIUM`, `BASE`); `financialAnalyses` is returned only for US locations. For EEA billing addresses, EEA terms apply and `buildingInsights` omits `postalCode`, `administrativeArea`, and `regionCode` ([coverage details](https://developers.google.com/maps/documentation/solar/coverage.md.txt))

## Solar API: when to use it

**Use Solar API when:**

- You need the solar potential, roof segment stats, and suggested panel layouts for a building at a given latitude and longitude.
- You need estimated rooftop solar energy production, plus costs and savings (`financialAnalyses` in the US; calculated from `solarPanelConfigs` elsewhere).
- You need GeoTIFF layers (DSM, RGB imagery, building mask, annual or monthly flux, hourly shade) for an area to design a solar system in a GIS tool.
- You want to remotely assess roofs to reduce site assessment time or prioritize installation locations.
**Don't use Solar API when:**

- You need information about addresses around a location rather than building-level rooftop insights. Use [Geocoding API](https://developers.google.com/maps/documentation/geocoding/quick-reference.md.txt) instead.

## Solar API: setup

- **Service to enable:** `solar.googleapis.com`
- **Authentication:** API key, OAuth 2.0
- **Get started:** [Set up Solar API](https://developers.google.com/maps/documentation/solar/get-api-key.md.txt)
- **Reference:** [Solar API reference](https://developers.google.com/maps/documentation/solar/reference/rest.md.txt)
- **Pricing:** [Solar API usage and billing](https://developers.google.com/maps/documentation/solar/usage-and-billing.md.txt)
- **Policies:** [Solar API policies](https://developers.google.com/maps/documentation/solar/policies.md.txt)
- **Release notes:** [Solar API release notes](https://developers.google.com/maps/documentation/solar/release-notes.md.txt)

## Solar API: related products

- **Often used with:** [Geocoding API](https://developers.google.com/maps/documentation/geocoding/quick-reference.md.txt), [Places API (New)](https://developers.google.com/maps/documentation/places/web-service/quick-reference.md.txt), [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/quick-reference.md.txt)

## Solar API: common mistakes

- **Problem:** If the location has no imagery that meets `requiredQuality`, `buildingInsights` returns a `NOT_FOUND` (404) error. If only higher-quality data exists, the API returns that data instead of the quality you asked for. **Fix:** Use a lower `requiredQuality`, such as `MEDIUM` or `BASE`, when a 404 is acceptable to avoid. Check the `imageryQuality` field in the response. See [/maps/documentation/solar/building-insights](https://developers.google.com/maps/documentation/solar/building-insights.md.txt).
- **Problem:** URLs in the `dataLayers` response expire one hour after the request, and fetching them fails with 403 (`PERMISSION_DENIED`) unless you append `&key=YOUR_API_KEY` or send OAuth headers. **Fix:** Download the GeoTIFFs from the returned `/v1/geoTiff:get` URLs within one hour, or call `dataLayers:get` again for new URLs. See [/maps/documentation/solar/data-layers](https://developers.google.com/maps/documentation/solar/data-layers.md.txt).
- **Problem:** Except for the RGB layer, GeoTIFF files look blank in image viewers, and you can't use them directly as Maps JavaScript API overlays. **Fix:** Open the files in GIS software such as QGIS, or decode the pixel values and render them yourself. You can store downloaded GeoTIFF files for up to 30 days. See [/maps/documentation/solar/geotiff](https://developers.google.com/maps/documentation/solar/geotiff.md.txt).
- **Problem:** The coverage map is an approximation. Requests can return 404 in areas that look covered, for example near country borders. **Fix:** Handle 404 responses, and check the release notes for coverage updates. See [/maps/documentation/solar/coverage](https://developers.google.com/maps/documentation/solar/coverage.md.txt).

## Solar API: legacy and deprecated features

- **Earth Engine Solar API (`earthenginesolar.googleapis.com`) with methods `buildings:findClosest` and `solarInfo:get`:** Deprecated since 2023-05-09. **Replacement:** `solar.googleapis.com` with `buildingInsights:findClosest` and `dataLayers:get`. **Symptom:** Requests to `earthenginesolar.googleapis.com` return 404, and old `earthengine.googleapis.com` GeoTIFF URLs return an error if an API key is appended. See the [migration guide](https://developers.google.com/maps/documentation/solar/migration.md.txt).

## What you can do with Solar API

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Return an estimate of the number and size of solar panels that can be installed on the roof of a building at a specified location.](https://developers.google.com/maps/documentation/solar/building-insights.md.txt)
- [Return an estimate of hours of sunshine per year on the roof of a building at a specified location.](https://developers.google.com/maps/documentation/solar/building-insights.md.txt)
- [Return an estimate of the carbon offset potential by solar panels on the roof of a building at a specified location.](https://developers.google.com/maps/documentation/solar/building-insights.md.txt)
- [Return details about the geometry of the roof of a building at a specified location.](https://developers.google.com/maps/documentation/solar/building-insights.md.txt)
- [Return information about the potential financial benefits of installing solar panels on the roof a building at a specified location.](https://developers.google.com/maps/documentation/solar/building-insights.md.txt)
- [Return the URL of a GeoTIFF file of an RGB aerial image for a specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)
- [Return the URL of a GeoTIFF file containing Digital Surface Model (DSM) elevation topography data of natural and built features for a specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)
- [Return the URL of a GeoTIFF file of a building rooftop mask for specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)
- [Return the URL of a GeoTIFF file containing annual sunlight (flux) data for a specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)
- [Return the URL of a GeoTIFF file containing monthly sunlight (flux) data for a specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)
- [Return the URL of a GeoTIFF file containing hourly shade data, grouped by month, for a specified location.](https://developers.google.com/maps/documentation/solar/geotiff.md.txt)