{
"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":6694.67,
"dni":9166.93,
"dhi":1140.04
},
"cloudy_sky":{
"ghi":6694.67,
"dni":8962.1,
"dhi":1120.64
}
}
],
"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":128.2,
"dni":477.91,
"dhi":53.3
},
"cloudy_sky":{
"ghi":128.2,
"dni":460.36,
"dhi":47.17
}
},
{
"hour":4,
"clear_sky":{
"ghi":344.02,
"dni":705.53,
"dhi":82.21
},
"cloudy_sky":{
"ghi":344.02,
"dni":709.46,
"dhi":73.51
}
},
{
"hour":5,
"clear_sky":{
"ghi":553.18,
"dni":816.73,
"dhi":100.14
},
"cloudy_sky":{
"ghi":553.18,
"dni":801.59,
"dhi":101.82
}
},
{
"hour":6,
"clear_sky":{
"ghi":727.62,
"dni":879.35,
"dhi":111.8
},
"cloudy_sky":{
"ghi":727.62,
"dni":864.5,
"dhi":115.05
}
},
{
"hour":7,
"clear_sky":{
"ghi":849.19,
"dni":913.88,
"dhi":118.8
},
"cloudy_sky":{
"ghi":849.19,
"dni":906.71,
"dhi":116.74
}
},
{
"hour":8,
"clear_sky":{
"ghi":906.35,
"dni":928.27,
"dhi":121.84
},
"cloudy_sky":{
"ghi":906.35,
"dni":909.35,
"dhi":129.82
}
},
{
"hour":9,
"clear_sky":{
"ghi":893.86,
"dni":925.25,
"dhi":121.17
},
"cloudy_sky":{
"ghi":893.86,
"dni":908.83,
"dhi":126.93
}
},
{
"hour":10,
"clear_sky":{
"ghi":812.89,
"dni":904.28,
"dhi":116.75
},
"cloudy_sky":{
"ghi":812.89,
"dni":903.82,
"dhi":109.46
}
},
{
"hour":11,
"clear_sky":{
"ghi":670.94,
"dni":861.15,
"dhi":108.19
},
"cloudy_sky":{
"ghi":670.94,
"dni":855.43,
"dhi":104.91
}
},
{
"hour":12,
"clear_sky":{
"ghi":481.8,
"dni":784.81,
"dhi":94.59
},
"cloudy_sky":{
"ghi":481.8,
"dni":778.52,
"dhi":90.92
}
},
{
"hour":13,
"clear_sky":{
"ghi":266.39,
"dni":645.45,
"dhi":73.66
},
"cloudy_sky":{
"ghi":266.39,
"dni":644.9,
"dhi":66.16
}
},
{
"hour":14,
"clear_sky":{
"ghi":60.24,
"dni":324.33,
"dhi":37.59
},
"cloudy_sky":{
"ghi":60.24,
"dni":218.62,
"dhi":38.14
}
},
{
"hour":15,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":16,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":17,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"hour":18,
"clear_sky":{
"ghi":0,
"dni":0,
"dhi":0
},
"cloudy_sky":{
"ghi":0,
"dni":0,
"dhi":0
}
},
{
"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 irradiance 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 more than 40 years back (from 1st January 1979)
- Data contains daily aggregation for each requested day with hourly detalization
- Global coverage
Data is available in JSON format.
The detailed information about what technologies, algorithms, etc. are behind the Solar Irradiance API can be founded here.
How to get access
- Sign up to OpenWeather service in case you haven't got your OpenWeather API key yet.
- Follow the pricing page to learn details about the price.
Solar Irradiance API is included in the separate subscription only and allows you to pay only for the number of API calls made to this product. Please find more details on the pricing page.
- Just make an API call according to the tech documentation below, remembering to add your key to each call.
Call Solar Irradiance API
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 irradiance data for the requested dateclear sky
clear sky modelradiation.ghi_cs
Clear sky GHI - Global Horizontal Irradiance, W/m2radiation.dni_cs
Clear sky DNI - Direct Normal Irradiance, W/m2radiation.dhi_cs
Clear sky DHI - Diffuse Horizontal Irradiance, W/m2cloud sky
cloudy sky modelradiation.ghi
Cloudy sky GHI - Global Horizontal Irradiance, W/m2radiation.dni
Cloudy sky DNI - Direct Normal Irradiance, W/m2radiation.dhi
Cloudy sky DHI - Diffuse Horizontal Irradiance, W/m2-
hourly
Hourly detalization of daily aggregated irradiance data for the requested datehour
the number of hour for the requested dayclear sky
clear sky modelradiation.ghi_cs
Clear sky GHI - Global Horizontal Irradiance, W/m2radiation.dni_cs
Clear sky DNI - Direct Normal Irradiance, W/m2radiation.dhi_cs
Clear sky DHI - Diffuse Horizontal Irradiance, W/m2cloudy sky
cloudy sky modelradiation.ghi
Cloudy sky GHI - Global Horizontal Irradiance, W/m2radiation.dni
Cloudy sky DNI - Direct Normal Irradiance, W/m2radiation.dhi
Cloudy sky DHI - Diffuse Horizontal Irradiance, W/m2
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 missong 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 theistory Daily Aggregation API 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 quato 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.