Calculate solar costs and savings for non-US locations

  • The Solar API provides data for calculating solar panel setup but lacks financial analysis for non-US locations, requiring supplemental calculations.

  • Users need location-specific data like electricity costs, incentives, and installation costs to perform financial analysis for solar installations outside the US.

  • The process involves calculating lifetime energy consumption, solar production, and costs with and without solar to determine potential savings and optimal system size.

  • This guide helps users assess solar panel feasibility by calculating lifetime electricity costs with and without solar, installation costs, and potential savings.

  • By comparing total costs and savings for various system sizes, users can identify the most cost-effective solar installation for their needs.

European Economic Area (EEA) developers If your billing address is in the European Economic Area, effective on 8 July 2025, the Google Maps Platform EEA Terms of Service will apply to your use of the Services.Learn more. In addition, certain content from the Solar API will no longer be returned.Learn more.

This section describes how to do the calculations that enable you to determinethe best solar configuration for households in non-US locations. To calculatethe recommendations, you need to model the costs of installing solar panels andthe savings that they provide by using the data from a Solar APIresponse.

For US locations, the Solar API returns an instance of theFinancialAnalysis object for each electric bill size for the input location.You use the information in these instances to determine the bill, energyconsumption, and, ultimately, the savings that are associated with each solarinstallation size.

For non-US locations, the API response doesn't include theFinancialAnalysisinstances, so you have to calculate the cost and savings for each solarconfiguration yourself before you can recommend the best one. To perform thecalculations, you need to gather location-specific data and follow the guidancein this document.

You can model your calculations on the calculations that the Solar APIuses for US locations. For an explanation of these calculations, seeCalculatecost savings (US).

Solar panel configurations

For non-US locations, the information about each solar panel configuration thatyou need for financial analysis is provided in theSolarPanelConfig field.The number ofSolarPanelConfig instances that are returned depends on the roofsize of the input location. For your calculations, you need the values from thefollowing two fields:

The following example shows one instance of theSolarPanelConfig object in thesolarPanelConfigs field in a request response:

  "solarPanelConfigs": [      {        "panelsCount": 4,        "yearlyEnergyDcKwh": 1709.2424,        "roofSegmentSummaries": [          {            "pitchDegrees": 16.253168,            "azimuthDegrees": 169.41516,            "panelsCount": 4,            "yearlyEnergyDcKwh": 1709.2424          }        ]      }  ]

For solar installations,installationSize refers to the kW output rather thanthe area or panel count and is defined as:

installationSize = panelsCount * panelCapacityWatts/1000 kW

Adjust energy production estimates for different panel ratings

To calculate theyearlyEnergyDcKwh value, the Solar API uses the powerrating in thepanelCapacityWatts field, which is currently 400W.

If you need to use a different panel power rating in your calculations and thedimensions of the panels are roughly comparable to the values in thepanelHeightMeters andpanelWidthMeters fields, you can adjust yourcalculations by multiplying the value returned by the API in theyearlyEnergyDcKwh field by the ratio of your power rating to the value inpanelCapacityWatts.

For example, if the power rating of your panels is 500W andpanelCapacityWattsis 400W, multiply the value ofyearlyEnergyDcKwh, which the API calculated byusingpanelCapacityWatts, by a factor of 500/400, or 1.25. If your panel powerrating is 200W, multiplyyearlyEnergyDcKwh by 200/400, or 0.5.

Excess energy production

Accounting for excess energy that might be produced by a solar installation isout of scope for the Solar API calculations. In fact, if theSolar API returns multiple possibleSolarPanelConfig instances for agiven household, the Solar API doesn't consider results or configurationsthat produce more power than the assumed US average household consumption in theFinancialAnalysis.

However, you might have reasons for including installations that produce excesselectricity in your recommendations. For example, you might want to offset thegradual decline in panel efficiency (theefficiencyDepreciationFactor) byallowing for excess production in the first part of an installation's life. Formore information, seeRequired values for financialanalysis.

Whatever your reasons, if you do include solar installations that produce excesselectricity in your calculations, just be aware that the calculations that areexplained here don't cover that scenario.

Required values for financial analysis for non-US locations

From eachSolarPanelConfig instance in the API response, you need two valuesto perform the financial analysis for that instance:

  • panelsCount: The number of solar panels in an installation. You usethis value in your calculation of theinstallationSize.
  • yearlyEnergyDcKwh: How much solar energy a layout captures over thecourse of a year, in kWh of DC electricity, given a specificpanelsCount.You use this value in your calculation of the solar energy that is usable asAC electricity in a household (initialAcKwhPerYear) of eachinstallationSize, taking into account any energy loss during theconversion from DC to AC.

