Skip to content
RadioBrowser Java API library
Java Shell
Branch: master
Clone or download

README.md

RadioBrowser4j

Travis CI Status Maven Central Codacy Badge Coverage Status License

A Java API for the RadioBrowser internet radio station online repository.

The library is useful for applications wanting to retrieve internet radio station URLs, streams and meta information.

How to use

First step is to include the dependency in your Maven or Gradle project. For maven you need this dependency:

<dependency>
    <groupId>de.sfuhrm</groupId>
    <artifactId>radiobrowser4j</artifactId>
    <version>2.0.0</version>
</dependency>

After adding this dependency, you can start by creating one instance and using it

// 5000ms timeout, user agent is Demo agent/1.0
RadioBrowser browser = new RadioBrowser(5000, "Demo agent/1.0");
// print the first 64 stations in station name order
browser.listStations(ListParameter.create().order(FieldName.name))
    .limit(64)
    .forEach(s -> System.out.printf("%s: %s%n",
        s.getName(),
        s.getUrl()
));

You can take a look at the JavaDoc documentation to get the full concepts of the API.

More examples

The library was extracted from a internet radio player and recorder program in Java, radiorecorder. You can take a look at real-life usage patterns there.

How it is tested

The API is tested using the WireMock REST testing framework. Mocked web requests/responses are located in the test resources.

Version history

  • v1.3.0:
    • Use new API DNS names.
    • Update maven plugins / dependencies.
  • v1.2.1:
    • Made building with JDK 11 possible.
    • JDK 10/11 building in TravisCI.
    • Updated dependencies.
  • v1.2.0:
    • Minor code improvements.
    • Updated many dependencies, for example Jersey JAX-RS.
  • v1.1.0:
    • Added stream API calls.
    • Added tags list version to Station.
    • ListParameter for list order control.
    • editStation call in RadioBrowser.
  • v1.0.0: First maven release.

License

Copyright 2017-2018 Stephan Fuhrmann

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and

You can’t perform that action at this time.