Skip to content

Solcast API

The Solcast API provides forecast, live and historical solar irradiance, PV power and weather data.

For full details of the API, see the OpenAPI specification

Installation

dotnet add package Solcast

Configuration

Get an API key from the Solcast API Toolkit, then set it:

export SOLCAST_API_KEY=your-api-key

Getting started

This example calls the Sydney Opera House, one of Solcast's unmetered locations, so you can run it as it stands without using your request quota.

using Solcast;

var client = SolcastClientFactory.Create();

var response = await client.Data.Live.RadiationAndWeather.GetAsync(request =>
{
    request.QueryParameters.OutputParameters = ["air_temp", "dni", "ghi"];
    request.QueryParameters.Latitude = -33.856784;
    request.QueryParameters.Longitude = 151.215297;
});

foreach (var record in response!.EstimatedActuals!)
{
    Console.WriteLine($"{record.PeriodEnd}: {record.Ghi}");
}

Endpoint reference