PHPackages                             adinan-cenci/radio-browser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. adinan-cenci/radio-browser

ActiveLibrary[API Development](/categories/api)

adinan-cenci/radio-browser
==========================

A library to fetch radio stations from the radio-browser.info catalog.

2.1.0(4y ago)121962MITPHPPHP &gt;=7.0

Since Dec 31Pushed 4y ago3 watchersCompare

[ Source](https://github.com/adinan-cenci/radio-browser)[ Packagist](https://packagist.org/packages/adinan-cenci/radio-browser)[ RSS](/packages/adinan-cenci-radio-browser/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Radio Browser
=============

[](#radio-browser)

A library to fetch data from the [radio-browser.info](https://www.radio-browser.info/#/) catalog of Internet radio stations by using the [project's api](https://de1.api.radio-browser.info/).

```
use \AdinanCenci\RadioBrowser\RadioBrowser;

$browser          = new RadioBrowser();
$tag              = 'metal';
$orderBy          = 'name';
$descendingOrder  = true;

$stations         = $browser->getStationsByTag($tag, $orderBy, $descendingOrder);

print_r($stations);
```

Examples
--------

[](#examples)

See examples of how to use in the "examples" directory.

- [Get tags](examples/a-get-tags.php)
- [Get states](examples/b-get-states.php)
- [Get stations by tag](examples/c-get-stations-by-tag.php)
- [Get stations by country](examples/d-get-stations-by-country.php)
- [Get stations by clicks](examples/e-get-stations-by-clicks.php)
- [Get stations by votes](examples/f-get-stations-by-votes.php)
- [Get stations in XML format](examples/g-get-stations-in-xml-format.php)
- [Get servers IPs](examples/y-get-servers-ips.php)

Classes and instantiating
-------------------------

[](#classes-and-instantiating)

### Associative arrays / Objects

[](#associative-arrays--objects)

The methods of `\AdinanCenci\RadioBrowser\RadioBrowser` will return either associative arrays or stdObjects, depending on the `$associative` parameter informed to the constructor.

ParameterTypeDefaultDescription$serverstring|boolA Radio Browser server, it defaults to "'", if false is informed the object will pick a random server, see the server section for more information.$associativebooltrueIf true, the methods will return associative arrays, stdObjects otherwise.### Xml, json, csv etc...

[](#xml-json-csv-etc)

If you need the data represented in a specific format, then use `\AdinanCenci\RadioBrowser\RarioBrowserApi`. The different methods will return data formatted as: json, xml, csv, m3u, pls, xspf and ttl.

ParameterTypeDefaultDescription$serverstring|boolA Radio Browser server, it defaults to "'", if false is informed, the object will pick a random server, see the server section for more information.$formatstringjsonThe format the data must be served, possible values: json, xml, csv, m3u, pls, xspf, ttl.Radio Stations
--------------

[](#radio-stations)

### Get stations by UUID

[](#get-stations-by-uuid)

The `::getStationsByUuid($uuids)` search stations with the specified ids.

ParameterTypeDescription$uuidsstring|arrayA list of uuids, either an array, or an comma separated string.### Get stations by URL

[](#get-stations-by-url)

The `::getStationsByUrl($url)`method search stations by their web page.

### Get stations by clicks

[](#get-stations-by-clicks)

The `::getStationsByClicks($offset, $limit, $hideBroken)` method returns the most sintonized stations.

### Get stations by votes

[](#get-stations-by-votes)

The `::getStationsByVotes($offset, $limit, $hideBroken)` method returns the most voted stations.

### Get stations by recent clicks

[](#get-stations-by-recent-clicks)

The `::getStationsByRecentClicks($offset, $limit, $hideBroken)` method returns the currently most popular stations.

### Get stations last changed

[](#get-stations-last-changed)

The `::getStationsByLastChange($offset, $limit, $hideBroken)` method returns the stations last updated.

### Get older version of stations

[](#get-older-version-of-stations)

The `::getStationOlderVersions($lastChangeUuid, $limit)` method returns old versions of stations from the last 30 days.

### Get broken stations

[](#get-broken-stations)

The `::getBrokenStations($offset, $limit)` method returns stations that did not pass the connection test.

Get stations by ...
-------------------

[](#get-stations-by-)

All the methods in this section share the following parameters:

ParameterTypeDefaultDescription$orderstring'name'Possible values:
name, url, homepage, favicon, tags, country, state, language, votes, codec, bitrate, lastcheckok, lastchecktime, clicktimestamp, clickcount, clicktrend, random.$reverseboolfalsefalse = Ascending order.
true = Descending order.$hideBrokenboolfalseDo not list stations that failed the connection test.$offsetint0$limitint100000### Just get all stations

[](#just-get-all-stations)

The `::getStations($order, $reverse, $hideBroken, $offset, $limit)` method will return all stations.

### Get stations by name

[](#get-stations-by-name)

The `::getStationsByName($name, $order, $reverse, $hideBroken, $offset, $limit)` method returns stations described with `$name`.

### Get stations by exact name

[](#get-stations-by-exact-name)

The `::getStationsByExactName($name, $order, $rev...)` method returns stations described with an exact match of `$name`.

### Get stations by codec

[](#get-stations-by-codec)

The `::getStationsByCodec($codec, $order, $rev...)` method returns stations described with `$codec`.

### Get stations by exact codec

[](#get-stations-by-exact-codec)

The `::getStationsByExactCodec($codec, $order, $rev...)` method returns stations described with an exact match of `$codec`.

### Get stations by country

[](#get-stations-by-country)

`::getStationsByCountry($country, $order, $rev...)`

### Get station by exact country

[](#get-station-by-exact-country)

`::getStationsByExactCountry($country, $order, $rev...)`

### Get stations by state

[](#get-stations-by-state)

`::getStationsByState($state, $order, $rev...)`

### Get stations by exact state

[](#get-stations-by-exact-state)

`::getStationsByExactState($state, $order, $rev...)`

### Get stations by language

[](#get-stations-by-language)

`::getStationsByLanguage($language, $order, $rev...)`

### Get stations by exact language

[](#get-stations-by-exact-language)

`::getStationsByExactLanguage($language, $order, $rev...)`.

### Get stations by tag

[](#get-stations-by-tag)

`::getStationsByTag($tag, $order, $rev...)`

### Get stations by exact tag

[](#get-stations-by-exact-tag)

`::getStationsByExactTag($tag, $order, $rev...)`

Search station
--------------

[](#search-station)

The `::searchStation($searchTerms)` method allow us to fine grain our search. It receives a single associative array with the following keys available, all of which are optional:

KeyTypeDefaultDescriptionnamestringnullnameExactboolfalsecountrystringnullcountryExactboolfalsecountrycodestringnullstatestringnullstateExactboolfalselanguagestringnulllanguageExactboolfalsetagstringnulltagExactboolfalsetagListstring|arraynullA list of tags, either an array or a comma separated string.codecstringnullbitrateMinint0bitrateMaxint1000000orderstringnamePossible values:
name, url, homepage, favicon, tags, country, state, language, votes, codec, bitrate, lastcheckok, lastchecktime, clicktimestamp, clickcount, clicktrend, random.reverseboolfalsefalse = Ascending order.
true = Descending order.offsetint0limitint100000Get station checks
------------------

[](#get-station-checks)

The `::getStationCheckResults($stationUuid, $lastCheckUuid, $seconds, $limit)` method returns a list of station check results. If a station UUID is provided, the whole history will be returned, otherwise a list of all last checks of all stations will be sent (without older check results).

ParameterTypeDefaultDescription$stationUiid'string'Optional. If set, only list check result of the matching station.$lastCheckUuid'string'If set, only list checks after the check with the given check.$secondsinteger0if &gt; 0, it will only return history entries from the last `$seconds` seconds.$limitinteger999999Get station clicks
------------------

[](#get-station-clicks)

The `::getStationClicks($stationUuid, $lastCheckUuid, $seconds)` method returns a list of station clicks. If a station UUID is provided, only clicks of the station will be returned, otherwise a list of all clicks of all stations will be sent (chunksize 10000).

ParameterTypeDefaultDescription$stationUiid'string'Optional. If set, only list check result of the matching station.$lastCheckUuid'string'If set, only list checks after the check with the given check.$secondsinteger0if &gt; 0, it will only return history entries from the last `$seconds` seconds.Add station
-----------

[](#add-station)

The `::addStation($name, $url, $homePage, $favIcon, $countryCode, $state, $language, $tags, $geoLat, $geoLong)` method allow us to insert new stations.

It receives a single associative array with the following keys available, all of which are optional:

KeyTypeDefaultDescription$namestringMANDATORY, the name of the radio station. Max 400 chars.$rlstringMANDATORY, the URL of the station.$homePagestringnullthe homepage URL of the station.$favIconstringnullthe URL of an image file (jpg or png).$countryCodestringnullThe 2 letter countrycode of the country where the radio station is located.$statestringnullThe name of the part of the country where the station is located.$languagestringnullThe main language used in spoken text parts of the radio station.$tagsstringnullA list of tags separated by commas to describe the station.$geoLatstringnullThe latitude of the stream location.$geoLongstringnullThe longitude of the stream location.Ranking
-------

[](#ranking)

### Listeners

[](#listeners)

The `::clickStation($stationUuid)` method must be invoked every time a user starts playing a stream, this helps Radio Browser sort how popular each station is. **IMPORTANT**: Every call from the same IP address and for the same station only gets counted once per day.

### Voting

[](#voting)

The `::voteStation($stationUuid)` method increases the vote count by one. **IMPORTANT**: it can only be called once every 10 minutes for the same radio stations, from the same IP.

General Information
-------------------

[](#general-information)

The methods bellow share the following parameters:

ParameterTypeDefaultDescription$filterstringA string to be matched against.$orderstringnamePossible values: name, stationcount.$reverseboolfalsefalse = Ascending order.
true = Descending order.$hideBrokenboolfalseDo not count stations that failed the connection test.### Get codecs

[](#get-codecs)

The `::getCodecs($filter, $order, $reverse, $hideBroken)` method returns a list of codecs and a count of stations using them.

### Get languages

[](#get-languages)

The `::getLanguages($filter, $ord...)` method returns a list of languages and a count of stations in this language.

### Get tags

[](#get-tags)

The `::getTags($filter, $ord...)` method returns a list of tags and a count of stations described with them.

### Get country codes

[](#get-country-codes)

The `::getCountryCodes($filter, $ord...)` method returns a list of country codes and a count of stations described with them.

### Get countries

[](#get-countries)

The `::getCountries($filter, $ord...)` method returns a list of countries and a count of stations described with them.

### Get states

[](#get-states)

The `::getStates($filter, $country, $order, $reverse, $hideBroken)` return a list of states and a count of stations described with them.

ParameterTypeDefaultDescription$filterstringA string to be matched against.$countrystringnullThe country that the state belongs to.$orderstringnamePossible values: name, stationcount.$reverseboolfalsefalse = Ascending order.
true = Descending order.$hideBrokenboolfalseDo not count stations that failed the connection test.Servers
-------

[](#servers)

### Get the server's stats

[](#get-the-servers-stats)

`::getServerStats()`

### Get the server's mirrors

[](#get-the-servers-mirrors)

`::getServerMirrors()`

### Get the server's configurations

[](#get-the-servers-configurations)

`::getServerConfig()`

### Get the server's metrics

[](#get-the-servers-metrics)

`::getServerMetrics()`

### Get DNS records

[](#get-dns-records)

The `::getDnsRecords()` static method returns DNS information on available servers.

### Get server IPs

[](#get-server-ips)

The `::getServerIps()` static method returns an array of IPs of available servers.

### Get servers

[](#get-servers)

The `::getServers()` static method returns an array of URLs of available servers.

### Pick a server

[](#pick-a-server)

The `::pickAServer()` static method returns a random server's URL.

Installation
------------

[](#installation)

Use composer.

```
composer require adinan-cenci/radio-browser
```

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~107 days

Total

5

Last Release

1625d ago

Major Versions

0.1.1 → 2.0.02021-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c1eb1b039e965bb307f010fb1dd41fbc79c8c9e9a65324b8f18d2bb9168097d?d=identicon)[AdinanCenci](/maintainers/AdinanCenci)

---

Top Contributors

[![adinan-cenci](https://avatars.githubusercontent.com/u/1629643?v=4)](https://github.com/adinan-cenci "adinan-cenci (7 commits)")

---

Tags

apiinternet-radiolibraryphpradioradio-browsermusicradio

### Embed Badge

![Health badge](/badges/adinan-cenci-radio-browser/health.svg)

```
[![Health](https://phpackages.com/badges/adinan-cenci-radio-browser/health.svg)](https://phpackages.com/packages/adinan-cenci-radio-browser)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)[volcengine/volcengine-php-sdk

119.5k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
