@chatandshare/random-song

1.0.0 • Public • Published

Random Song API

MusixMatch API wrapper specifically to fetch random songs!

Requirements

You'll need a MusixMatch API key to get access to random songs. It's totally free, and you can get one by clicking here

Example

const RandomSong = require('random-song');
const random = new RandomSong("YOUR_API_KEY_HERE");

(async () => {

    let very_random_song = await random.song();
    
  console.log(very_random_song); // Outputs a random song
  
    let edm_song = await random.song("edm");
    
  console.log(edm_song);;
  
  // Scroll down to see what kind of data you'll receive (in JSON)
})();

Data

{
  track_id: 194285372,
  track_name: 'Falling',
  track_name_translation_list: [],
  track_rating: 100,
  commontrack_id: 88456398,
  instrumental: 0,
  explicit: 0,
  has_lyrics: 1,
  has_subtitles: 1,
  has_richsync: 1,
  num_favourite: 2730,
  album_id: 37245143,
  album_name: 'Nicotine',
  artist_id: 28976090,
  artist_name: 'Trevor Daniel',
  track_share_url: 'https://www.musixmatch.com/lyrics/Trevor-Daniel/Falling?utm_source=application&utm_campaign=api&utm_medium=Chat+%26+Share%3A1409619829238',
  track_edit_url: 'https://www.musixmatch.com/lyrics/Trevor-Daniel/Falling/edit?utm_source=application&utm_campaign=api&utm_medium=Chat+%26+Share%3A1409619829238',
  restricted: 0,
  updated_time: '2020-02-17T10:13:22Z',
  primary_genres: { music_genre_list: [ [Object], [Object] ] }
}

Valid Genres

Over a hundred genres are supported! You can view all of them here. 😀

Information

  • By the development team @ Chat & Share.
  • Used in production by the Woof Discord bot.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @chatandshare/random-song

    Weekly Downloads

    5

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    20 kB

    Total Files

    6

    Last publish

    Collaborators

    • puyodead1