Additionally, you need to gather location-specific values for the followingvariables that you will use in the calculations:

  • billCostModel(): Your model for determining the cost, in localcurrency, paid by a household for using a given number of kWh. How much autility charges for electricity can vary from day to day or hour to hourdepending on things like demand, time of day, and how much electricity thehousehold consumes. You might need to estimate an average cost.
  • costIncreaseFactor: The factor by which the cost of electricityincreases annually. The Solar API uses 1.022 (2.2% annualincrease) for US locations. Adjust this value as needed for your area.
  • dcToAcDerate: The efficiency at which an inverter converts the DCelectricity that is produced by the solar panels to the AC electricity thatis used in a household. The Solar API uses 85% for USlocations. Adjust this value as needed for your area.
  • discountRate: The Solar API uses 1.04 (4% annualincrease) for US locations. Adjust this value as needed for your area.
  • efficiencyDepreciationFactor: How much the efficiency of the solarpanels declines each year. The Solar API uses 0.995 (0.5%annual decrease) for US locations. Adjust this value as needed for yourarea.
  • incentives: Include any monetary incentives to install solar panelsgiven by government entities in your area.
  • installationCostModel(): Your method for estimating the cost ofinstalling solar in local currency for a giveninstallationSize. The costmodel would typically account for local labor and material costs for a giveninstallationSize.
  • installationLifeSpan: The expected lifespan of the solar installation.The Solar API uses 20 years. Adjust this value as needed for yourarea.
  • kWhConsumptionModel(): Your model for determining how much energy ahousehold consumes based on a monthly bill. In its simplest form, you woulddivide the bill by the average cost of a kWh in the household's location.
  • monthlyBill: the average monthly electric bill for a subjecthousehold.
  • monthlyKWhEnergyConsumption: An estimate of the average amount ofelectricity the household at a given location consumes in a month, measuredin KWh.

With these values and the information provided by the API response, you canperform the calculations necessary to recommend the bestinstallationSize forlocations not covered by the Solar API.

Calculation steps

The following steps are based on the Solar API's methodology. You mightneed to adjust your methodology based on the information that is available foryour location.

  1. Calculate the annual energy consumption of the household at the inputlocation:

    1. Estimate or request the monthly bill for the household.
    2. Calculate themonthlyKWhEnergyConsumption from the monthly bill. (Ifyou know themonthlyKWhEnergyConsumption, you can skip this step.) Forexample:

    monthlyKWhEnergyConsumption =kWhConsumptionModel(monthlyBill)

    1. CalculateannualKWhEnergyConsumption by multiplyingmonthlyKWhEnergyConsumption by 12:

    annualKWhEnergyConsumption =monthlyKWhEnergyConsumption x 12

  2. Get the API response for the target household:

    https://solar.googleapis.com/v1/buildingInsights:findClosest?location.latitude=lat-number&location.longitude=long-number&key=yourAPIKey

    The response includes usable sunlight, usable roof space, and one or morepossible solar panel configurations.

  3. Calculate the annual solar energy AC production of eachinstallationSize the API proposes by multiplying theyearlyEnergyDcKwhvalue provided by the API in eachSolarPanelConfig instance by your localdcToAcDerate:

    initialAcKwhPerYear =yearlyEnergyDcKwh xdcToAcDerate

  4. Optionally, remove from consideration anySolarPanelConfig instance thatproduces more electricity than the household consumes annually(initialAcKwhPerYear >annualKWhEnergyConsumption).

  5. Calculate the lifetime solar energy production(LifetimeProductionAcKwh) of each returnedinstallationSize:

    1. For each year of the lifespan of the solar installation,calculate theamount of electricity the installation will produce annually, applyingtheefficiencyDepreciationFactor exponentially to each year after thefirst.
    2. Add the totals for all years.

    The following table shows an example of how to calculate the lifetime energyproduction assuming aninstallationLifeSpan of 20 years. Each row represents a year of production. After the first year, the efficiency decline is applied exponentially. Finally, the sum of all rows is the lifetime energy production of the solar installation.

    YearYearly solar energy production (kWh)
    1initialAcKwhPerYear
    2+initialAcKwhPerYear xefficiencyDepreciationFactor
    ::
    20+initialAcKwhPerYear xefficiencyDepreciationFactor19
    TotalLifetimeProductionAcKwh

Because the solar panel efficiency decays at a constant rate, it is essentiallya geometric series wherea = initialAcKwhPerYear andr =efficiencyDepreciationFactor. We can use a geometric sum to calculate theLifetimeProductionAcKwh:

LifetimeProductionAcKwh = (dcToAcDerate* initialAcKwhPerYear * (1 - pow(efficiencyDepreciationFactor, installationLifeSpan)) / (1 - efficiencyDepreciationFactor))

The following Python code computes the geometric sum above:

