{"id":15206712,"url":"https://github.com/aglasencnik/radiobrowserwrapper","last_synced_at":"2025-09-25T17:30:20.797Z","repository":{"id":257789678,"uuid":"857760418","full_name":"aglasencnik/RadioBrowserWrapper","owner":"aglasencnik","description":"RadioBrowserWrapper is a lightweight, easy-to-use .NET wrapper for the Radio Browser API, enabling seamless integration with online radio stations and stream discovery.","archived":false,"fork":false,"pushed_at":"2024-09-21T18:26:21.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-16T00:44:51.737Z","etag":null,"topics":["csharp","dotnet","nuget","radio-browser"],"latest_commit_sha":null,"homepage":"","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/aglasencnik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-09-15T14:43:11.000Z","updated_at":"2024-09-22T06:38:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"eacb4733-297f-4987-9962-0e8c809f676c","html_url":"https://github.com/aglasencnik/RadioBrowserWrapper","commit_stats":null,"previous_names":["aglasencnik/radiobrowserwrapper"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aglasencnik%2FRadioBrowserWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aglasencnik%2FRadioBrowserWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aglasencnik%2FRadioBrowserWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aglasencnik%2FRadioBrowserWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aglasencnik","download_url":"https://codeload.github.com/aglasencnik/RadioBrowserWrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224862961,"owners_count":17382283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csharp","dotnet","nuget","radio-browser"],"created_at":"2024-09-28T06:02:50.634Z","updated_at":"2025-09-25T17:30:20.471Z","avatar_url":"https://github.com/aglasencnik.png","language":"C#","funding_links":["https://www.buymeacoffee.com/aglasencnik"],"categories":[],"sub_categories":[],"readme":"# RadioBrowserWrapper\n\n[![NuGet version (RadioBrowserWrapper)](https://img.shields.io/nuget/v/RadioBrowserWrapper.svg?style=flat-square)](https://www.nuget.org/packages/RadioBrowserWrapper/)\n\n![GitHub License](https://img.shields.io/github/license/aglasencnik/RadioBrowserWrapper)\n\n**RadioBrowserWrapper** is a lightweight and intuitive .NET wrapper for the [Radio Browser API](https://www.radio-browser.info/), designed to make it easy for developers to integrate radio station search and stream discovery into their applications.\n\nWhether you're building a media player, an online radio directory, or any project that requires radio station information, this library provides a simple and streamlined interface to interact with the Radio Browser API.\n\nWith support for:\n- Searching stations by various criteria (country, language, tag, etc.)\n- Fetching detailed information about specific stations\n- Adding new stations to the Radio Browser database\n- Seamlessly integrating live radio streams\n\n**RadioBrowserWrapper** enables smooth integration of live radio streams into your .NET applications.\n\n## Installation\n\nTo use RadioBrowserWrapper in your C# project, you need to install the NuGet package. Follow these simple steps:\n\n### Using NuGet Package Manager\n\n1. **Open Your Project**: Open your project in Visual Studio or your preferred IDE.\n2. **Open the Package Manager Console**: Navigate to `Tools` -\u003e `NuGet Package Manager` -\u003e `Package Manager Console`.\n3. **Install RadioBrowserWrapper**: Type the following command and press Enter:\n   `Install-Package RadioBrowserWrapper`\n\n### Using .NET CLI\n\nAlternatively, you can use .NET Core CLI to install RadioBrowserWrapper. Open your command prompt or terminal and run:\n\n`dotnet add package RadioBrowserWrapper`\n\n### Verifying the Installation\n\nAfter installation, make sure that RadioBrowserWrapper is listed in your project dependencies to confirm successful installation.\n\n## Usage\n\nTo get started with `RadioBrowserWrapper`, create an instance of the `RadioBrowser` class and use its methods to interact with the Radio Browser API. Below is an example of how you can retrieve various types of data:\n\n```csharp\nusing RadioBrowserWrapper;\nusing RadioBrowserWrapper.Models;\n\nvar radioBrowser = new RadioBrowser();\n\nConsole.WriteLine(\"Countries:\");\n\n// Get the first 10 countries\nvar countries = await radioBrowser.GetCountriesAsync(searchOptions: new SimpleSearchOptions\n{\n    Limit = 10\n});\n\nforeach (var country in countries)\n{\n    Console.WriteLine($\"{country.Name} ({country.ISO_3166_1})\");\n}\n```\n\nYou can retrieve information on codecs used by radio stations:\n\n```csharp\nConsole.WriteLine(\"Codecs:\");\n\n// Get codecs\nvar codecs = await radioBrowser.GetCodecsAsync();\nforeach (var codec in codecs)\n{\n    Console.WriteLine($\"{codec.Name} ({codec.StationCount})\");\n}\n```\n\nTo get the top 10 stations by votes, use:\n\n```csharp\nConsole.WriteLine(\"Top 10 stations:\");\n\n// Get top 10 stations\nvar topStations = await radioBrowser.GetTopStationsByVotesAsync(10);\nforeach (var station in topStations)\n{\n    Console.WriteLine($\"{station.Name} ({station.Url})\");\n}\n```\n\nTo retrieve stations from a specific country, for example, Germany:\n\n```csharp\nConsole.WriteLine(\"Stations from Germany:\");\n\n// Get first 10 stations from Germany\nvar gerStations = await radioBrowser.GetStationsByExactCountryAsync(\"Germany\", new ListStationsSearchOptions\n{\n    Limit = 10\n});\n\nforeach (var station in gerStations)\n{\n    Console.WriteLine($\"{station.Name} ({station.Url})\");\n}\n```\n\nYou can also vote for a station by its UUID:\n\n```csharp\n// Vote for the first station in the top stations list\nawait radioBrowser.VoteStationAsync(topStations.FirstOrDefault()!.StationUuid);\n```\n\n### Dependency Injection and Instancing\n\nThere are different ways to create an instance of `RadioBrowser` in your project, either by instantiating it directly or using dependency injection (DI) in ASP.NET Core or other DI frameworks.\n\n#### Instantiating Directly\n\nYou can create an instance of `RadioBrowser` with default or custom options:\n\n```csharp\n// Default options\nvar radioBrowser = new RadioBrowser();\n\n// Custom server URL\nvar radioBrowser = new RadioBrowser(new RadioBrowserOptions\n{\n    ServerUrl = \"de1.api.radio-browser.info\"\n});\n```\n\n#### Using Dependency Injection (DI)\n\nYou can also configure `RadioBrowser` to be injected via the service container, making it easier to use in DI-heavy environments like ASP.NET Core:\n\n1. **With Default Options**\n\n```csharp\nvar builder = Host.CreateApplicationBuilder();\n\n// Add RadioBrowser to the service collection with default options\nbuilder.Services.AddRadioBrowser();\n\nvar serviceProvider = builder.Build().Services;\nvar radioBrowser = serviceProvider.GetRequiredService\u003cIRadioBrowser\u003e();\n```\n\n2. **With Custom Options**\n\n```csharp\nvar builder = Host.CreateApplicationBuilder();\n\n// Add RadioBrowser to the service collection with custom options\nbuilder.Services.AddRadioBrowser(options =\u003e\n{\n    options.ServerUrl = \"de1.api.radio-browser.info\";\n});\n\nvar serviceProvider = builder.Build().Services;\nvar radioBrowser = serviceProvider.GetRequiredService\u003cIRadioBrowser\u003e();\n```\n\nIn both cases, you can retrieve an `IRadioBrowser` instance from the service provider and use it in your project.\n\n### Explore More\n\nThe `RadioBrowserWrapper` package wraps all available endpoints provided by the Radio Browser API, enabling you to interact with a wide range of functionality. Beyond the examples shown, you can:\n\n- Search stations by tags, language, or bitrate.\n- Retrieve stations by name, exact URL, or UUID.\n- Get statistics like the number of active stations or the total number of countries.\n- Server statistics\n- Filter stations based on codec, bitrate, or country.\n- and much more\n\nWith many customizable search options and methods, there is plenty to explore within the library.\n\n## Support the Project\n\nIf you find this project useful, consider supporting it by [buying me a coffee](https://www.buymeacoffee.com/aglasencnik). Your support is greatly appreciated!\n\n## Contributing\n\nContributions are welcome! If you have a feature to propose or a bug to fix, create a new pull request.\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/aglasencnik/RadioBrowserWrapper/blob/main/LICENSE).\n\n## Acknowledgment\n\nThis project is inspired by and built upon the [Radio Browser](https://www.radio-browser.info/) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faglasencnik%2Fradiobrowserwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faglasencnik%2Fradiobrowserwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faglasencnik%2Fradiobrowserwrapper/lists"}