Skip to content

smart-developer1791/go-radio-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“» Radio Explorer

Go Version SSE Tailwind CSS Radio Browser API Render

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!

Radio Explorer Demo

✨ Features

  • πŸ“» 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

πŸ› οΈ Tech Stack

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

πŸš€ Quick Start

Clone the repository:

git clone https://github.com/smart-developer1791/go-radio-explorer
cd go-radio-explorer

Initialize 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.

πŸ“‘ API Reference

Radio Browser API

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.


πŸ”„ API Server Handling

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.

πŸ“ Project Structure

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

🌐 Environment Variables

Variable Default Description
PORT 8080 Server port

🎯 SSE Events

Event Description
message Station data (JSON)
done Stream completed
error API or streaming error (sent as SSE event)

πŸ“¦ Dependencies

github.com/go-chi/chi/v5 β€” Lightweight router with middleware

πŸ–ΌοΈ Station Data

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
}

πŸ™ Credits


Deploy in 10 seconds

Deploy to Render

About

πŸ“» Real-time radio station discovery stream using Go, Server-Sent Events (SSE), and Radio Browser API. Explore 30,000+ radio stations worldwide! Live streaming with Tailwind CSS UI. πŸ“»πŸŽ΅

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages