Solcast 0.1.3
See the version list below for details.
dotnet add package Solcast --version 0.1.3
NuGet\Install-Package Solcast -Version 0.1.3
<PackageReference Include="Solcast" Version="0.1.3" />
<PackageVersion Include="Solcast" Version="0.1.3" />
<PackageReference Include="Solcast" />
paket add Solcast --version 0.1.3
#r "nuget: Solcast, 0.1.3"
#:package Solcast@0.1.3
#addin nuget:?package=Solcast&version=0.1.3
#tool nuget:?package=Solcast&version=0.1.3
Solcast API C# SDK 
A C# SDK to access the Solcast API, allowing you to retrieve solar radiation, weather data, and forecasts from satellite and numerical models.
Features
- Retrieve live solar radiation and weather data.
- Access forecast data up to 14 days in advance.
- Access Typical Meteorological Year (TMY) data for irradiance and rooftop PV power.
- Get live and forecast grid aggregation data.
- Manage PV Power Sites for advanced solar power modeling.
- Simple, easy-to-use client classes for API interaction.
Documentation
- C# SDK documentation: https://solcast.github.io/solcast-api-csharp-sdk/
- Full API documentation available at: Solcast API Docs
Installation
Install the SDK via NuGet with the following command:
dotnet add package Solcast
Alternatively, you can build the SDK locally by cloning the repository and running the build command:
git clone https://github.com/Solcast/solcast-api-csharp-sdk.git
cd solcast-api-csharp-sdk
dotnet build
Configuration
Before using the SDK, you need to set your Solcast API key as an environment variable. You can register for an API key at Solcast Toolkit.
To set the API key in your environment:
Windows PowerShell:
$env:SOLCAST_API_KEY = "{your_api_key}"
Linux/macOS:
export SOLCAST_API_KEY="{your_api_key}"
Basic Usage
Retrieving Live Radiation and Weather Data
using Solcast.Clients;
var liveClient = new LiveClient();
var response = await liveClient.GetRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
outputParameters: ["air_temp", "dni", "ghi"]
format: "csv"
);
Console.WriteLine(response);
Retrieving Forecast Data
using Solcast.Clients;
var forecastClient = new ForecastClient();
var response = await forecastClient.GetForecast(
latitude: -33.856784,
longitude: 151.215297,
outputParameters: ["air_temp", "dni", "ghi"]
);
Retrieving Historic Radiation and Weather Data
using Solcast.Clients;
var historicClient = new HistoricClient();
var response = await historicClient.GetRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
start: "2022-01-01T00:00",
duration: "P1D"
);
Retrieving TMY Radiation and Weather Data
using Solcast.Clients;
var tmyClient = new TmyClient();
var response = await tmyClient.GetRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
);
Retrieving Grid Aggregation Forecast Data
using Solcast.Clients;
var aggregationClient = new AggregationClient();
var response = await aggregationClient.GetForecastAggregation(
collectionId: "country_total",
aggregationId: "it_total",
outputParameters: ["percentage", "pv_estimate"],
format: "csv"
);
Listing all available PV Power Sites:
using Solcast.Clients;
var pvClient = new PvPowerSitesClient();
var response = await pvClient.ListPvPowerSites();
Getting metadata of a specific PV Power Site:
using Solcast.Clients;
var pvClient = new PvPowerSitesClient();
var response = await pvClient.GetPvPowerSite("ba75-e17a-7374-95ed");
API Methods
LiveClient
GetRadiationAndWeather: Retrieves live solar radiation and weather data.
ForecastClient
GetForecast: Retrieves forecast solar radiation and weather data for up to 14 days ahead.
HistoricClient
GetRadiationAndWeather: Retrieves historic solar radiation and weather data.
TmyClient
GetRadiationAndWeather: Retrieves TMY (Typical Meteorological Year) irradiance and weather data.GetRooftopPvPower: Retrieves TMY rooftop PV power estimated actuals.
AggregationClient
GetLiveAggregation: Retrieves live grid aggregation data for up to 7 days.GetForecastAggregation: Retrieves forecast grid aggregation data for up to 7 days.
PvPowerSitesClient
ListPvPowerSites: Retrieves a list of available PV Power Sites.GetPvPowerSite: Retrieves metadata for a specific PV Power Site.CreatePvPowerSite: Creates a new PV Power Site for use with advanced solar power modeling.PatchPvPowerSite: Partially updates the metadata for an existing PV Power Site.UpdatePvPowerSite: Overwrites the metadata for an existing PV Power Site.DeletePvPowerSite: Deletes an existing PV Power Site.
Contributing
We welcome contributions to this SDK! If you'd like to contribute, please submit a Pull Request or open an issue with any suggestions or bug reports.
To generate the sdk from the openapi specs run:
python3 generate_sdk_csharp.py
Running Tests
To run the tests, use the following command:
dotnet build && dotnet test
Executing examples:
Live:
dotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj live
Historic:
dotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj historic
Forecast:
dotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj forecast
License
This SDK is licensed under the Apache 2.0 License. See the LICENSE file for more information.
| Product | Versions 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. |
-
net8.0
- Newtonsoft.Json (>= 13.0.1)
- System.Net.Http.Json (>= 6.0.0)
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 | 100 | 9/8/2026 |
| 3.0.0 | 106 | 9/7/2026 |
| 2.0.0 | 868 | 7/22/2025 |
| 1.0.2 | 302 | 11/22/2024 |
| 1.0.1 | 163 | 11/14/2024 |
| 1.0.0 | 190 | 11/14/2024 |
| 1.0.0-beta3 | 142 | 11/14/2024 |
| 1.0.0-beta2 | 153 | 11/14/2024 |
| 1.0.0-alpha1 | 155 | 11/13/2024 |
| 0.1.3 | 178 | 10/24/2024 |
| 0.1.2 | 177 | 10/24/2024 |
| 0.1.2-alpha1 | 148 | 10/24/2024 |