{"id":37049790,"url":"https://github.com/solcast/solcast-api-csharp-sdk","last_synced_at":"2026-01-14T05:46:56.064Z","repository":{"id":89505997,"uuid":"109628702","full_name":"Solcast/solcast-api-csharp-sdk","owner":"Solcast","description":"Solcast API .NET Client library","archived":false,"fork":false,"pushed_at":"2025-11-19T23:16:24.000Z","size":1469,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-20T01:08:27.140Z","etag":null,"topics":["api-client","async","csharp","dotnet","forecast","nuget-package","radiation","sdk","solar-energy","tmy"],"latest_commit_sha":null,"homepage":"https://solcast.github.io/solcast-api-csharp-sdk/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Solcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-11-06T00:29:25.000Z","updated_at":"2025-11-19T23:16:22.000Z","dependencies_parsed_at":"2024-10-24T12:28:55.615Z","dependency_job_id":"332bd84b-a3cb-4d7a-ab9b-3188be60f665","html_url":"https://github.com/Solcast/solcast-api-csharp-sdk","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.021739130434782594","last_synced_commit":"9809918bd721777699a20a6f405eb589bdc0f093"},"previous_names":["solcast/solcast-api-csharp-sdk"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/Solcast/solcast-api-csharp-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solcast%2Fsolcast-api-csharp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solcast%2Fsolcast-api-csharp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solcast%2Fsolcast-api-csharp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solcast%2Fsolcast-api-csharp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Solcast","download_url":"https://codeload.github.com/Solcast/solcast-api-csharp-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solcast%2Fsolcast-api-csharp-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","async","csharp","dotnet","forecast","nuget-package","radiation","sdk","solar-energy","tmy"],"created_at":"2026-01-14T05:46:55.226Z","updated_at":"2026-01-14T05:46:56.055Z","avatar_url":"https://github.com/Solcast.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solcast API C# SDK ![](https://raw.githubusercontent.com/Solcast/solcast-api-csharp-sdk/main/docs/img/logo_s.png)\r\n\r\n\r\n[![Build, Test, Package](https://github.com/solcast/solcast-api-csharp-sdk/actions/workflows/build-test-package.yml/badge.svg)](https://github.com/solcast/solcast-api-csharp-sdk/actions/workflows/build-test-package.yml) [![Docs](https://github.com/solcast/solcast-api-csharp-sdk/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/solcast/solcast-api-csharp-sdk/actions/workflows/deploy-docs.yml)\r\n\r\nA **C# SDK** to access the **Solcast API**, allowing you to retrieve solar radiation, weather data, and forecasts from satellite and numerical models.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Retrieve live solar radiation and weather data.\r\n- Access forecast data up to 14 days in advance.\r\n- Access Typical Meteorological Year (TMY) data for irradiance and rooftop PV power.\r\n- Get live and forecast grid aggregation data.\r\n- Manage PV Power Sites for advanced solar power modeling.\r\n- Simple, easy-to-use client classes for API interaction.\r\n\r\n---\r\n\r\n## Documentation\r\n\r\n- C# SDK documentation: https://solcast.github.io/solcast-api-csharp-sdk/\r\n- Full API documentation available at: [Solcast API Docs](https://docs.solcast.com.au)\r\n\r\n---\r\n\r\n## Installation\r\n\r\nInstall the SDK via **NuGet** with the following command:\r\n\r\n```bash\r\ndotnet add package Solcast\r\n```\r\n\r\nAlternatively, you can build the SDK locally by cloning the repository and running the build command:\r\n\r\n```bash\r\ngit clone https://github.com/Solcast/solcast-api-csharp-sdk.git\r\ncd solcast-api-csharp-sdk\r\ndotnet build\r\n```\r\n\r\n---\r\n## Configuration\r\n\r\nBefore 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](https://toolkit.solcast.com.au/).\r\n\r\nTo set the API key in your environment:\r\n\r\nWindows PowerShell:\r\n```powershell\r\n$env:SOLCAST_API_KEY = \"{your_api_key}\"\r\n```\r\n\r\nLinux/macOS:\r\n```bash\r\nexport SOLCAST_API_KEY=\"{your_api_key}\"\r\n```\r\n\r\n## Basic Usage\r\n![Alt text for the image](examples/csharp.svg)\r\n\r\n### Retrieving Live Radiation and Weather Data\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar liveClient = new LiveClient();\r\nvar response = await liveClient.GetLiveRadiationAndWeather(\r\n    latitude: -33.856784,\r\n    longitude: 151.215297,\r\n    outputParameters: [\"air_temp\", \"dni\", \"ghi\"]\r\n    format: \"csv\"\r\n);\r\n\r\nConsole.WriteLine(response.RawResponse);\r\n```\r\n\r\n### Retrieving Forecast Data\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar forecastClient = new ForecastClient();\r\nvar response = await forecastClient.GetForecastRadiationAndWeather(\r\n    latitude: -33.856784,\r\n    longitude: 151.215297,\r\n    outputParameters: [\"air_temp\", \"dni\", \"ghi\"]\r\n);\r\n```\r\n\r\n### Retrieving Historic Radiation and Weather Data\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar historicClient = new HistoricClient();\r\nvar response = await historicClient.GetHistoricRadiationAndWeather(\r\n    latitude: -33.856784,\r\n    longitude: 151.215297,\r\n    start: \"2022-01-01T00:00\",\r\n    duration: \"P1D\"\r\n);\r\n```\r\n\r\n### Retrieving TMY Radiation and Weather Data\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar tmyClient = new TmyClient();\r\nvar response = await tmyClient.GetTmyRadiationAndWeather(\r\n    latitude: -33.856784,\r\n    longitude: 151.215297,\r\n);\r\n```\r\n\r\n### Retrieving Grid Aggregation Forecast Data\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar aggregationClient = new AggregationClient();\r\nvar response = await aggregationClient.GetForecastAggregations(\r\n    collectionId: \"country_total\",\r\n    aggregationId: \"it_total\",\r\n    outputParameters: [\"percentage\", \"pv_estimate\"],\r\n    format: \"csv\"\r\n);\r\n```\r\n\r\n#### Listing all available PV Power Sites:\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar pvClient = new PvPowerSiteClient();\r\nvar response = await pvClient.GetPvPowerSites();\r\n```\r\n\r\n#### Getting metadata of a specific PV Power Site:\r\n```csharp\r\nusing Solcast.Clients;\r\n\r\nvar pvClient = new PvPowerSiteClient();\r\nvar response = await pvClient.GetPvPowerSite(\"ba75-e17a-7374-95ed\");\r\n```\r\n\r\n## API Methods\r\n### LiveClient\r\n- `GetLiveRadiationAndWeather`: Retrieves live solar radiation and weather data.\r\n- `GetLiveAdvancedPvPower`: Retrieves advanced PV power live data.\r\n- `GetLiveRooftopPvPower`: Retrieves live rooftop PV power data based on location and other parameters.\r\n### ForecastClient\r\n- `GetForecastRadiationAndWeather`: Retrieves irradiance and weather forecasts for the requested location from the present up to 14 days ahead\r\n- `GetForecastAdvancedPvPower`: Retrieves advanced PV power forecasts with customizable options.\r\n- `GetForecastRooftopPvPower`: Retrieves rooftop PV power forecast data based on location and other parameters.\r\n### HistoricClient\r\n- `GetHistoricRadiationAndWeather`: Retrieves historic solar radiation and weather data for a specified time range.\r\n- `GetHistoricAdvancedPvPower`: Retrieves advanced PV power historical data.\r\n- `GetHistoricRooftopPvPower`: Retrieves rooftop PV power historical data.\r\n### TmyClient\r\n- `GetTmyRadiationAndWeather`: Retrieves TMY irradiance and weather data for a specified location.\r\n- `GetTmyAdvancedPvPower`: Retrieves advanced PV power TMY data.\r\n- `GetTmyRooftopPvPower`: Retrieves TMY rooftop PV power data.\r\n### AggregationClient\r\n- `GetLiveAggregations`: Retrieves live grid aggregation data for up to 7 days.\r\n- `GetForecastAggregations`: Retrieves forecast grid aggregation data for up to 7 days.\r\n### PvPowerSiteClient\r\n- `GetPvPowerSites`: Retrieves a list of all available PV power sites.\r\n- `GetPvPowerSite`: Retrieves metadata for a specific PV power site by its resource ID.\r\n- `PostPvPowerSite`: Creates a new PV Power Site for use with advanced PV power model.\r\n- `PatchPvPowerSite`: Partially updates the specifications of an existing PV power site.\r\n- `PutPvPowerSite`: Overwrites an existing PV power site specifications.\r\n- `DeletePvPowerSite`: Deletes an existing PV power site.\r\n\r\n## Optional: Enabling SDK Update Checks\r\nBy default, the SDK does not check for updates during runtime. To enable automatic update checking, you can pass `true` for the `checkForUpdates` parameter when creating client instances:\r\n\r\n```csharp\r\nvar liveClient = new LiveClient(checkForUpdates: true);\r\n```\r\n\r\nAlternatively, to enable update checking automatically for all client instances, set the CHECK_SDK_UPDATE environment variable to true:\r\n\r\nWindows PowerShell:\r\n```powershell\r\n$env:CHECK_SDK_UPDATE = \"true\"\r\n```\r\n\r\nLinux/macOS:\r\n```bash\r\nexport CHECK_SDK_UPDATE=\"true\"\r\n```\r\nWhen this flag is set, the SDK will automatically check for new versions during runtime regardless of the `checkForUpdates` parameter value.\r\n\r\n## Running Tests\r\nTo run the tests, use the following command:\r\n```bash\r\ndotnet build \u0026\u0026 dotnet test\r\n```\r\n\r\n## Executing examples:\r\nLive:\r\n```bash\r\ndotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj live\r\n```\r\n\r\nHistoric:\r\n```bash\r\ndotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj historic\r\n```\r\n\r\nForecast:\r\n```bash\r\ndotnet run --project examples/Solcast.Examples/Solcast.Examples.csproj forecast\r\n```\r\n\r\n\r\n---\r\n\r\n## License\r\nThis SDK is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for more information.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolcast%2Fsolcast-api-csharp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolcast%2Fsolcast-api-csharp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolcast%2Fsolcast-api-csharp-sdk/lists"}