Solcast 3.0.1

dotnet add package Solcast --version 3.0.1
                    
NuGet\Install-Package Solcast -Version 3.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Solcast" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Solcast" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Solcast" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Solcast --version 3.0.1
                    
#r "nuget: Solcast, 3.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Solcast@3.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Solcast&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Solcast&version=3.0.1
                    
Install as a Cake Tool

Solcast API C# SDK alternate text is missing from this package README image

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

Features

  • Retrieve live and forecast solar radiation and weather data
  • Get live and forecast grid aggregation data
  • Support for all Solcast Commercial products
  • Manage PV Power Sites for advanced solar power modeling
  • Simple, easy-to-use client classes for API interaction

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 all examples 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}");
}

Every field is typed and documents its own meaning and units, so record.Ghi explains itself in IntelliSense. Fields you did not request are null.

Errors

Every failure throws a ResponseStatus carrying the error code and the fields at fault.

using Solcast.Models;

try
{
    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;
});
}
catch (ResponseStatus error)
{
    Console.Error.WriteLine($"{error.ResponseStatusCode} {error.ErrorCode}: {error.Message}");
    foreach (var field in error.Errors ?? [])
    {
        Console.Error.WriteLine($"  {field.FieldName}: {field.Message}");
    }
}

CSV

CsvWriter turns records into CSV. It is a plain utility over the data and knows nothing about the client, so it works with any response.

using Solcast.Utilities;

File.WriteAllText("live.csv", CsvWriter.ToCsv(response!.EstimatedActuals!));

Endpoint reference

Full documentation for every endpoint: https://solcast.github.io/solcast-api-csharp-sdk/

  • Forecast
  • Geographic
  • Grid Aggregations
  • Historic
  • Live
  • Resources
  • Schedule
  • TMY

The client is generated with Kiota

License

Apache 2.0. See the LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.1 74 9/8/2026
3.0.0 92 9/7/2026
2.0.0 861 7/22/2025
1.0.2 295 11/22/2024
1.0.1 157 11/14/2024
1.0.0 185 11/14/2024
1.0.0-beta3 137 11/14/2024
1.0.0-beta2 149 11/14/2024
1.0.0-alpha1 149 11/13/2024
0.1.3 171 10/24/2024
0.1.2 170 10/24/2024
0.1.2-alpha1 143 10/24/2024