defLifetimeProductionAcKwh(dcToAcDerate,yearlyEnergyDcKwh,efficiencyDepreciationFactor,installationLifeSpan):return(dcToAcDerate*yearlyEnergyDcKwh*(1-pow(efficiencyDepreciationFactor,installationLifeSpan))/(1-efficiencyDepreciationFactor))
  1. For each returnedinstallationSize, calculate the lifetime cost ofenergy consumption if theinstallationSize is installed:

    1. For each year of the lifespan of the solar installation,calculate thecost of the electricity the household will need to purchase annually tocover the energy consumption not met by solar power. Use the valuesforannualKWhEnergyConsumption andinitialAcKwhPerYear that youcalculated previously. For each year after the first year, apply theefficiencyDepreciationFactor,costIncreaseFactor, and thediscountRate to the values.
    2. Add the totals for all years.

    The following table shows an example of how to calculate the lifetime cost of electricity. Each row represents the cost of electricity for a year in the life of the solar installation. After the first year, both the increased cost of electricity and the discount rate are applied exponentially. Finally, the sum of all rows is the lifetime cost of electricity with the solar installation.

    YearAnnual utility bill in current local currency value (USD) (annualUtilityBillEstimate)
    1annualUtilityBillEstimateYear1 =billCostModel (yearlyKWhEnergyConsumption -initialAcKwhPerYear)
    2annualUtilityBillEstimateYear2 =billCostModel (yearlyKWhEnergyConsumption -initialAcKwhPerYear xefficiencyDepreciationFactor) xcostIncreaseFactor /discountRate
    ::
    20annualUtilityBillEstimateYear20 =billCostModel (yearlyKWhEnergyConsumption -initialAcKwhPerYear xefficiencyDepreciationFactor19) xcostIncreaseFactor19 /discountRate19
    TotalremainingLifetimeUtilityBill

The following Python code returns an array ofannualUtilityBillEstimate forevery year of theinstallationLifeSpan:

defannualUtilityBillEstimate(yearlyKWhEnergyConsumption,initialAcKwhPerYear,efficiencyDepreciationFactor,year,costIncreaseFactor,discountRate):return(billCostModel(yearlyKWhEnergyConsumption-annualProduction(initialAcKwhPerYear,efficiencyDepreciationFactor,year))*pow(costIncreaseFactor,year)/pow(discountRate,year))deflifetimeUtilityBill(yearlyKWhEnergyConsumption,initialAcKwhPerYear,efficiencyDepreciationFactor,installationLifeSpan,costIncreaseFactor,discountRate):bill=[0]*installationLifeSpanforyearinrange(installationLifeSpan):bill[year]=annualUtilityBillEstimate(yearlyKWhEnergyConsumption,initialAcKwhPerYear,efficiencyDepreciationFactor,year,costIncreaseFactor,discountRate)returnbill
  1. Calculate the lifetime cost of electricity if a solar installation is notinstalled:

    1. For each year of the lifespan of the solar installation,calculate thecost of the electricity the household will need to purchase annually ifsolar is not installed. Use the value formonthlyBill. For each yearafter the first year, apply thecostIncreaseFactor and thediscountRate values tomonthlyBill.
    2. Add the totals for all years.

    The following table shows an example of how to calculate the lifetime cost of electricity without solar. Each row represents the cost of electricity for a year over the same number of years as the lifespan ofa solar installation. After the first year, both the increased cost of electricity and the discount rate are applied exponentially. Finally, the sum of all rows is the lifetime cost of electricity without solar installation.

    YearAnnual utility bill in current local currency value
    1annualBill =monthlyBill x 12
    2annualBill =monthlyBill x 12 xcostIncreaseFactor /discountRate
    ::
    20annualBill =monthlyBill x 12 xcostIncreaseFactor19 /discountRate19
    TotalcostOfElectricityWithoutSolar

The following code performs the calculation above:

lifetimeBill = (    monthlyBill* 12 *    (1 - pow(costIncreaseFactor / discountRate, installationLifeSpan)) /    (1 - costIncreaseFactor / discountRate))
  1. For each installation size, calculate the installation cost:

    installationCost =localInstallationCostModel(installationSize)

  2. Add up any monetary incentives that are available to the householdlocation.

  3. For each installation size, calculate the total costs associated withinstalling solar:

    totalCostWithSolar =installationCost +remainingLifetimeUtilityBill-incentives

  4. For each installation size, calculate the total savings associated withinstalling solar:

    savings =costOfElectricityWithoutSolar -totalCostWithSolar

  5. Select the installation size that provides the most savings.

When your calculations are done

Using the information you provide, the information returned by theSolar API, and the above calculations, you should be able to recommendsolar installation sizes that provide maximum cost savings for households inyour area.

In the recommendations that you provide to your end user, you can also includethe following information that is returned by the API in theSolarPotentialobject of thesolarPotential field:

  • How much usable sunlight a house receives annually, which is returned in themaxSunshineHoursPerYear field of theSolarPotential object.
  • How many square feet of a roof can be used for a solar installation, whichis returned in thewholeRoofStats field of theSolarPotential object.
  • The average monthly electricity bill for the household.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-21 UTC.