Gets the current song playing on Spotify
Works on Windows, Mac, and Linux with the desktop spotify client.
const playing = require('spotify-playing')
setInterval(playing, 1000, (err, now) => {
if (err)
// Platform not supported
// Cannot find Spotify process
// Nothing playing on Spotify
return console.error(err)
// { artist: 'The Fratellis', song: 'Chelsea Dagger' }
console.log(now)
})
- If playing on another device you first might need to switch to this device and switch the song.
- Close and reopen Spotify