Install
dotnet add package Solcast
API key
// Recommended: set SOLCAST_API_KEY in your environment
export SOLCAST_API_KEY="your-api-key"
Live radiation & weather
using Solcast.Clients;
var liveClient = new LiveClient();
var response = await liveClient.GetLiveRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
outputParameters: ["air_temp", "ghi"],
);
Console.WriteLine(response.RawResponse);
Response helpers
Console.WriteLine(response.RawResponse);
// Or access typed response data when available
// var data = response.Data;
Unmetered location
using Solcast.Clients;
var location = UnmeteredLocations.Locations["Sydney Opera House"];
var forecastClient = new ForecastClient();
var response = await forecastClient.GetForecastRooftopPvPower(
latitude: location.Latitude,
longitude: location.Longitude,
outputParameters: ["pv_power_rooftop"],
period: "PT5M",
capacity: 5.0f,
tilt: 22.0f,
format: "csv",
);
Console.WriteLine(response.RawResponse);
LiveClient
using Solcast.Clients;
var liveClient = new LiveClient();
var response = await liveClient.GetLiveRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
outputParameters: ["dni", "ghi"],
);
Console.WriteLine(response.RawResponse);ForecastClient
using Solcast.Clients;
var forecastClient = new ForecastClient();
var response = await forecastClient.GetForecastRadiationAndWeather(
latitude: -33.856784,
longitude: 151.215297,
outputParameters: ["air_temp"],
);
Console.WriteLine(response.RawResponse);HistoricClient
using Solcast.Clients;
var historicClient = new HistoricClient();
var response = await historicClient.GetHistoricRadiationAndWeather(
start: "2024-06-01T06:00",
latitude: -33.856784,
longitude: 151.215297,
duration: "P1D",
);
Console.WriteLine(response.RawResponse);TmyClient
using Solcast.Clients;
var tmyClient = new TmyClient();
var response = await tmyClient.GetTmyRooftopPvPower(
latitude: -33.856784,
longitude: 151.215297,
capacity: 5.0f,
);
Console.WriteLine(response.RawResponse);AggregationClient
using Solcast.Clients;
var aggregationClient = new AggregationClient();
var response = await aggregationClient.GetForecastAggregations(
outputParameters: ["percentage", "pv_estimate"],
collectionId: "aust_state_total",
aggregationId: "vic",
);
Console.WriteLine(response.RawResponse);PvPowerSiteClient
using Solcast.Clients;
var pvPowerSiteClient = new PvPowerSiteClient();
var response = await pvPowerSiteClient.GetPvPowerSite(
resourceId: "ba75-e17a-7374-95ed",
);
Console.WriteLine(response.RawResponse);