Solar Energy API method returns an energy forecast for a solar PV (photovoltaic) system at a given location, in json or xml. You tell us the size of the system and how the panels are mounted, and we return how much power and energy it is expected to produce for each hour and each day, for up to 14 days ahead.
The forecast uses our solar irradiance (GHI, DNI and DHI), air temperature and wind speed forecast. It works out the sun position, the sunlight reaching the panels, the cell temperature, system losses and inverter efficiency and clipping. Data is hourly for the first 5 days and 3 hourly after that.
Available on Business plan and above. Keys on other plans receive error code 2009.
Example request
https://api.weatherapi.com/v1/solar.json?key=<YOUR_API_KEY>&q=51.52,-0.11&days=3&capacity_kw=4&tilt=35&azimuth=180
Request parameters
| Parameter |
Required |
Description |
| key |
Yes |
Your API key. |
| q |
Yes |
Location. Same formats as other APIs (city, lat,lon, postcode, etc.). Lat,lon is recommended for solar sites. |
| days |
No |
Number of forecast days, 1 to 14. Default 1. |
| capacity_kw |
Yes |
Array (DC) size in kWp. Must be greater than 0. e.g. capacity_kw=4 |
| tilt |
No |
Panel tilt in degrees from horizontal, 0 to 90. Default: absolute latitude of the location. |
| azimuth |
No |
Direction the panels face in degrees clockwise from north, 0 to 360 (180 = south). Default: 180 in the northern hemisphere, 0 in the southern hemisphere. |
| tracking |
No |
fixed, single_axis or dual_axis. Default: fixed. With tracking, tilt and azimuth are set by the tracker. |
| module_type |
No |
standard, premium or thin_film. Sets the temperature coefficient. Default: standard. |
| losses |
No |
System losses in % (wiring, soiling, mismatch, etc.), 0 to 99. Default: 14. |
| inverter_kw |
No |
Inverter AC rating in kW. Output above this is clipped. Default: capacity_kw / 1.2. |
| inverter_eff |
No |
Inverter efficiency in %, 1 to 100. Default: 96. |
| albedo |
No |
Ground reflectance, 0 to 1. Default: 0.2 (grass). Use about 0.8 for fresh snow. |
The response contains the Location object, a system object and a forecast object.
system: the settings used for the calculation, including any defaults that were applied.
forecast -> forecastday: Parent element, one per day
forecastday -> day: daily totals
forecastday -> hour: one element per forecast period
system element
| Field |
Data Type |
Description |
| capacity_kw |
decimal |
Array size in kWp, as requested |
| tilt |
decimal |
Panel tilt used in degrees |
| azimuth |
decimal |
Panel azimuth used in degrees (180 = south) |
| tracking |
string |
fixed, single_axis or dual_axis |
| module_type |
string |
standard, premium or thin_film |
| temp_coefficient |
decimal |
Power temperature coefficient used in %/°C |
| losses |
decimal |
System losses used in % |
| inverter_kw |
decimal |
Inverter AC rating used in kW |
| inverter_eff |
decimal |
Inverter efficiency used in % |
| albedo |
decimal |
Ground reflectance used |
forecastday
| Field |
Data Type |
Description |
| date |
string |
Forecast date |
| date_epoch |
int |
Forecast date as unix time |
day element
| Field |
Data Type |
Description |
| energy_kwh |
decimal |
Total AC energy for the day in kWh |
| energy_dc_kwh |
decimal |
Total DC energy for the day in kWh (before inverter) |
| peak_power_kw |
decimal |
Highest AC power in the day in kW |
| peak_sun_hours |
decimal |
Equivalent hours of full sun on the panels (plane-of-array kWh/m²) |
| performance_ratio |
decimal |
AC energy as % of what the array would make at its rated output for the sunlight received |
| ghi_kwh_m2 |
decimal |
Global horizontal irradiation for the day in kWh/m² |
| poa_kwh_m2 |
decimal |
Irradiation on the panel plane for the day in kWh/m² |
hour element
| Field |
Data Type |
Description |
| time_epoch |
int |
End of the period as unix time (UTC) |
| time |
string |
End of the period in local time (yyyy-MM-dd HH:mm) |
| period_hours |
decimal |
Length of the period in hours: 1 for the first 5 days, 3 after that. Energy values cover the whole period. |
| ghi |
decimal |
Global horizontal irradiance W/m² |
| dni |
decimal |
Direct normal irradiance W/m² |
| dhi |
decimal |
Diffuse horizontal irradiance W/m² |
| poa_global |
decimal |
Total irradiance on the panel plane W/m² |
| poa_direct |
decimal |
Direct (beam) irradiance on the panel plane W/m² |
| poa_diffuse |
decimal |
Sky diffuse irradiance on the panel plane W/m² |
| poa_ground |
decimal |
Ground-reflected irradiance on the panel plane W/m² |
| sun_elevation |
decimal |
Sun elevation above the horizon in degrees (middle of the period) |
| sun_azimuth |
decimal |
Sun azimuth in degrees clockwise from north (middle of the period) |
| angle_of_incidence |
decimal |
Angle between the sun and the panel normal in degrees |
| temp_c |
decimal |
Air temperature in °C |
| wind_kph |
decimal |
Wind speed in kph |
| cell_temp_c |
decimal |
Estimated solar cell temperature in °C |
| power_dc_kw |
decimal |
Average DC power in kW |
| power_ac_kw |
decimal |
Average AC power in kW (after inverter, clipped to inverter_kw) |
| energy_kwh |
decimal |
AC energy for the period in kWh |
| clipped_kwh |
decimal |
Energy lost to inverter clipping in kWh |
| snow_cover |
int |
1 = Yes 0 = No Panels likely covered by snow (output set to 0) |
Example response (shortened to two hours)
{
"location": {
"name": "London",
"region": "City of London, Greater London",
"country": "United Kingdom",
"lat": 51.52,
"lon": -0.11,
"tz_id": "Europe/London",
"localtime_epoch": 1791021600,
"localtime": "2026-10-03 11:00"
},
"system": {
"capacity_kw": 4.0,
"tilt": 35.0,
"azimuth": 180.0,
"tracking": "fixed",
"module_type": "standard",
"temp_coefficient": -0.37,
"losses": 14.0,
"inverter_kw": 3.333,
"inverter_eff": 96.0,
"albedo": 0.2
},
"forecast": {
"forecastday": [
{
"date": "2026-10-03",
"date_epoch": 1790985600,
"day": {
"energy_kwh": 20.541,
"energy_dc_kwh": 21.39,
"peak_power_kw": 2.9,
"peak_sun_hours": 6.43,
"performance_ratio": 79.9,
"ghi_kwh_m2": 3.872,
"poa_kwh_m2": 6.43
},
"hour": [
{
"time_epoch": 1791025200,
"time": "2026-10-03 12:00",
"period_hours": 1.0,
"ghi": 520.96,
"dni": 808.31,
"dhi": 93.77,
"poa_global": 847.28,
"poa_direct": 710.7,
"poa_diffuse": 127.16,
"poa_ground": 9.42,
"sun_elevation": 31.9,
"sun_azimuth": 156.44,
"angle_of_incidence": 28.45,
"temp_c": 13.2,
"wind_kph": 10.8,
"cell_temp_c": 31.78,
"power_dc_kw": 2.8374,
"power_ac_kw": 2.7285,
"energy_kwh": 2.7285,
"clipped_kwh": 0.0,
"snow_cover": 0
},
{
"time_epoch": 1791028800,
"time": "2026-10-03 13:00",
"period_hours": 1.0,
"ghi": 558.71,
"dni": 813.67,
"dhi": 100.57,
"poa_global": 905.28,
"poa_direct": 758.94,
"poa_diffuse": 136.24,
"poa_ground": 10.1,
"sun_elevation": 34.27,
"sun_azimuth": 174.1,
"angle_of_incidence": 21.14,
"temp_c": 13.4,
"wind_kph": 10.8,
"cell_temp_c": 33.27,
"power_dc_kw": 3.0174,
"power_ac_kw": 2.9004,
"energy_kwh": 2.9004,
"clipped_kwh": 0.0,
"snow_cover": 0
}
]
}
]
}
}
Accuracy
- The irradiance comes from a global weather model (about 13 km grid). It is good for daily and hourly planning but it is not a replacement for on-site measurement.
- Under broken cloud the model can over-estimate sunlight, so hourly output on those days may be on the high side.
- Beyond 5 days the values are 3 hourly averages, so the hourly shape of the day is smoother.
- Use period_hours when adding up values: energy_kwh already covers the full period.