-
Notifications
You must be signed in to change notification settings - Fork 12
/
api-spec.yml
255 lines (254 loc) · 7.42 KB
/
api-spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
openapi: 3.0.0
info:
version: 0.0.13
title: go-librespot API
description: go-librespot daemon API
components:
schemas:
track:
description: A track
type: object
properties:
uri:
description: URI
type: string
name:
description: Name
type: string
artist_names:
description: Artists name
type: array
items:
- description: Artist name
type: string
album_name:
description: Album name
type: string
album_cover_url:
description: Album cover URL
type: string
duration:
description: Duration in milliseconds
type: integer
paths:
/:
get:
description: Returns an empty object, used to very API is reachable
responses:
200:
description: API is ok
content:
application/json:
schema:
type: object
/status:
get:
description: Returns the player status
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
username:
description: Currently active account's username
type: string
device_id:
description: The player device ID
type: string
device_name:
description: The player device name
type: string
play_origin:
description: Who started the playback, "go-librespot" identifies the API as the play origin, everything else is Spotify own stuff
type: string
stopped:
description: Whether the player is stopped
type: boolean
paused:
description: Whether the player is paused
type: boolean
buffering:
description: Whether the player is buffering
type: boolean
volume:
description: The player current volume from 0 to max
type: number
minimum: 0
volume_steps:
description: The player max volume value
type: number
repeat_context:
description: Whether the repeat context feature is enabled
type: boolean
repeat_track:
description: Whether the repeat track feature is enabled
type: boolean
shuffle_context:
description: Whether the shuffle context feature is enabled
type: boolean
track:
$ref: '#/components/schemas/track'
/player/play:
post:
description: Starts playing new content
requestBody:
content:
application/json:
schema:
type: object
properties:
uri:
description: Spotify URI to start playing
type: string
required: true
skip_to_uri:
description: Spotify URI to skip to (when playing playlists)
type: string
required: false
paused:
description: Start playback as paused
type: boolean
required: false
responses:
200:
description: Successful response
/player/resume:
post:
description: Resume playback (from paused state)
responses:
200:
description: Successful response
/player/pause:
post:
description: Pause playback (from playing state)
responses:
200:
description: Successful response
/player/next:
post:
description: Skip to next track
responses:
200:
description: Successful response
/player/prev:
post:
description: Skip to previous track (or rewind current track)
responses:
200:
description: Successful response
/player/seek:
post:
description: Seek current track
requestBody:
content:
application/json:
schema:
type: object
properties:
position:
description: Seek position in milliseconds
type: integer
required: true
responses:
200:
description: Successful response
/player/volume:
get:
description: Get player volume
responses:
200:
description: Returns the player volume settings
content:
application/json:
schema:
type: object
properties:
value:
type: integer
description: The current volume, ranging from 0 to max
max:
type: integer
description: The max volume value
post:
description: Set player volume
requestBody:
content:
application/json:
schema:
type: object
properties:
volume:
description: Volume from 0 to max
type: number
minimum: 0
required: true
responses:
200:
description: Successful response
/player/repeat_context:
post:
description: Toggle repeating context
requestBody:
content:
application/json:
schema:
type: object
properties:
repeat_context:
description: Whether repeating context should be enabled
type: boolean
required: true
responses:
200:
description: Successful response
/player/repeat_track:
post:
description: Toggle repeating track
requestBody:
content:
application/json:
schema:
type: object
properties:
repeat_track:
description: Whether repeating track should be enabled
type: boolean
required: true
responses:
200:
description: Successful response
/player/shuffle_context:
post:
description: Toggle shuffling context
requestBody:
content:
application/json:
schema:
type: object
properties:
shuffle_context:
description: Whether shuffling context should be enabled
type: boolean
required: true
responses:
200:
description: Successful response
/player/add_to_queue:
post:
description: Add a track to the queue
requestBody:
content:
application/json:
schema:
type: object
properties:
uri:
description: The URI for the track that should be added
type: string
required: true
responses:
200:
description: Successful response