Spotify album API
  1. Docs
  2. Spotify
  3. Spotify album API

Spotify album API

The album with its tracks (up to 200), label, copyright and release date.

GET /v1/spotify/album

GET /v1/spotify/album

The album with its tracks (up to 200), label, copyright and release date.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLone ofSpotify album URL. Accepted hosts: open.spotify.com, spotify.com, spotify.link.
idstringone ofSpotify album id.

Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/spotify/album" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "id=5AEDGbliTTfjOB8TSm1sxt"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_29f4e13231054599921cc3e1",8  "data": {9    "object": "album",10    "platform": "spotify",11    "id": "5AEDGbliTTfjOB8TSm1sxt",12    "url": "https://open.spotify.com/album/5AEDGbliTTfjOB8TSm1sxt",13    "title": "Speak Now (Taylor's Version)",14    "artists": [15      "Taylor Swift"16    ],17    "released_at": "2023-07-07",18    "track_count": 22,19    "cover_url": "https://i.scdn.co/image/ab67616d0000b2730b04da4f224b51ff86e0a481",20    "label": "Taylor Swift",21    "tracks": [22      {23        "object": "song",24        "platform": "spotify",25        "id": "7G0gBu6nLdhFDPRLc0HdDG",26        "url": "https://open.spotify.com/track/7G0gBu6nLdhFDPRLc0HdDG",27        "title": "Mine (Taylor's Version)",28        "artists": [29          "Taylor Swift"30        ],31        "album": "Speak Now (Taylor's Version)",32        "duration_seconds": 231.706,33        "cover_url": "https://i.scdn.co/image/ab67616d0000b2730b04da4f224b51ff86e0a481",34        "preview_url": null,35        "released_at": "2023-07-07",36        "isrc": null,37        "explicit": false,38        "is_original": null,39        "stats": {40          "plays": 296875369,41          "uses": null,42          "likes": null43        },44        "extra": {45          "album_id": "5AEDGbliTTfjOB8TSm1sxt",46          "artist_ids": [47            "06HL4z0CvFAxyc27GXpf02"48          ],49          "disc_number": 1,50          "playable": true,51          "track_number": 1,52          "uri": "spotify:track:7G0gBu6nLdhFDPRLc0HdDG",53          "video_count": 054        }55      },56      {57        "object": "song",58        "platform": "spotify",59        "id": "3MytWN8L7shNYzGl4tAKRp",60        "url": "https://open.spotify.com/track/3MytWN8L7shNYzGl4tAKRp",61        "title": "Sparks Fly (Taylor’s Version)",62        "artists": [63          "Taylor Swift"64        ],65        "album": "Speak Now (Taylor's Version)",66        "duration_seconds": 261.23,67        "cover_url": "https://i.scdn.co/image/ab67616d0000b2730b04da4f224b51ff86e0a481",68        "preview_url": null,69        "released_at": "2023-07-07",70        "isrc": null,71        "explicit": false,72        "is_original": null,73        "stats": {74          "plays": 197955576,75          "uses": null,76          "likes": null77        },78        "extra": {79          "album_id": "5AEDGbliTTfjOB8TSm1sxt",80          "artist_ids": [81            "06HL4z0CvFAxyc27GXpf02"82          ],83          "disc_number": 1,84          "playable": true,85          "track_number": 2,86          "uri": "spotify:track:3MytWN8L7shNYzGl4tAKRp",87          "video_count": 088        }89      },90      {91        "object": "song",92        "platform": "spotify",93        "id": "79uDOz0zuuWS7HWxzMmTa2",94        "url": "https://open.spotify.com/track/79uDOz0zuuWS7HWxzMmTa2",95        "title": "Back To December (Taylor's Version)",96        "artists": [97          "Taylor Swift"98        ],99        "album": "Speak Now (Taylor's Version)",100        "duration_seconds": 294.189,101        "cover_url": "https://i.scdn.co/image/ab67616d0000b2730b04da4f224b51ff86e0a481",102        "preview_url": null,103        "released_at": "2023-07-07",104        "isrc": null,105        "explicit": false,106        "is_original": null,107        "stats": {108          "plays": 319451738,109          "uses": null,110          "likes": null111        },112        "extra": {113          "album_id": "5AEDGbliTTfjOB8TSm1sxt",114          "artist_ids": [115            "06HL4z0CvFAxyc27GXpf02"116          ],117          "disc_number": 1,118          "playable": true,119          "track_number": 3,120          "uri": "spotify:track:79uDOz0zuuWS7HWxzMmTa2",121          "video_count": 0122        }123      }124    ],125    "extra": {126      "artist_ids": [127        "06HL4z0CvFAxyc27GXpf02"128      ],129      "artist_urls": [130        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"131      ],132      "copyright": [133        "© 2023 Taylor Swift",134        "℗ 2023 Taylor Swift"135      ],136      "disc_count": 1,137      "is_pre_release": false,138      "more_albums_by_artist": [139        {140          "cover_url": "https://i.scdn.co/image/ab67616d0000b273cf3de6b538d8b1ed73a4d5d1",141          "id": "4hF2gTGuPYlykYuphDxi8J",142          "release_date": "2026",143          "release_date_precision": "YEAR",144          "title": "The Life of a Showgirl: The Encore",145          "type": "album",146          "url": "https://open.spotify.com/album/4hF2gTGuPYlykYuphDxi8J"147        },148        {149          "cover_url": "https://i.scdn.co/image/ab67616d0000b273d7812467811a7da6e6a44902",150          "id": "4a6NzYL1YHRUgx9e3YZI6I",151          "release_date": "2025",152          "release_date_precision": "YEAR",153          "title": "The Life of a Showgirl",154          "type": "album",155          "url": "https://open.spotify.com/album/4a6NzYL1YHRUgx9e3YZI6I"156        },157        {158          "cover_url": "https://i.scdn.co/image/ab67616d0000b273e787cffec20aa2a396a61647",159          "id": "1NAmidJlEaVgA3MpcPFYGq",160          "release_date": "2019",161          "release_date_precision": "YEAR",162          "title": "Lover",163          "type": "album",164          "url": "https://open.spotify.com/album/1NAmidJlEaVgA3MpcPFYGq"165        }166      ],167      "playable": true,168      "release_date": "2023-07-07T00:00:00Z",169      "release_date_precision": "DAY",170      "type": "album",171      "uri": "spotify:album:5AEDGbliTTfjOB8TSm1sxt"172    }173  },174  "cursor": null,175  "has_more": null176}

Response#

A Album object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "not_found",5    "message": "The platform says this profile, post or item does not exist.",6    "retryable": false7  },8  "credits_charged": 0,9  "request_id": "req_c003e3caa49c54ac1c1b9d8d"10}