apyhub
Back
▣ MODEL KIT

Solar Panel Output Calculator API

What it does

The Solar Panel Output Calculator API estimates how much electricity a solar panel system will produce at any location. Send up to 50 locations with your system size. For each site, you get back the yearly kWh, a monthly breakdown, the best and worst months, and the best panel angle.

Set peakPowerKw to your system size in kWp. Leave tilt and azimuthCompass empty and the API finds the angles with the highest yearly output. Choose mode to shape the answer. yield returns one row per site and monthly returns 12 rows per site. compare shows how an optimal, flat, south, east and west roof perform against each other. You can also set mounting, tracking, technology and systemLossPercent.

Add systemCost and electricityPrice to turn energy into money. Each row then includes yearly savings, the 25-year value, the cost per kWp and a payback time in years. A point at sea comes back as a row with an error field instead of failing the call.

Solar installers use the Solar Panel Output Calculator API to quote customers in seconds. Energy comparison sites use this solar panel output API to show savings for an address. Property tools use it to rank roofs by solar potential.

To get coordinates from an address first, use the Geocode Addresses API. To show savings in another currency, pair it with the Currency Converter API.

POST
Solar PV Yield API - kWh per Month, Payback, No Key, MCP
https://api.eu.apyhub.com/martin10291/solar-panel-output-calculator

QUICKSTART

GUIDE

Quickstart

Estimate the yearly output and payback of a 5 kWp system in Madrid.

curl -X POST "https://api.eu.apyhub.com/martin10291/solar-panel-output-calculator" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"locations": ["40.4168,-3.7038,Madrid"], "peakPowerKw": 5, "systemCost": 6000, "electricityPrice": 0.25, "currency": "EUR"}'

What you'll get back

Returns a JSON object with count and an items array, one row per location with yearly and monthly output, the best panel angles and money values. The example below is trimmed: monthlyKwh shows 2 of its 12 entries.

