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_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
url | URL | one of | Spotify album URL. Accepted hosts: open.spotify.com, spotify.com, spotify.link. |
id | string | one of | Spotify 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:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.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"1import os2import requests34params = {5 "id": "5AEDGbliTTfjOB8TSm1sxt",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/spotify/album",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11)12body = res.json()1314if body["ok"]:15 print(body["data"])16else:17 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/spotify/album");2url.search = new URLSearchParams({3 "id": "5AEDGbliTTfjOB8TSm1sxt"4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape Spotify album",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/spotify/album",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "id",19 "value": "5AEDGbliTTfjOB8TSm1sxt"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
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.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The 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}Related endpoints#
- Spotify artist (
GET /v1/spotify/artist) - Spotify track (
GET /v1/spotify/track) - Spotify podcast (
GET /v1/spotify/podcast) - Spotify playlist (
GET /v1/spotify/playlist) - Spotify podcast episodes (
GET /v1/spotify/podcast/episodes) - Spotify search (
GET /v1/spotify/search)