pvlib.iotools.get_solaranywhere(latitude, longitude, api_key, start=None, end=None, source='SolarAnywhereLatest', time_resolution=60, spatial_resolution=0.01, true_dynamics=False, probability_of_exceedance=None, variables=['StartTime', 'ObservationTime', 'EndTime', 'GlobalHorizontalIrradiance_WattsPerMeterSquared', 'DirectNormalIrradiance_WattsPerMeterSquared', 'DiffuseHorizontalIrradiance_WattsPerMeterSquared', 'AmbientTemperature_DegreesC', 'WindSpeed_MetersPerSecond', 'Albedo_Unitless', 'DataVersion'], missing_data='FillAverage', url='https://service.solaranywhere.com/api/v2', map_variables=True, timeout=300)[source]#

Retrieve historical irradiance time series data from SolarAnywhere.

The SolarAnywhere API is described in 1 and 2. A detailed list of API options can be found in 3.

  • latitude (float) – In decimal degrees, north is positive (ISO 19115).

  • longitude (float) – In decimal degrees, east is positive (ISO 19115).

  • api_key (str) – SolarAnywhere API key.

  • start (datetime like, optional) – First timestamp of the requested period. If a timezone is not specified, UTC is assumed. Not applicable for TMY data.

  • end (datetime like, optional) – Last timestamp of the requested period. If a timezone is not specified, UTC is assumed. Not applicable for TMY data.

  • source (str, default: 'SolarAnywhereLatest') – Data source. Options include: ‘SolarAnywhereLatest’ (historical data), ‘SolarAnywhereTGYLatest’ (TMY for GHI), ‘SolarAnywhereTDYLatest’ (TMY for DNI), or ‘SolarAnywherePOELatest’ for probability of exceedance. Specific dataset versions can also be specified, e.g., ‘SolarAnywhere3_2’ (see 3 for a full list of options).

  • time_resolution ({60, 30, 15, 5}, default: 60) – Time resolution in minutes. For TMY data, time resolution has to be 60 minutes (hourly).

  • spatial_resolution ({0.1, 0.01, 0.005}, default: 0.01) – Spatial resolution in degrees.

  • true_dynamics (bool, default: False) – Whether to apply SolarAnywhere TrueDynamics statistical processing. Only available for the 5-minute time resolution.

  • probability_of_exceedance (int, optional) – Probability of exceedance in the range of 1 to 99. Only relevant when requesting probability of exceedance (POE) time series. [%]

  • variables (list-like, default: DEFAULT_VARIABLES) – Variables to retrieve (described in 4), must include ‘ObservationTime’. Available variables depend on whether historical or TMY data is requested.

  • missing_data ({'Omit', 'FillAverage'}, default: 'FillAverage') – Method for treating missing data.

  • url (str, default: pvlib.iotools.solaranywhere.URL) – Base url of SolarAnywhere API.

  • map_variables (bool, default: True) – When true, renames columns of the DataFrame to pvlib variable names where applicable. See VARIABLE_MAP.

  • timeout (float, default: 300) – Time in seconds to wait for requested data to become available.


  • data (pandas.DataFrame) – Timeseries data from SolarAnywhere. The index is the observation time (middle of period).

  • metadata (dict) – Metadata available (includes site latitude, longitude, and altitude).


SolarAnywhere data requests are asynchronous, and it might take several minutes for the requested data to become available.


>>> # Retrieve one month of SolarAnywhere data for Atlanta, GA
>>> data, meta = pvlib.iotools.get_solaranywhere(
...     latitude=33.765, longitude=-84.395, api_key='redacted',
...     start=pd.Timestamp(2020,1,1), end=pd.Timestamp(2020,2,1))  



SolarAnywhere API


SolarAnywhere irradiance and weather API requests


SolarAnywhere API options


SolarAnywhere variable definitions