{
  "count": 1,
  "items": [
    {
      "anglesMethod": "pvgis-optimal-angles",
      "annualIrradiationKwhM2": 2093.75,
      "annualKwh": 8103.6,
      "annualValue": 2025.9,
      "azimuthCompassDeg": 175,
      "azimuthDeg": -5,
      "bestMonth": "July",
      "bestMonthKwh": 835.85,
      "costPerKwp": 1200,
      "currency": "EUR",
      "dailyAvgKwh": 22.19,
      "dataYears": "2005-2023",
      "electricityPrice": 0.25,
      "elevationM": 665,
      "fetchedAt": "2026-11-25T08:12:47Z",
      "label": "Madrid",
      "lat": 40.4168,
      "lifetimeKwh25y": 190888,
      "lifetimeValue25y": 47722,
      "lon": -3.7038,
      "monthlyKwh": [
        { "kwh": 548.55, "month": 1, "name": "January" },
        { "kwh": 572.45, "month": 2, "name": "February" }
      ],
      "mounting": "free",
      "optimizedAngles": true,
      "paybackYears": 3,
      "peakPowerKw": 5,
      "performanceRatioPercent": 77.41,
      "radiationDatabase": "PVGIS-SARAH3",
      "source": "PVGIS (c) European Union, 2001-2026, JRC",
      "sourceUrl": "https://re.jrc.ec.europa.eu/api/v5_3/PVcalc?lat=40.417&lon=-3.704&peakpower=5&loss=14&mountingplace=free&optimalangles=1&pvtechchoice=crystSi&outputformat=json",
      "specificYieldKwhPerKwp": 1620.72,
      "systemCost": 6000,
      "systemLossPercent": 14,
      "technology": "crystSi",
      "tiltDeg": 37,
      "totalLossPercent": 22.59,
      "tracking": "none",
      "worstMonth": "November",
      "worstMonthKwh": 510.8,
      "yearToYearVariabilityKwh": 252.35
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
locations*
Locations as 'lat,lon' or 'lat,lon,label' in decimal degrees, e.g. 40.4168,-3.7038,Madrid. Max 50. Points at sea or outside coverage return a row with an error field.
yield = one row per location; monthly = 12 rows per location; compare = 5 orientation rows (optimal, flat, south-30, east-30, west-30) for the first location only.
Panel tilt from horizontal (0 = flat, 90 = vertical). Leave empty to optimize.
Label for the money fields, e.g. EUR, USD, GBP. No conversion is done.

About this endpoint

What it does

Estimates solar PV output for up to 50 locations in one request, using the EU JRC PVGIS 5.3 solar database. Returns one summary row per location, 12 monthly rows per location, or 5 orientation-comparison rows for the first location, depending on mode.

Request Body

ParameterTypeDescription
locationsString ArrayRequired. Locations as "lat,lon" or "lat,lon,label" in decimal degrees, for example "40.4168,-3.7038,Madrid". Max 50 items. A point at sea or outside coverage returns a row with error.
modeENUMAllowed values: yield, monthly, compare. Default: yield. yield: one row per location. monthly: 12 rows per location. compare: 5 rows for the first location only (optimal, flat, south-30, east-30, west-30); other locations are ignored.
peakPowerKwNumberInstalled system size in kWp. Default: 1. Range: 0.1 to 100000.
tiltNumberPanel tilt from horizontal: 0 is flat, 90 is vertical. Range: 0 to 90. Leave empty to optimize.
azimuthCompassNumberDirection the panels face as a compass bearing: 180 south, 90 east, 270 west, 0 north. Range: 0 to 360. Leave empty to optimize.
optimizeBooleanWhen tilt and azimuthCompass are not sent, find the angles with the highest yearly output. false uses 30 degrees facing the equator. Default: true.
mountingENUMAllowed values: free, building. Default: free. free: free-standing rack. building: built into the roof or facade (runs hotter, slightly less output).
trackingENUMAllowed values: none, single-inclined, single-vertical, two-axis. Default: none (fixed panels).
technologyENUMPanel technology. Allowed values: crystSi, CIS, CdTe, Unknown. Default: crystSi.
systemLossPercentNumberCable, inverter and dirt losses in percent. Default: 14. Range: 0 to 50.
systemCostNumberTotal installed cost. Minimum: 0. With electricityPrice, adds paybackYears and costPerKwp.
electricityPriceNumberPrice per kWh. Minimum: 0. Adds annualValue and lifetimeValue25y (assumes 0.5% yearly panel degradation).
currencyStringLabel for the money fields, for example EUR, USD, GBP. No conversion is done.

Response

Returns a JSON object with count and an items array. The fields in each row depend on mode and on whether money inputs were sent.

ParameterTypeDescription
countIntegerNumber of rows in items.
itemsObject ArrayOne row per location (yield), 12 per location (monthly) or 5 (compare).
items[].latNumberLatitude sent.
items[].lonNumberLongitude sent.
items[].labelStringLabel sent, or the coordinates when no label was given.
items[].peakPowerKwNumberSystem size used.
items[].annualKwhNumberEstimated yearly output in kWh.
items[].specificYieldKwhPerKwpNumberYearly kWh per installed kWp.
items[].dailyAvgKwhNumberAverage daily output in kWh.
items[].monthlyKwhObject Arrayyield and compare rows: 12 entries, each with month (Integer, 1 to 12), name (String) and kwh (Number).
items[].bestMonthStringMonth with the highest output.
items[].bestMonthKwhNumberOutput of the best month in kWh.
items[].worstMonthStringMonth with the lowest output.
items[].worstMonthKwhNumberOutput of the worst month in kWh.
items[].lifetimeKwh25yNumberExpected output over 25 years.
items[].yearToYearVariabilityKwhNumberTypical variation between years in kWh.
items[].annualIrradiationKwhM2NumberYearly sunlight on the panel in kWh/m².
items[].performanceRatioPercentNumberShare of the sunlight energy delivered as electricity after losses.
items[].totalLossPercentNumberAll losses combined, in percent.
items[].systemLossPercentNumberSystem loss used.
items[].tiltDegNumberTilt used. null for two-axis tracking.
items[].azimuthCompassDegNumberCompass direction used. null for tracking systems.
items[].azimuthDegNumberSame direction in PVGIS style, where 0 faces the equator. null for tracking systems.
items[].optimizedAnglesBooleantrue when the angles were optimized.
items[].anglesMethodStringHow the angles were chosen, for example pvgis-optimal-angles, user, preset.
items[].mountingStringMounting used.
items[].trackingStringTracking used.
items[].technologyStringPanel technology used.
items[].elevationMNumberGround elevation in metres.
items[].radiationDatabaseStringSolar database used, for example PVGIS-SARAH3.
items[].dataYearsStringYears of weather data used, for example 2005-2023.
items[].monthIntegermonthly rows only: month number, 1 to 12.
items[].monthNameStringmonthly rows only: month name.
items[].kwhNumbermonthly rows only: output of that month in kWh.
items[].irradiationKwhM2Numbermonthly rows only: sunlight of that month in kWh/m².
items[].shareOfYearPercentNumbermonthly rows only: that month's share of the yearly output.
items[].variantENUMcompare rows only. Allowed values: optimal, flat, south-30, east-30, west-30.
items[].isBestBooleancompare rows only: true for the best option.
items[].vsBestPercentNumbercompare rows only: percent difference to the best option (0 for the best).
items[].annualValueNumberWith electricityPrice: yearly value of the electricity.
items[].lifetimeValue25yNumberWith electricityPrice: value over 25 years.
items[].paybackYearsNumberWith systemCost and electricityPrice: simple payback time in years.
items[].costPerKwpNumberWith systemCost and electricityPrice: cost per installed kWp.
items[].systemCostNumberEcho of systemCost, when sent.
items[].electricityPriceNumberEcho of electricityPrice, when sent.
items[].currencyStringEcho of currency, when sent.
items[].errorStringFailed rows only, for example a location at sea. Yield fields are left out on these rows.
items[].errorTypeStringFailed rows only, for example no-coverage.
items[].sourceStringData credit: PVGIS (c) European Union, JRC. Keep it for attribution.
items[].sourceUrlStringLink to the source calculation.
items[].fetchedAtStringTime of calculation, ISO 8601 UTC.

Notes

  • A request with no locations, an empty list, or more than 50 locations returns 400.
  • Values outside the stated ranges or allowed values return 400 with a message such as Field tilt must be between 0 and 90, got 91.
  • Points at sea or outside PVGIS coverage do not fail the request; they come back as a row with error and errorType: no-coverage.
  • In the southern hemisphere, optimized panels face north (azimuthCompassDeg 0).
  • Errors use one shape: {"code": "invalid_input", "error": "...", "message": "..."}.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.