Node Spotify Web

Node.js implementation of the Spotify Web protocol
Alternatives To Node Spotify Web
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Node Spotify Web63972146 years ago11December 11, 201450mitJavaScript
Node.js implementation of the Spotify Web protocol
Spotify Websocket Api389
8 years ago16Python
Spotify Websocket API is a fully open source Spotify library based on the WebSocket API used in the Spotify Web beta
Spotify Connect Ws46
5 years agoJavaScript
A Socket.IO plugin for interfacing with Spotify's Connect API using WebSockets.
Sactivity12
a year ago7gpl-3.0TypeScript
Spotify WebSocket Activity API Library
Along10
5 years agoTypeScript
🎙Your Spotify playlists with voice interface. 🔬Empathy and the Web Speech Recognition API.
Musicpage9
6 years agoCSS
Python powered music controlling webpage with websockets and bottle py (works with spotify, vlc, audacious, and others)
Tuneswitch7
2 years agoDart
An app that switches music listened by users according to location
Stream Stuff6
2 years agoPython
Stream layout written with ember
Spotify Rooms5
a year ago18mitTypeScript
👂 Listen to Spotify together (WIP)
Spotify Rooms4
2 months agoTypeScript
A full stack Next.js, Golang fun project for broadcasting music from Spotify in respective rooms.
Alternatives To Node Spotify Web
Select To Compare


Alternative Project Comparisons
Readme

node-spotify-web

Node.js implementation of the Spotify Web protocol

This module implements the "Spotify Web" WebSocket protocol that is used on Spotify's Web UI.

This module is heavily inspired by the original open-source Python implementation: Hexxeh/spotify-websocket-api.

Installation

$ npm install spotify-web

Example

Here's an example of logging in to the Spotify server and creating a session. Then requesting the metadata for a given track URI, and playing the track audio file through the speakers:

var lame = require('lame');
var Speaker = require('speaker');
var Spotify = require('spotify-web');
var uri = process.argv[2] || 'spotify:track:6tdp8sdXrXlPV6AZZN2PE8';

// Spotify credentials...
var username = process.env.USERNAME;
var password = process.env.PASSWORD;

Spotify.login(username, password, function (err, spotify) {
  if (err) throw err;

  // first get a "Track" instance from the track URI
  spotify.get(uri, function (err, track) {
    if (err) throw err;
    console.log('Playing: %s - %s', track.artist[0].name, track.name);

    // play() returns a readable stream of MP3 audio data
    track.play()
      .pipe(new lame.Decoder())
      .pipe(new Speaker())
      .on('finish', function () {
        spotify.disconnect();
      });

  });
});

See the example directory for some more example code.

API

TODO: document!

License

(The MIT License)

Copyright (c) 2013-2014 Nathan Rajlich <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Popular Spotify Projects
Popular Websocket Projects
Popular Media Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Javascript
Websocket
Spotify
Websocket Api