Real-time radio station discovery stream using Go, Server-Sent Events (SSE), and Radio Browser API. Explore 30,000+ radio stations available worldwide with a beautiful live streaming UI!
- π» 30,000+ Stations β Access worldwide radio stations database
- π Global Coverage β Stations from every country with flags
- β‘ Real-time SSE β Live streaming with Server-Sent Events
- π¨ Beautiful UI β Modern Tailwind CSS design with animations
βΆοΈ Direct Play β One-click streaming to your player- π·οΈ Rich Metadata β Genre tags, bitrate, codec, language info
- π Popularity Stats β Votes and listener counts
- π API Auto-Failover β Automatic discovery & fallback between Radio Browser API servers
- π Zero Config β No API keys required
| Technology | Purpose |
|---|---|
| Go 1.21+ | Backend server |
| Chi Router | HTTP routing & middleware |
| SSE | Real-time streaming |
| Radio Browser API | Radio stations data |
| Tailwind CSS | UI styling |
Clone the repository:
git clone https://github.com/smart-developer1791/go-radio-explorer
cd go-radio-explorerInitialize dependencies and run:
go mod tidy
go run .Open your browser:
http://localhost:8080
On startup, the app automatically discovers the best available Radio Browser API servers.
Radio Explorer uses the official Radio Browser API infrastructure, which consists of a bootstrap endpoint and multiple live regional API servers.
| Endpoint | Purpose |
|---|---|
https://all.api.radio-browser.info/json/servers |
Discover available API servers |
https://{region}.api.radio-browser.info/json/stations/topvote/100 |
Fetch top-voted radio stations |
Where {region} is a live Radio Browser server such as de1, nl1, at1, etc.
The application does not use https://www.radio-browser.info for API requests.
Instead, it first fetches the official server list from all.api.radio-browser.info
and then performs all station queries against live regional servers.
If a server is unavailable or returns an invalid response, Radio Explorer automatically retries the request using another server.
No API key required.
Note: Station data is fetched from a single randomly selected API server per request to avoid unnecessary load on the Radio Browser infrastructure.
On startup, Radio Explorer dynamically loads the official Radio Browser server list from the bootstrap endpoint.
For each data request:
- a random API server is selected to distribute load,
- failed or unhealthy servers are skipped,
- the request transparently falls back to another available server.
This approach improves reliability, performance, and resilience to server outages.
go-radio-explorer/
βββ main.go # Application entry point
βββ go.mod # Go module definition
βββ render.yaml # Render deployment config
βββ .gitignore # Git ignore rules
βββ README.md # Documentation
| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
Server port |
| Event | Description |
|---|---|
message |
Station data (JSON) |
done |
Stream completed |
error |
API or streaming error (sent as SSE event) |
github.com/go-chi/chi/v5 β Lightweight router with middleware
Each streamed station includes:
{
"name": "Station Name",
"country": "Country",
"countrycode": "CC",
"language": "Language",
"tags": "rock,pop,classic",
"homepage": "https://...",
"url_resolved": "https://stream...",
"favicon": "https://...",
"bitrate": 128,
"codec": "MP3",
"votes": 1234,
"clickcount": 56789
}- Radio Browser β Free radio station API
- Chi Router β Go HTTP router
- Tailwind CSS β Utility-first CSS