As I'm currently working with the endpoint Get Current User's Saved Tracks I've noticed a peculiar issue. Tracks in the JSON response are in the wrong order in relation to the limit and offset parameters (compared to any Spotify app).
This is easily reproducible, at least on my account.
The issue appears when multiple/all tracks of an album are saved. So either through Like all songs in the mobile app, or selecting all tracks (Ctrl+A) and saving them in the Desktop/Web app.
Requesting the above mentioned endpoint returns tracks in reverse 'Date added' order, except when 'cutting off' an album. In this case the tracks of the album are not only not correctly ordered, but seem to be picked randomly from the selection of saved tracks of the album.
Here's an example with example data:
- saved_pos: position in actual saved tracks UI (ordered by Date added)
- album_pos: position of track in album, not shown for single tracks in this example
- track_name: name of the track
Note: the songs from the album were saved all at the same time i.e. added_at is the same timestamp
| saved_pos | album_pos | track_name |
| 1 | - | Your Power |
| 2 | - | Heartbreak Anniversary |
| 3 | - | deja vu |
| 4 | 1 | thousand eyes |
| 5 | 2 | home with you |
| 6 | 3 | sad day |
| 7 | 4 | holy terrain |
| 8 | 5 | mary magdalene |
| 9 | 6 | fallen alien |
| 10 | 7 | mirrored heart |
| 11 | 8 | daybed |
| 12 | 9 | cellophane |
| 13 | - | We're Good |
| 14 | - | Arcade |
| 15 | - | Streets |
Sending a request to the API (https://api.spotify.com/v1/me/tracks) with parameters limit=15 offset=0 returns exactly the order as above.
Sending another request with limit=9 offset=0 returns:
| saved_pos | album_pos | track_name |
| 1 | - | Your Power |
| 2 | - | Heartbreak Anniversary |
| 3 | - | Levitating |
| 4 | 6 | fallen alien |
| 5 | 8 | daybed |
| 6 | 1 | thousand eyes |
| 7 | 9 | cellophane |
| 8 | 7 | mirrored heart |
| 9 | 4 | holy terrain |
Evidently, tracks are both in the wrong order and a different selection. The same phenomenon appears 'from the other side' so when using the parameters limit=10 offset=7. It also happens when using limit=50 (the maximum), anywhere in the saved tracks library, as long as it partially intersects a saved album.