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 | 3 months ago | TypeScript | |||||||
A full stack Next.js, Golang fun project for broadcasting music from Spotify in respective rooms. |
Spotify WebSocket Activity API Library
Sactivity has two exports, Sactivity and SpotifyClient.
PUT https://api.spotify.com/v1/me/notifications/user?connection_id=${connectionID}
to subscribe to activity on the account associated with the connection ID, and by relation, the authorization you provided.POST https://guc-spclient.spotify.com/track-playback/v1/devices
and temporarily registers a fake Spotify Web Client that will receive notifications from Spotify.PUT https://guc-spclient.spotify.com/connect-state/v1/devices/hobs_${clientID}
and subscribes to media player events.Event Name | Description | Data Type |
---|---|---|
volume | Emitted whenever the volume has changed | number |
playing | Emitted whenever music is playing again | void |
stopped | Emitted whenever music is stopped | void |
paused | Emitted whenever music is paused | void |
resumed | Emitted whenever music is resumed | void |
track | Emitted whenever a new track is playing | SpotifyTrack |
options | Emitted whenever playback options have changed (shuffle, repeat, repeat-one) | PlaybackOptions |
position | Emitted whenever the position in a song has changed. This includes at the start of a new track. | string |
device | Emitted whenever the device that is playing music has changed. | SpotifyDevice |
close | Emitted whenever the WebSocket has closed. This is a cue to reconnect after a set amount of time. | void |
In the tests folder, you can find a working example.
Data types are declared here
Sactivity works off of cookies issued by Spotify upon login, which seem to persist for quite a while. Here's how to obtain the cookies needed:
cookie
header in the Request headers.