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
- Regional availability: Limited. Coverage varies by country and imagery quality (
HIGH,MEDIUM,BASE);financialAnalysesis returned only for US locations. For EEA billing addresses, EEA terms apply andbuildingInsightsomitspostalCode,administrativeArea, andregionCode(coverage details)
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 (
financialAnalysesin the US; calculated fromsolarPanelConfigselsewhere). - 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 instead.
Solar API: setup
- Service to enable:
solar.googleapis.com - Authentication: API key, OAuth 2.0
- Get started: Set up Solar API
- Reference: Solar API reference
- Pricing: Solar API usage and billing
- Policies: Solar API policies
- Release notes: Solar API release notes
Solar API: related products
- Often used with: Geocoding API, Places API (New), Maps JavaScript API
Solar API: common mistakes
- Problem: If the location has no imagery that meets
requiredQuality,buildingInsightsreturns aNOT_FOUND(404) error. If only higher-quality data exists, the API returns that data instead of the quality you asked for. Fix: Use a lowerrequiredQuality, such asMEDIUMorBASE, when a 404 is acceptable to avoid. Check theimageryQualityfield in the response. See /maps/documentation/solar/building-insights. - Problem: URLs in the
dataLayersresponse expire one hour after the request, and fetching them fails with 403 (PERMISSION_DENIED) unless you append&key=YOUR_API_KEYor send OAuth headers. Fix: Download the GeoTIFFs from the returned/v1/geoTiff:getURLs within one hour, or calldataLayers:getagain for new URLs. See /maps/documentation/solar/data-layers. - 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.
- 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.
Solar API: legacy and deprecated features
- Earth Engine Solar API (
earthenginesolar.googleapis.com) with methodsbuildings:findClosestandsolarInfo:get: Deprecated since 2023-05-09. Replacement:solar.googleapis.comwithbuildingInsights:findClosestanddataLayers:get. Symptom: Requests toearthenginesolar.googleapis.comreturn 404, and oldearthengine.googleapis.comGeoTIFF URLs return an error if an API key is appended. See the migration guide.
What you can do with Solar API
See the guides linked below for each task, or compare across products in the Capabilities Explorer.
- 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.
- Return an estimate of hours of sunshine per year on the roof of a building at a specified location.
- Return an estimate of the carbon offset potential by solar panels on the roof of a building at a specified location.
- Return details about the geometry of the roof of a building at a specified location.
- Return information about the potential financial benefits of installing solar panels on the roof a building at a specified location.
- Return the URL of a GeoTIFF file of an RGB aerial image for a specified location.
- Return the URL of a GeoTIFF file containing Digital Surface Model (DSM) elevation topography data of natural and built features for a specified location.
- Return the URL of a GeoTIFF file of a building rooftop mask for specified location.
- Return the URL of a GeoTIFF file containing annual sunlight (flux) data for a specified location.
- Return the URL of a GeoTIFF file containing monthly sunlight (flux) data for a specified location.
- Return the URL of a GeoTIFF file containing hourly shade data, grouped by month, for a specified location.