{
"lat":34,
"lon":34,
"date":"2023-03-28",
"tz":"+02:00",
"sunrise":"2023-03-28T05:37:14",
"sunset":"2023-03-28T18:01:37",
"irradiance":{
"daily":[
{
"clear_sky":{
"ghi":6383.04,
"dni":8319.8,
"dhi":1201.07
},
"cloudy_sky":{
"ghi":5836.23,
"dni":6776.87,
"dhi":1584.37
}
}
],
"hourly":[
{
"hour":0,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":1,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":2,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":3,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":4,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":5,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":6,
"clear_sky":{
"ghi":4.25,
"dni":0.73,
"dhi":3.52
},
"cloudy_sky":{
"ghi":3.43,
"dni":0.41,
"dhi":3.02
}
},
{
"hour":7,
"clear_sky":{
"ghi":115.4,
"dni":378.23,
"dhi":48.82
},
"cloudy_sky":{
"ghi":90.79,
"dni":247.14,
"dhi":47.29
}
},
{
"hour":8,
"clear_sky":{
"ghi":319.36,
"dni":610.29,
"dhi":86.67
},
"cloudy_sky":{
"ghi":261.01,
"dni":369.79,
"dhi":120.02
}
},
{
"hour":9,
"clear_sky":{
"ghi":524.55,
"dni":740.47,
"dhi":107.61
},
"cloudy_sky":{
"ghi":398.92,
"dni":360.05,
"dhi":196.18
}
},
{
"hour":10,
"clear_sky":{
"ghi":693.76,
"dni":807.95,
"dhi":121.26
},
"cloudy_sky":{
"ghi":520.28,
"dni":378.22,
"dhi":252.28
}
},
{
"hour":11,
"clear_sky":{
"ghi":813.42,
"dni":847.94,
"dhi":128.46
},
"cloudy_sky":{
"ghi":730.2,
"dni":667.45,
"dhi":191.04
}
},
{
"hour":12,
"clear_sky":{
"ghi":870.88,
"dni":865.74,
"dhi":131.59
},
"cloudy_sky":{
"ghi":829.87,
"dni":787.48,
"dhi":157.4
}
},
{
"hour":13,
"clear_sky":{
"ghi":859.56,
"dni":863.79,
"dhi":130.63
},
"cloudy_sky":{
"ghi":826.31,
"dni":784.68,
"dhi":164.14
}
},
{
"hour":14,
"clear_sky":{
"ghi":780.46,
"dni":842.11,
"dhi":125.07
},
"cloudy_sky":{
"ghi":775.24,
"dni":825.45,
"dhi":132.8
}
},
{
"hour":15,
"clear_sky":{
"ghi":641.16,
"dni":794.85,
"dhi":115.22
},
"cloudy_sky":{
"ghi":639.98,
"dni":789.39,
"dhi":117.65
}
},
{
"hour":16,
"clear_sky":{
"ghi":455.48,
"dni":708.64,
"dhi":99.7
},
"cloudy_sky":{
"ghi":455.36,
"dni":708,
"dhi":99.89
}
},
{
"hour":17,
"clear_sky":{
"ghi":246.01,
"dni":551.11,
"dhi":74.9
},
"cloudy_sky":{
"ghi":246.08,
"dni":550.99,
"dhi":75
}
},
{
"hour":18,
"clear_sky":{
"ghi":58.76,
"dni":307.97,
"dhi":27.63
},
"cloudy_sky":{
"ghi":58.76,
"dni":307.8,
"dhi":27.64
}
},
{
"hour":19,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":20,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":21,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":22,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":23,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
}
]
}
}
Solar Irradiance API
Product concept
OpenWeather are thrilled to announce the launch of our new Solar Irradiance & Energy Prediction service. You will be able to predict the energy generated by a particular solar panel before installation, or check for potential issues with existing panels.
Main features of Solar Irradiance API:
- Essential solar irradiation data:
- All indices are available in Clear Sky and Cloudy Sky models
- Current data and forecast for 15 days ahead
- Historical data is available for 45+ years back (from 1st January 1979)
- Data contains daily aggregation for each requested day with hourly detalization or detalization by specified intervals
- Global coverage
There are two routes to receive solar data:
- Get daily aggregation with hourly detalization of solar irradiance data with Route 1
- Get daily aggregation with detalization by intervals with Route 2
Data is available in JSON format.
The detailed information about what technologies, algorithms, etc. are behind the Solar Irradiance API can be found here.
How to get access
- Sign up to OpenWeather service in case you haven't got your OpenWeather API key yet.
- Just make an API call according to the tech documentation below, remembering to add your key to each call.
Route 1: daily aggregation with hourly detalization
In this section you will find how to request historical starting from 1st January 1979, current or
forecast for 15 days ahead daily aggregated and accumulated hourly detalization solar radiation data
for particular geographical location and for specified date.
If you are interested in daily aggregation with detalization by intervals for solar irradiation data
please use section Route 2: daily aggregation with detalization by intervals.
How to make an API call
API call
https://api.openweathermap.org/energy/1.0/solar/data?lat={lat}&lon={lon}&date={date}&appid={API key}
Parameters | ||
---|---|---|
lat |
required | Latitude, decimal (-90; 90) |
lon |
required | Longitude, decimal (-180; 180) |
date |
required | Date in the `YYYY-MM-DD` format for which data is requested. Date available from 1979-01-01 up to +15 days to the current date |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
tz
parameter in the ±XX:XX format to API call.
API call
https://api.openweathermap.org/energy/1.0/solar/data?lat={lat}&lon={lon}&date={date}&tz={tz}&appid={API key}
Example of API call
https://api.openweathermap.org/energy/1.0/solar/data?lat=60.45&lon=-38.67&date=2023-03-30&tz=+03:00&appid={API key}
Example of API call
https://api.openweathermap.org/energy/1.0/solar/data?lat=34&lon=34&date=2023-03-28&appid={API key}
Example of API response
Example of API response
Fields in API response
lat
Latitude of the location,decimal (-90; 90)lon
Longitude of the location,decimal (-180; 180)date
Date specified in the API request in the `YYYY-MM-DD` format (from 1979-01-01 up to +15 days to the current date)tz
Timezone in the ±XX:XX formatsunrise
Date and time of sunrise based on date specified in the API request and timezone authomatically determinated by on latitude and longitute of requested location. If you added timezone parameter into API request, then time of sunrise will be recalculated in accordance with this timezone. For polar areas in midnight sun and polar night periods this parameter is not returned in the responsesunset
Date and time of sunset based on date specified in the API request and timezone authomatically determinated by on latitude and longitute of requested location. If you added timezone parameter into API request, then time of sunset will be recalculated in accordance with this timezone. For polar areas in midnight sun and polar night periods this parameter is not returned in the responseirradiance
Irradiance related informationdaily
Daily aggregated irradiation data for the requested dateclear sky
clear sky modelghi
Clear sky GHI - Global Horizontal Irradiation, Wh/m2dni
Clear sky DNI - Direct Normal Irradiation, Wh/m2dhi
Clear sky DHI - Diffuse Horizontal Irradiation, Wh/m2
cloud sky
cloudy sky modelghi
Cloudy sky GHI - Global Horizontal Irradiation, Wh/m2dni
Cloudy sky DNI - Direct Normal Irradiation, Wh/m2dhi
Cloudy sky DHI - Diffuse Horizontal Irradiation, Wh/m2
-
hourly
Hourly detalization of daily aggregated irradiation data for the requested datehour
the number of hour for the requested dayclear sky
clear sky modelghi
Clear sky GHI - Global Horizontal Irradiation, Wh/m2dni
Clear sky DNI - Direct Normal Irradiation, Wh/m2dhi
Clear sky DHI - Diffuse Horizontal Irradiation, Wh/m2
cloudy sky
cloudy sky modelghi
Cloudy sky GHI - Global Horizontal Irradiation, Wh/m2dni
Cloudy sky DNI - Direct Normal Irradiation, Wh/m2dhi
Cloudy sky DHI - Diffuse Horizontal Irradiation, Wh/m2
Route 2: daily aggregation with detalization by intervals
In this section you will find how to request historical starting from 1st January 1979, current or
forecast for 15 days ahead daily aggregated and accumulated over 1 hour or 15 minutes interval
solar radiation data for particular geographical location and for specified date.
If you are interested in daily aggregation with hourly detalization for solar irradiation data
please use section Route 1: daily aggregation with hourly detalization.
How to make an API call
API call
https://api.openweathermap.org/energy/1.0/solar/interval_data?lat={lat}&lon={lon}&date={date}&interval={interval}&appid={API key}
Parameters | ||
---|---|---|
lat |
required | Latitude, decimal (−90; 90) |
lon |
required | Longitude, decimal (−180; 180) |
date |
required | Date in the `YYYY-MM-DD` format for which data is requested. Date available from 1979-01-01 up to +15 days to the current date |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
interval |
optional | The time interval during which the energy is summed up, defines the temporary resolution of solar radiation data. If not specified, the default interval of "1h" (1 hour) will be used. Available values for this parameter include: "1h" (1 hour) and "15m" (15 minutes) |
tz
parameter in the ±XX:XX format to API call.
API call
https://api.openweathermap.org/energy/1.0/solar/interval_data?lat={lat}&lon={lon}&date={date}&interval={interval}&tz={tz}&appid={API key}
Example of API call
https://api.openweathermap.org/energy/1.0/solar/interval_data?lat=60.45&lon=-38.67&date=2023-03-30&interval=1h&tz=+03:00&appid={API key}
Example of API call
Call accumulated over 1 hour interval solar radiation data for particular geographical location and for specified date.https://api.openweathermap.org/energy/1.0/solar/interval_data?lat=51.509865&lon=-0.118092&date=2023-10-10&interval=1h&appid={API key}
Example of API response
Example of API response
{
"lat":51.509865,
"lon":-0.118092,
"date":"2023-10-10",
"interval":"1h",
"tz":"+01:00",
"sunrise":"2023-10-10T07:15:03",
"sunset":"2023-10-10T18:19:05",
"irradiance":{
"daily":[
{
"clear_sky":{
"ghi":3341.99,
"dni":6736.42,
"dhi":796.63
},
"cloudy_sky":{
"ghi":1321.03,
"dni":189.2,
"dhi":1224.62
}
}
],
"intervals":[
{
"start":"00:00",
"end":"01:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"01:00",
"end":"02:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"02:00",
"end":"03:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"03:00",
"end":"04:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"04:00",
"end":"05:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"05:00",
"end":"06:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"06:00",
"end":"07:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"07:00",
"end":"08:00",
"clear_sky":{
"ghi":17.5,
"dni":114.15,
"dhi":15.71
},
"cloudy_sky":{
"ghi":4.52,
"dni":0,
"dhi":4.52
}
},
{
"start":"08:00",
"end":"09:00",
"clear_sky":{
"ghi":131.24,
"dni":474.04,
"dhi":53.2
},
"cloudy_sky":{
"ghi":32.81,
"dni":0,
"dhi":32.81
}
},
{
"start":"09:00",
"end":"10:00",
"clear_sky":{
"ghi":268.29,
"dni":644.2,
"dhi":73.73
},
"cloudy_sky":{
"ghi":69.88,
"dni":0,
"dhi":69.88
}
},
{
"start":"10:00",
"end":"11:00",
"clear_sky":{
"ghi":386.42,
"dni":731.64,
"dhi":86.27
},
"cloudy_sky":{
"ghi":145.02,
"dni":9.14,
"dhi":140.94
}
},
{
"start":"11:00",
"end":"12:00",
"clear_sky":{
"ghi":469.28,
"dni":777.74,
"dhi":93.58
},
"cloudy_sky":{
"ghi":248.06,
"dni":65.63,
"dhi":215.63
}
},
{
"start":"12:00",
"end":"13:00",
"clear_sky":{
"ghi":507.51,
"dni":796.21,
"dhi":96.65
},
"cloudy_sky":{
"ghi":276.15,
"dni":79.43,
"dhi":234.49
}
},
{
"start":"13:00",
"end":"14:00",
"clear_sky":{
"ghi":497.05,
"dni":791.36,
"dhi":95.81
},
"cloudy_sky":{
"ghi":228.56,
"dni":34.99,
"dhi":210.34
}
},
{
"start":"14:00",
"end":"15:00",
"clear_sky":{
"ghi":439.01,
"dni":762.13,
"dhi":90.99
},
"cloudy_sky":{
"ghi":138.36,
"dni":0,
"dhi":138.36
}
},
{
"start":"15:00",
"end":"16:00",
"clear_sky":{
"ghi":339.55,
"dni":700.92,
"dhi":81.62
},
"cloudy_sky":{
"ghi":98.9,
"dni":0,
"dhi":98.9
}
},
{
"start":"16:00",
"end":"17:00",
"clear_sky":{
"ghi":210.63,
"dni":586.34,
"dhi":66.18
},
"cloudy_sky":{
"ghi":57.97,
"dni":0,
"dhi":57.97
}
},
{
"start":"17:00",
"end":"18:00",
"clear_sky":{
"ghi":74.12,
"dni":344.83,
"dhi":39.94
},
"cloudy_sky":{
"ghi":20.4,
"dni":0,
"dhi":20.4
}
},
{
"start":"18:00",
"end":"19:00",
"clear_sky":{
"ghi":1.38,
"dni":12.85,
"dhi":2.94
},
"cloudy_sky":{
"ghi":0.38,
"dni":0,
"dhi":0.38
}
},
{
"start":"19:00",
"end":"20:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"20:00",
"end":"21:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"21:00",
"end":"22:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"22:00",
"end":"23:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"start":"23:00",
"end":"00:00",
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
}
]
}
}
Fields in API response
lat
Latitude of the location,decimal (-90; 90)lon
Longitude of the location,decimal (-180; 180)date
Date specified in the API request in the `YYYY-MM-DD` format (from 1979-01-01 up to +15 days to the current date)interval
Time interval during which the energy is summed up. Determines temporary resolution of solar radiation data. If not specified "1h" interval will be used. Available values : 1h, 15mtz
Timezone in the ±XX:XX formatsunrise
Date and time of sunrise based on date specified in the API request and timezone authomatically determinated by on latitude and longitute of requested location. If you added timezone parameter into API request, then time of sunrise will be recalculated in accordance with this timezone. For polar areas in midnight sun and polar night periods this parameter is not returned in the responsesunset
Date and time of sunset based on date specified in the API request and timezone authomatically determinated by on latitude and longitute of requested location. If you added timezone parameter into API request, then time of sunset will be recalculated in accordance with this timezone. For polar areas in midnight sun and polar night periods this parameter is not returned in the responseirradiance
Irradiance related informationdaily
Daily aggregated irradiation data for the requested dateclear sky
clear sky modelghi
Clear sky GHI - Global Horizontal Irradiation, Wh/m2dni
Clear sky DNI - Direct Normal Irradiation, Wh/m2dhi
Clear sky DHI - Diffuse Horizontal Irradiation, Wh/m2
cloud sky
cloudy sky modelghi
Cloudy sky GHI - Global Horizontal Irradiation, Wh/m2dni
Cloudy sky DNI - Direct Normal Irradiation, Wh/m2dhi
Cloudy sky DHI - Diffuse Horizontal Irradiation, Wh/m2
-
interval
Interval detalization of daily aggregated irradiation data for the requested datestart
Start of the time interval for which the energy is summed up. Time interval displays hour and minutes of the day for which indexes were aggregated in "hh:mm" formatend
End of the time interval for which the energy is summed up. Time interval displays hour and minutes of the day for which indexes were aggregated in "hh:mm" formatclear sky
clear sky modelghi
Clear sky GHI - Global Horizontal Irradiation, Wh/m2rdni
Clear sky DNI - Direct Normal Irradiation, Wh/m2dhi
Clear sky DHI - Diffuse Horizontal Irradiation, Wh/m2
cloudy sky
cloudy sky modelghi
Cloudy sky GHI - Global Horizontal Irradiation, Wh/m2dni
Cloudy sky DNI - Direct Normal Irradiation, Wh/m2dhi
Cloudy sky DHI - Diffuse Horizontal Irradiance, Wh/m2
Bulk downloading
You can get the entire available historical solar irradiance archive in CSV and JSON formats:
- Solar Irradiance History Bulk - archive for 45+ years with 15-minutes and 1-hour steps, available from January 1979.
- Solar Irradiance History Forecast Bulk - archive of previously made 16 days ahead forecasts on solar irradiance data with 1-hour step (15-minutes step by request), available from April, 2017.
You can find prices on the corresponding page.
API errors
Structure of API errors
In case of incorrected API call you will receive API error response. Error response payload returned for all types of errors with the structure below.
Example of error response
Example of error response
{
"code": "400",
"message": "Invalid date format",
"parameters": [
"date"
]
}
Fields in error response
code
Code of errormessage
Description of errorparameters
(optional) List of request parameters names that are related to this particular error
Errors list
Please find more detailed information about some popular errors below.
API calls return an error 400
Error 400 - Bad Request. You can get error 400 error if either some mandatory parameters in the request are missing or some of request parameters have incorrect format or values out of allowed range. List of all parameters names that are missing or incorrect will be returned in `parameters`attribute of the `ErrorResponse` object.
API calls return an error 401
Error 401 - Unauthorized. You can get 401 error if API token did not providen in the request or in case API token provided in the request does not grant access to this API. You must add API token with granted access to the product to the request before returing it.
API calls return an error 404
Error 404 - Not Found. You can get 404 error if data with requested parameters (`lat`, `lon` and `date`) does not exist in service database. You must not retry the same request.
API calls return an error 429
Error 429 - Too Many Requests. You can get 429 error if key quata of requests for provided API to this API was exceeded. You may retry request after some time or after extending your key quota.
API calls return errors '5xx'
Errors 5xx - Unexpected Error. You can get '5xx' error in case of other internal errors. Error Response code will be `5xx`. Please contact us and enclose an example of your API request that receives this error into your email to let us analyze it and find a solution for you promptly. You may retry the request which led to this error.