summaryrefslogtreecommitdiff
path: root/json/stations.rst
blob: b8e782168714c8234c0f465983438f9a6571d7d3 (plain)
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
.. _stations:

Stations
========

A *station* is a collection of one or more user-supplied *seeds*. Artists or
tracks can be used as seed. Based on the seeds Pandora decides which music to
play.

.. _user-getStationList:

Retrieve station list
---------------------

:Method: user.getStationList

.. csv-table::
    :header: Name ,Type ,Description

    includeStationArtUrl ,boolean ,Includes "artUrl" field in result (optional)
    stationArtSize,string,“W130H130”
    includeAdAttributes,boolean,(optional)
    includeStationSeeds,boolean,(optional)
    includeShuffleInsteadOfQuickMix,boolean,(optional)
    includeRecommendations,boolean,(optional)
    includeExplanations,boolean,(optional)

.. code:: json

    {
       "userAuthToken": "XXX",
       "syncTime": XXX
    }

Currently stationId and stationToken are the same.

QuickMix stations additionally include a list of station ids
(quickMixStationIds) that are currently selected for the mix.

.. csv-table::
    :header: Name ,Type ,Description

    stations.stationId,string,
    stations.stationName,string,
    checksum,string,

.. code:: json

    {
            "stat":"ok",
            "result":{
               "stations":[
                  {
                     "suppressVideoAds":true,
                     "isQuickMix":true,
                     "stationId":"3914377363925265",
                     "stationDetailUrl":"https://www.pandora.com/login?target=%2Fstations%2Fa61985110ea3d6c6c8d8a9c038588b26425ba2910f7abf8b",
                     "isShared":false,
                     "dateCreated":{
                        "date":8,
                        "day":4,
                        "hours":22,
                        "minutes":44,
                        "month":10,
                        "nanos":241000000,
                        "seconds":46,
                        "time":1194590686241,
                        "timezoneOffset":480,
                        "year":107
                     },
                     "stationToken":"3914377363925265",
                     "stationName":"QuickMix",
                     "stationSharingUrl":"https://www.pandora.com/login?target=%2Fshare%2Fstation%2Fa61985110ea3d6c6c8d8a9c038588b26425ba2910f7abf8b",
                     "requiresCleanAds":true,
                     "allowRename":false,
                     "allowAddMusic":false,
                     "quickMixStationIds":[
                        "339646069607180561",
                        "339644480469281041"
                     ],
                     "allowDelete":false
                  }
               ],
               "checksum":"99776ddd31ad798895578593e78e3691"
            }
         }

.. _user-getStationListChecksum:

Check station list for modifications
------------------------------------

:Method: user.getStationListChecksum

To check if the station list was modified by another client the checksum can be
fetched. No parameters are required for this request.

The response contains the new checksum.

.. csv-table::
    :header: Name,Type,Description

    checksum,string,

.. code:: json

    {
        "stat":"ok",
         "result":{
              "checksum":"99776ddd31ad798895578593e78e3691"
         }
     }

Add new station
---------------

New stations can be created by searching for an artist/song or using a track
from a playlist.

.. _music-search:

Search
^^^^^^

:Method: music.search

This is a free text search that matches artist and track names.

.. csv-table::
    :header: Name ,Type ,Description

    searchText ,string ,Artist name or track title

.. code:: json

    {
        "searchText": "encore",
        "userAuthToken": "XXX",
        "syncTime": 1335869287
    }

Matching songs and artists are returned in two separate list.

.. csv-table::
    :header: Name ,Type ,Description

    songs.musicToken and artists.musicToken ,string ,

.. code:: json

    {
        "stat": "ok",
        "result": {
            "nearMatchesAvailable": true,
            "explanation": "",
            "songs": [{
                "artistName": "Jason DeRulo",
                "musicToken": "S1508963",
                "songName": "Encore",
                "score": 100
            }],
            "artists": [{
                "artistName": "Encore",
                "musicToken": "R175304",
                "likelyMatch": false,
                "score": 100
            }]
        }
    }

.. _station-createStation:

Create
^^^^^^

:Method: station.createStation

Stations can either be created with a musicToken obtained by
:ref:`music-search` or trackToken from playlists (:ref:`station-getPlaylist`).
The latter needs a musicType to specify whether the track itself or its artist
should be used as seed.

.. csv-table::
   :header: Name,Type,Description

   trackToken,string,See :ref:`station-getPlaylist`
   musicType,string,“song” or “artist”
   musicToken,string,See :ref:`music-search`

.. _station-addMusic:

Add seed
--------

:Method: station.addMusic

:ref:`music-search` results can be used to add new seeds to an existing
station.

.. csv-table::
   :header: Name,Type,Description

   stationToken,string,"Existing station, see :ref:`user-getStationList`"
   musicToken,string,"See :ref:`music-search`"

.. _station-renameStation:

Rename station
--------------

:Method: station.renameStation

.. csv-table::
   :header: Name,Type,Description

   stationToken,string,"Existing station, see :ref:`user-getStationList`"
   stationName,string,New station name

.. _station-deleteStation:

Delete station
--------------

:Method: station.deleteStation

.. csv-table::
   :header: Name,Type,Description

   stationToken,string,"Existing station, see :ref:`user-getStationList`"

.. _station-getGenreStations:

Predefined stations
-------------------

:Method: station.getGenreStations

Pandora provides a list of predefined stations (“genre stations”). The request
has no parameters.

Each station belongs to one category, usually a genre name. stationToken can be
used as musicToken to create a new station with :ref:`station-createStation`.

.. csv-table::
    :header: Name ,Type ,Description

    categories ,array ,List of categories
    categories.stations ,array ,List of stations in category
    categories.stations.stationToken,string,"Actually a musicToken, see :ref:`station-createStation`"
    catogories.categoryName,string,Category name

.. code:: json

    {
        "stat": "ok",
        "result": {
            "categories": [{
                "stations": [{
                    "stationToken": "G165",
                    "stationName": "90s Alternative ",
                    "stationId": "G165"
                }],
                "categoryName": "Alternative"
            }]
        }
    }

.. _user-setQuickMix:

Modify QuickMix
---------------

:Method: user.setQuickMix

.. csv-table::
    :header: Name ,Type ,Description

    quickMixStationIds ,array ,List of station id’s (strings)

.. code:: json

    {
        "quickMixStationIds": ["404958383414849005", "403387202773593581"],
        "userAuthToken": "XXX",
        "syncTime": 1338211186
    }

The response contains no data.