Skip to content

Commit 4356671

Browse files
authored
Updated README
1 parent 002a772 commit 4356671

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

api/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33

44
This module depends on `librespot-core` and provides an API to interact with the Spotify client.
55

6-
## How it works
7-
This API uses JSON over Websocket according to the [JSON-RPC 2.0 standard](https://www.jsonrpc.org/specification). Three method prefixes are available:
8-
- `player`, just a placeholder
9-
- `metadata`, allows to retrieve some useful data about tracks and playlist (more to come)
10-
- `mercury`, allows to send requests with Mercury directly, therefore all URIs must start with `hm://`
11-
12-
## Client
13-
You can find a suitable client [here](https://github.com/librespot-org/librespot-java/tree/master/api-client).
6+
## Available endpoints
7+
8+
- `POST \player\load` Load a track from a given uri. The request body should contain two parameters: `uri` and `play`.
9+
- `POST \player\pause` Pause playback.
10+
- `POST \player\resume` Resume playback.
11+
- `POST \player\next` Skip to next track.
12+
- `POST \player\prev` Skip to previous track.
13+
- `POST \player\set-volume` Set volume to a given `volume` value from 0 to 65536.
14+
- `POST \player\volume-up` Up the volume a little bit.
15+
- `POST \player\volume-down` Lower the volume a little bit.
16+
17+
## Example
18+
19+
`curl -X POST -d "uri=spotify:track:xxxxxxxxxxxxxxxxxxxxxx&play=true" http://localhost:24879/player/load`
20+

0 commit comments

Comments
 (0)