https://github.com/simonbs/spotify-controls-api
Simple API for controlling Spotify from other services.
https://github.com/simonbs/spotify-controls-api
Last synced: 6 months ago
JSON representation
Simple API for controlling Spotify from other services.
- Host: GitHub
- URL: https://github.com/simonbs/spotify-controls-api
- Owner: simonbs
- Created: 2016-03-19T14:56:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-19T15:05:07.000Z (over 10 years ago)
- Last Synced: 2025-02-05T17:38:51.105Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spotify-controls-api
A dead simple API for controlling Spotify from other services.
This tiny API is useful for integration into other services, e.g. [openHAB](http://github.com/openhab/openhab-distro) if you are into home automation. The API can easily be integrated into openHAB using either the [HTTP Binding](https://github.com/openhab/openhab/wiki/Http-Binding) or the [Exec binding](https://github.com/openhab/openhab/wiki/Exec-Binding).
## Features
This simple API allows you to control Spotify running on an OS X machine using a simple API which you can communicate with using HTTP.
The following commands are supported:
- Play
- Pause
- Play/pause, i.e. toggling between the two.
- Next track
- Previous track
- Retrieving artist name and track name for the current track.
## Usage
Run the Node.js app using `node app.js`. The API will be available on `localhost:3000`.
You can issue the following requests. E.g. `PUT localhost:3000/next` to skip to the next track.
| HTTP Method | Resource |
|-------------|--------------------------------
| PUT | /play |
| PUT | /pause |
| PUT | /playpause |
| PUT | /next |
| PUT | /previous |
| GET | /current |
The API is backed by an Apple Script which sends the commands to Spotify.