{"id":37048534,"url":"https://github.com/tsjdev-apps/openweathermap-sharp","last_synced_at":"2026-01-14T05:38:54.839Z","repository":{"id":197298456,"uuid":"698331817","full_name":"tsjdev-apps/openweathermap-sharp","owner":"tsjdev-apps","description":"A .NET client wrapper for https://openweathermap.org written in .NET Standard 2.0","archived":false,"fork":false,"pushed_at":"2025-11-29T20:31:09.000Z","size":201,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-02T01:38:46.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsjdev-apps.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},"funding":{"github":"tsjdev-apps"}},"created_at":"2023-09-29T17:12:22.000Z","updated_at":"2025-11-29T20:31:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"702378de-ee35-44a0-84ba-1f1f1377b258","html_url":"https://github.com/tsjdev-apps/openweathermap-sharp","commit_stats":null,"previous_names":["tsjdev-apps/openweathermap-sharp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsjdev-apps/openweathermap-sharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsjdev-apps%2Fopenweathermap-sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsjdev-apps%2Fopenweathermap-sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsjdev-apps%2Fopenweathermap-sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsjdev-apps%2Fopenweathermap-sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsjdev-apps","download_url":"https://codeload.github.com/tsjdev-apps/openweathermap-sharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsjdev-apps%2Fopenweathermap-sharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410960,"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":[],"created_at":"2026-01-14T05:38:54.180Z","updated_at":"2026-01-14T05:38:54.830Z","avatar_url":"https://github.com/tsjdev-apps.png","language":"C#","funding_links":["https://github.com/sponsors/tsjdev-apps","https://www.buymeacoffee.com/tsjdevapps"],"categories":[],"sub_categories":[],"readme":"# OpenWeatherMapSharp\n\nA .NET client wrapper for [https://openweathermap.org](https://openweathermap.org) written in .NET Standard 2.0\n\n## Installation\n\nInstall the package via [NuGet](https://www.nuget.org/packages/OpenWeatherMapSharp).\n\n[![Nuget](https://img.shields.io/nuget/v/OpenWeatherMapSharp)](https://www.nuget.org/packages/OpenWeatherMapSharp)\n\n## Usage\n\nFirst you need to get a free API key from [openweathermap.org](https://www.openweathermap.org). You can create a new account and you will find your API keys [here](https://home.openweathermap.org/api_keys).\n\nYou need to create a new instance of `OpenWeatherMapService` passing in the *API key*. There is also an interface available, if you are using Dependency Injection.\n\n```csharp\n/// \u003csummary\u003e\n/// Gets forecast data for a location based \n/// on its geographic coordinates.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cForecastRoot\u003e\u003e GetForecastAsync(\n    double latitude,\n    double longitude,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets forecast data based on a city ID.\n/// \u003c/summary\u003e\n[Obsolete]\nTask\u003cOpenWeatherMapServiceResponse\u003cForecastRoot\u003e\u003e GetForecastAsync(\n    int cityId,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets forecast data based on a city name.\n/// \u003c/summary\u003e\n[Obsolete]\nTask\u003cOpenWeatherMapServiceResponse\u003cForecastRoot\u003e\u003e GetForecastAsync(\n    string city,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets current weather data for a location based on its geographic coordinates.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cWeatherRoot\u003e\u003e GetWeatherAsync(\n    double latitude,\n    double longitude,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets current weather data based on a city ID.\n/// \u003c/summary\u003e\n[Obsolete]\nTask\u003cOpenWeatherMapServiceResponse\u003cWeatherRoot\u003e\u003e GetWeatherAsync(\n    int cityId,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets current weather data based on a city name.\n/// \u003c/summary\u003e\n[Obsolete]\nTask\u003cOpenWeatherMapServiceResponse\u003cWeatherRoot\u003e\u003e GetWeatherAsync(\n    string city,\n    LanguageCode language = LanguageCode.EN,\n    Unit unit = Unit.Standard);\n\n/// \u003csummary\u003e\n/// Gets a list of matching locations for a given query string.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cList\u003cGeocodeInfo\u003e\u003e\u003e GetLocationByNameAsync(\n    string query,\n    int limit = 5);\n\n/// \u003csummary\u003e\n/// Gets geolocation information based on a ZIP or postal code.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cGeocodeZipInfo\u003e\u003e GetLocationByZipAsync(\n    string zipCode);\n\n/// \u003csummary\u003e\n/// Gets a list of matching locations for a given pair of coordinates.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cList\u003cGeocodeInfo\u003e\u003e\u003e GetLocationByLatLonAsync(\n    double latitude,\n    double longitude,\n    int limit = 5);\n\n/// \u003csummary\u003e\n/// Retrieves current air pollution data for a specific location.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cAirPollutionRoot\u003e\u003e GetAirPollutionAsync(\n    double latitude,\n    double longitude);\n\n/// \u003csummary\u003e\n/// Retrieves forecasted air pollution data for the coming days for a specific location.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cAirPollutionRoot\u003e\u003e GetAirPollutionForecastAsync(\n    double latitude,\n    double longitude);\n\n/// \u003csummary\u003e\n/// Retrieves historical air pollution data for a specific location and time range.\n/// \u003c/summary\u003e\nTask\u003cOpenWeatherMapServiceResponse\u003cAirPollutionRoot\u003e\u003e GetAirPollutionHistoryAsync(\n    double latitude,\n    double longitude,\n    DateTime start,\n    DateTime end);\n```\n\n***HINT:*** Some methods are marked as `obsolete`, because [openweathermap.org](https://openweathermap.org) marked these methods as depracted. Currently they are all still working, but might be removed in feature releases. They recommend using the methods with *latitude* and *longitude* to get the current weather or the forecast.\n\n## Sample\n\nHere is a screenshot of the `Console Application` using the [NuGet package](https://www.nuget.org/packages/OpenWeatherMapSharp) to get the current weather for a provided city.\n\n![Console Application](./docs/openweathermapsharp-sample.png)\n\n## Buy Me A Coffee\n\nI appreciate any form of support to keep my *Open Source* activities going.\n\nWhatever you decide, be it reading and sharing my blog posts, using my NuGet packages or buying me a coffee/book, thank you ❤️.\n\n[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/default-yellow.png)](https://www.buymeacoffee.com/tsjdevapps)\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsjdev-apps%2Fopenweathermap-sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsjdev-apps%2Fopenweathermap-sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsjdev-apps%2Fopenweathermap-sharp/lists"}