All Projects → nepodev → radio-browser

nepodev / radio-browser

Licence: MIT License
Nodejs module for Radio-browser API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to radio-browser

origami-build-tools
Standard Origami component development tools.
Stars: ✭ 49 (+188.24%)
Mutual labels:  node-module
node-fetch-retry
Node Module for performing retries using node-fetch
Stars: ✭ 33 (+94.12%)
Mutual labels:  node-module
oxford-dictionary
A nodeJS wrapper for using the oxforddictionary.com V2 REST API.
Stars: ✭ 28 (+64.71%)
Mutual labels:  node-module
djb2a
DJB2a non-cryptographic hash function
Stars: ✭ 31 (+82.35%)
Mutual labels:  node-module
node-health-check
Build health check functions which comply with the FT health check standard
Stars: ✭ 20 (+17.65%)
Mutual labels:  node-module
node-sfml
A cross-platform SFML's Node.js binding.
Stars: ✭ 53 (+211.76%)
Mutual labels:  node-module
vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (+52.94%)
Mutual labels:  node-module
midtrans-node
Unoffficial Midtrans Payment API Client for Node JS | Alternative for Midtrans Official Module | https://midtrans.com
Stars: ✭ 15 (-11.76%)
Mutual labels:  node-module
sdbm
SDBM non-cryptographic hash function
Stars: ✭ 43 (+152.94%)
Mutual labels:  node-module
warframe-worldstate-parser
📗 An Open parser for Warframe's Worldstate in Javascript
Stars: ✭ 50 (+194.12%)
Mutual labels:  node-module
node-typescript-starter
REST API using Node with typescript, KOA framework. TypeORM for SQL. Middlewares JWT (auth), CORS, Winston Logger, Error, Response
Stars: ✭ 19 (+11.76%)
Mutual labels:  node-module
node-movehub
Node.js interface for the Lego Boost Move Hub 🤖 🐱 🎸 🚚
Stars: ✭ 57 (+235.29%)
Mutual labels:  node-module
mdict
node.js mdict (*.mdx, *.mdd) file reader
Stars: ✭ 39 (+129.41%)
Mutual labels:  node-module
crc16
A native node addon to calcalate and verify CRC16 values, adopted by MODBUS agreement
Stars: ✭ 24 (+41.18%)
Mutual labels:  node-module
mypluralize
A Node.js module that returns the plural or singular form of any noun
Stars: ✭ 13 (-23.53%)
Mutual labels:  node-module
ugql
🚀GraphQL.js over HTTP with uWebSockets.js
Stars: ✭ 27 (+58.82%)
Mutual labels:  node-module
node-advanced
Node Advanced Courseware
Stars: ✭ 80 (+370.59%)
Mutual labels:  node-module
mockserver-node
Node.js module and grunt plugin to start and stop MockServer and MockServer Proxy
Stars: ✭ 34 (+100%)
Mutual labels:  node-module
mi-cron
📆 A microscopic parser for standard cron expressions.
Stars: ✭ 16 (-5.88%)
Mutual labels:  node-module
iRadio
Ein Softwarebaukasten für den Aufbau/Umbau von Radios auf Raspberry Pi Basis
Stars: ✭ 15 (-11.76%)
Mutual labels:  webradio

RadioBrowser API Client

Nodejs module for Radio-browser API

Install

npm install radio-browser

Usage

Every method returns a promise so you have to use then and catch or async and await.

const RadioBrowser = require('radio-browser')

let filter = {
    limit: 5,          // list max 5 items
    by: 'tag',         // search in tag
    searchterm: 'jazz' // term in tag
}
RadioBrowser.getStations(filter)
    .then(data => console.log(data))
    .catch(error => console.error(error))

Methods

Properties

  • filter_by_types list of types using in getStations({by: {type}, ...})
  • category_types list of categories using in getCategory({type} ...)
  • service_url get or set the api-url. Default is null to get a random API host at first request.

Examples:

Get Server Stats from a random API-Host by using async/await

// file: examples/server-stats.js

const RadioBrowser = require('radio-browser')

const start = async () => {
    try {
        let data = await RadioBrowser.getServerStats()
        console.log(`API Server: ${RadioBrowser.service_url}`)
        console.log('stats', data)
    }
    catch (e) {
        console.error(e)
    }
}

start()
// example output
API Server: https://de1.api.radio-browser.info/
stats { supported_version: 1,
  software_version: '0.6.14',
  status: 'OK',
  stations: 25603,
  stations_broken: 767,
  tags: 6757,
  clicks_last_hour: 2707,
  clicks_last_day: 59547,
  languages: 374,
  countries: 246 }

Get the 5 top voted station

let filter = {
	by: 'topvote', // stations by topvote
	limit: 5    // top 5 stations
}
RadioBrowser.getStations(filter)
    .then(data => console.log(data))
    .catch(err => console.error(err))

data looks like this

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].