Solar Irradiance API

 This is the latest version of the API (v2).

Looking for the previous version? You can find the v1 documentation here.

Product concept

Solar Irradiance service supplies accurate solar irradiance data for any location on the globe.

Main features of Solar Irradiance API:

You can find the previous documentation v1 here

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

01 icon

Sign up

Sign up to OpenWeather service in case you haven't got your OpenWeather API key yet.

02 icon

Follow the pricing page

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.

03 icon

Make an API call

Just make an API call according to the tech documentation below, remembering to add your key to each call.

Call Solar Irradiance data

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, 15 minutes or 1 day interval solar radiation data for particular geographical location and for specified date.

How to make an API call

https://api.openweathermap.org/energy/2.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: "15m" (15 minutes), "1h" (1 hour) and "1d" (1 day)

If the service detected timezone for your location incorrectly you can specify correct timezone manually by adding tz parameter in the ±XX:XX format to API call.API call

https://api.openweathermap.org/energy/2.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/2.0/solar/interval_data?lat=60.45&lon=-38.67&date=2023-03-30&interval=1h&tz=+03:00&appid={API key}

Please pay attention that in case timezone is specified time of sunset and sunrise will be returned in accordance with this specified timezone.

Example of API call

https://api.openweathermap.org/energy/2.0/solar/interval_data?lat=51.509865&lon=-0.118092&date=2023-10-10&interval=1h&appid={API key}

Example of API response

To view the API response, expand the example by clicking the triangle.

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 : 15m, 1h and 1d.
  • tz Timezone in the ±XX:XX format
  • sunrise 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 response
  • sunset 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 response
  • intervals Interval detalization of daily aggregated irradiation data for the requested date

Bulk downloading

You can get the entire available historical solar irradiance archive in CSV and JSON formats:

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

{
    "code": "400",
    "message": "Invalid date format",
    "parameters": [
        "date"
    ]
}

Fields in error response

  • code Code of error
  • message Description of error
  • parameters(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

    Open FAQ
  • API calls return an error 401

    Open FAQ
  • API calls return an error 404

    Open FAQ
  • API calls return an error 429

    Open FAQ
  • API calls return errors '5xx'

    Open FAQ

Pay as you call

There are no limits on the number of API calls, users pay for a subscription according to the actual use of the product.

... per API call

Any location | No API call limits | Pay-as-you-call

For large-scale projects, we provide a variety of custom packages. Please get in touch with us with your requirements to learn more.