Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Node Spotify Web | 639 | 72 | 14 | 6 years ago | 11 | December 11, 2014 | 50 | mit | JavaScript | |
Node.js implementation of the Spotify Web protocol | ||||||||||
Spotify Websocket Api | 389 | 8 years ago | 16 | Python | ||||||
Spotify Websocket API is a fully open source Spotify library based on the WebSocket API used in the Spotify Web beta | ||||||||||
Spotify Connect Ws | 46 | 5 years ago | JavaScript | |||||||
A Socket.IO plugin for interfacing with Spotify's Connect API using WebSockets. | ||||||||||
Sactivity | 12 | a year ago | 7 | gpl-3.0 | TypeScript | |||||
Spotify WebSocket Activity API Library | ||||||||||
Along | 10 | 5 years ago | TypeScript | |||||||
🎙Your Spotify playlists with voice interface. 🔬Empathy and the Web Speech Recognition API. | ||||||||||
Musicpage | 9 | 6 years ago | CSS | |||||||
Python powered music controlling webpage with websockets and bottle py (works with spotify, vlc, audacious, and others) | ||||||||||
Tuneswitch | 7 | 2 years ago | Dart | |||||||
An app that switches music listened by users according to location | ||||||||||
Stream Stuff | 6 | 2 years ago | Python | |||||||
Stream layout written with ember | ||||||||||
Spotify Rooms | 5 | a year ago | 18 | mit | TypeScript | |||||
👂 Listen to Spotify together (WIP) | ||||||||||
Spotify Rooms | 4 | 2 months ago | TypeScript | |||||||
A full stack Next.js, Golang fun project for broadcasting music from Spotify in respective rooms. |
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.
$ npm install spotify-web
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.
TODO: document!
(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.