MusixMatch API wrapper specifically to fetch random songs!

Usage no npm install needed!

<script type="module">
  import chatandshareRandomSong from 'https://cdn.skypack.dev/@chatandshare/random-song';


Random Song API

MusixMatch API wrapper specifically to fetch random songs!


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


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");
  // Scroll down to see what kind of data you'll receive (in JSON)


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


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