Skip to content

Shubhamnpk/yoradio-api

Repository files navigation

πŸ“» Yo Radio API

Yo Radio Logo

Nepal's Premier Radio Station Database
A comprehensive, open-source collection of 400+ radio stations from all 7 provinces of Nepal.

🌐 Live Demo β€’ πŸ“š API Docs β€’ πŸ“± YoRadio App


✨ Features

  • πŸ“‘ 400+ Radio Stations - Complete coverage across all 7 provinces
  • πŸ”΄ Live Streaming - Direct streaming URLs for web and apps
  • πŸ” Smart Search - Filter by province, name, or frequency
  • βœ… Validated Streams - Regularly checked for availability
  • 🎡 Live Web Player - Built-in player with pagination (12 per page)
  • πŸ†“ 100% Free - No API keys, no limits, open source

πŸš€ Quick Start

Web Player

Visit our Live Radio Player to stream stations directly in your browser!

API Usage

Get All Stations

GET https://shubhamnpk.github.io/yoradio-api/data/index.json

Get Active Stations (Verified)

GET https://shubhamnpk.github.io/yoradio-api/data/active.json

Response Format

[
  {
    "id": "radio-kantipur",
    "name": "Radio Kantipur",
    "streamUrl": "https://radio-broadcast.ekantipur.com/stream",
    "frequency": 96.1,
    "address": "Subidhanagar, Tinkune, Kathmandu",
    "province": 3
  }
]

πŸ“Š Data Files

File Description Stations
data/index.json All stations (HTTPS only, web-compatible) ~350+
data/active.json Verified working stations ~350+
data/old.json HTTP streams (app-only) or broken ~50+

πŸ’» Code Examples

JavaScript

// Fetch and filter stations
const response = await fetch('https://shubhamnpk.github.io/yoradio-api/data/index.json');
const stations = await response.json();

// Filter by province
const bagmati = stations.filter(s => s.province === 3);

// Search by name
const kantipur = stations.find(s => s.name.includes('Kantipur'));

Python

import json
import urllib.request

with urllib.request.urlopen('https://shubhamnpk.github.io/yoradio-api/data/index.json') as response:
    stations = json.load(response)

# Filter by province
bagmati_stations = [s for s in stations if s['province'] == 3]
print(f"Found {len(bagmati_stations)} stations in Bagmati")

React Hook

function useRadioStations() {
  const [stations, setStations] = useState([]);
  
  useEffect(() => {
    fetch('https://shubhamnpk.github.io/yoradio-api/data/index.json')
      .then(res => res.json())
      .then(setStations);
  }, []);
  
  return stations;
}

πŸ—ΊοΈ Province Codes

Code Province Region
1 Koshi Eastern Nepal
2 Madhesh Terai Region
3 Bagmati Kathmandu Valley
4 Gandaki Western Central
5 Lumbini Birthplace of Buddha
6 Karnali Remote Western
7 Sudurpashchim Far Western

πŸ› οΈ Local Development

Running Locally

# Clone the repository
git clone https://github.com/Shubhamnpk/yoradio-api.git
cd yoradio-api

# Install dependencies
npm install

# Start the server
node server.js

# Open http://localhost:3000

Features Available Locally

  • βœ… Web player with pagination
  • βœ… Proxy for HTTP streams (converts to HTTPS)
  • βœ… All API endpoints

Validation Scripts

# Basic validation
python validate_urls.py

# Advanced validation with FFmpeg
python validate_advanced.py

# Move HTTP streams to old.json
python move_http_to_old.py

πŸ“± Apps Using This API

App Description Link
YoRadio Official desktop/mobile radio app GitHub
YoRadio Web Web player with live streaming Try it
Your App Submit your project! Contribute

This database was originally created for YoRadio, but it's free for everyone to use!


🀝 Contributing

We welcome contributions! You can:

  1. 🎡 Add new stations - Find missing radio stations
  2. πŸ”§ Update URLs - Fix broken stream links
  3. πŸ› Report issues - Use the "Report Broken" button in the web player
  4. πŸ’» Submit apps - Add your project to the showcase
  5. πŸ“ Improve docs - Help us document better

Report Broken Streams

Click the ⚠️ button in the web player when a stream fails, or open an issue.


πŸ“ Project Structure

yoradio-api/
β”œβ”€β”€ πŸ“„ index.html          # Main web player (Tailwind CSS)
β”œβ”€β”€ πŸ“„ docs.html           # API documentation
β”œβ”€β”€ πŸ“ data/
β”‚   β”œβ”€β”€ index.json         # All stations (HTTPS)
β”‚   β”œβ”€β”€ active.json        # Verified stations
β”‚   └── old.json           # HTTP/broken stations
β”œβ”€β”€ πŸ“ images/
β”‚   └── radio-logo.svg     # Logo & favicon
β”œβ”€β”€ πŸ“„ server.js           # Node.js server with proxy
β”œβ”€β”€ πŸ“„ validate_urls.py    # Basic URL validation
β”œβ”€β”€ πŸ“„ validate_advanced.py # Advanced validation (FFmpeg)
└── πŸ“„ README.md           # This file

⚠️ Known Issues

Browser Compatibility

  • HTTP streams are blocked by modern browsers (mixed content policy)
  • These have been moved to data/old.json
  • They still work in the YoRadio desktop/mobile app
  • For local development, use the /proxy endpoint

Geo-Restrictions

Some stations only work from within Nepal due to licensing restrictions.


πŸ“„ License

This project is open source and available under the MIT License.


πŸ™ Credits

  • Data Source: Various radio stations across Nepal
  • Maintainer: @Shubhamnpk
  • Created for: YoRadio

Made with ❀️ for Nepal's radio community

About

A comprehensive, open-source database of radio stations across Nepal. This API provides easy access to streaming URLs, frequencies, locations, and other details for over 4000+ radio stations from all 7 provinces.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors