Python SDK

The solcast package on PyPI wraps this REST API with Python modules for live, forecast, historic, TMY, aggregations, and PV power site management. Supported endpoint pages include an Py SDK tab with ready-to-use examples (19 endpoints).

Install

Install from PyPI with pip install solcast. Pandas is optional but enables .to_pandas() on timeseries responses. For optional notebook dependencies, use solcast[all].

Authentication

You need a Solcast API key. Register at the Solcast Toolkit. The recommended approach is to set the SOLCAST_API_KEY environment variable — the SDK reads it automatically. See also Authentication.

Working with responses

All SDK methods return a response object. Use .to_dict() for a plain Python dictionary. When pandas is installed, timeseries endpoints support .to_pandas() to load results into a DataFrame indexed by period_end.

Unmetered locations

When testing or evaluating the API, use coordinates from unmetered locations via solcast.unmetered_locations.UNMETERED_LOCATIONS so requests do not count against your plan quota. You still need a valid API key.

Additional resources

Full package documentation, including example notebooks, is published separately at the Python SDK docs.

Modules

Import a module from the top-level solcast package and call the method that matches the REST endpoint you need. Parameter names mirror the API query parameters documented on each endpoint page.

solcast.live

Near real-time estimated actuals for the past 7 days. Data is derived from satellite imagery (clouds and irradiance over non-polar continental areas) and numerical weather models.

MethodSummaryAPI reference
radiation_and_weatherLive irradiance and weather estimated actuals.
rooftop_pv_powerLive rooftop PV power estimated actuals.
advanced_pv_powerLive advanced PV power estimated actuals for a registered site.

solcast.forecast

Irradiance, weather, and power forecasts from the present time up to 14 days ahead. Combines satellite nowcasting (roughly four hours ahead) with numerical weather model data for longer horizons.

MethodSummaryAPI reference
radiation_and_weatherForecast irradiance and weather.
rooftop_pv_powerForecast rooftop PV power output.
advanced_pv_powerForecast advanced PV power for a registered site.

solcast.historic

Historical irradiance, weather, and power data from 2007 to 7 days ago. Use start with duration or start with end to define the time window.

MethodSummaryAPI reference
radiation_and_weatherHistoric irradiance and weather.
rooftop_pv_powerHistoric rooftop PV power.
advanced_pv_powerHistoric advanced PV power for a registered site.

solcast.tmy

Typical Meteorological Year (TMY) data — a one-year collation selected so that annual averages are consistent with long-term climatology for the requested location.

MethodSummaryAPI reference
radiation_and_weatherTMY irradiance and weather.
rooftop_pv_powerTMY rooftop PV power.

solcast.aggregations

Grid aggregation live and forecast PV power output for configured collection and aggregation identifiers.

MethodSummaryAPI reference
liveLive grid aggregation data.
forecastForecast grid aggregation data.

solcast.pv_power_sites

Create, read, update, and delete advanced PV power site resources. Site metadata is used by advanced_pv_power methods across live, forecast, and historic modules.

MethodSummaryAPI reference
list_pv_power_sitesList available PV power sites.
get_pv_power_siteGet an existing site by resource ID.
create_pv_power_siteCreate a new advanced PV power site.
patch_pv_power_sitePartially update a site.
update_pv_power_siteReplace a site definition.
delete_pv_power_siteDelete a site.

Endpoints not covered by the SDK — including soiling, geographic, wind power, site measurements, manage schedules, and historic forecast — are available via the REST API only. Use the cURL or Python request examples on those endpoint pages.

Examples

Install, authenticate, and call the API

Install
pip install solcast

# Optional: pandas for .to_pandas()
pip install solcast pandas

# Optional: notebooks and extra tooling
pip install solcast[all]
All optional extras
pip install solcast[all]
API key
# Recommended: set SOLCAST_API_KEY in your environment
export SOLCAST_API_KEY="your-api-key"
Live radiation & weather
from solcast import live

res = live.radiation_and_weather(
    latitude=-33.8567,
    longitude=151.2152,
    output_parameters=["air_temp", "ghi"],
)

data = res.to_dict()
# df = res.to_pandas()  # requires pandas
Response helpers
data = res.to_dict()

# Timeseries as a DataFrame (requires pandas)
df = res.to_pandas()
Unmetered location
from solcast import forecast
from solcast.unmetered_locations import UNMETERED_LOCATIONS

sydney = UNMETERED_LOCATIONS["Sydney Opera House"]

res = forecast.rooftop_pv_power(
    latitude=sydney["latitude"],
    longitude=sydney["longitude"],
    period="PT5M",
    capacity=5,
    tilt=22,
    output_parameters="pv_power_rooftop",
)
solcast.live
from solcast import live

res = live.radiation_and_weather(
    latitude=-33.8567,
    longitude=151.2152,
    output_parameters="dni,ghi",
)

df = res.to_pandas()  # requires pandas
solcast.forecast
from solcast import forecast

res = forecast.radiation_and_weather(
    latitude=-33.8567,
    longitude=151.2152,
    output_parameters="air_temp",
)

res.to_pandas().head()
solcast.historic
from solcast import historic

res = historic.radiation_and_weather(
    latitude=-33.8567,
    longitude=151.2152,
    start="2022-06-01T06:00",
    duration="P1D",
)

res.to_pandas().head()
solcast.tmy
from solcast import tmy

res = tmy.rooftop_pv_power(
    latitude=-33.8567,
    longitude=151.2152,
    capacity=3,
)

res.to_pandas().head()
solcast.aggregations
from solcast import aggregations

res = aggregations.forecast(
    collection_id="country_total",
    aggregation_id="it_total",
    output_parameters=["percentage", "pv_estimate"],
)

res.to_pandas().head()
solcast.pv_power_sites
from solcast import pv_power_sites

# List sites to find a resource_id, then fetch metadata
res = pv_power_sites.get_pv_power_site("ba75-e17a-7374-95ed")

res.to_dict()