Spotify album API
A Spotify album with artists, label, release date, copyrights and every track with its play count.
GET /v1/spotify/albums/{id}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/spotify/albums/4aawyAB9vmqN3uQ7FjRGTy",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "album": { "id": "4aawyAB9vmqN3uQ7FjRGTy", "name": "Global Warming", "type": "album", "album_type": "album", "uri": "spotify:album:4aawyAB9vmqN3uQ7FjRGTy", "external_urls": { "spotify": "https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy" }, "images": [ { "url": "https://i.scdn.co/image/ab67616d0000b2732c5b24ecfa39523a75c993c4", "height": 640, "width": 640 }, { "url": "https://i.scdn.co/image/ab67616d00001e022c5b24ecfa39523a75c993c4", "height": 300, "width": 300 }, "… 1 more" ], "release_date": "2012-11-16", "release_date_precision": "day", "total_tracks": 18, "label": "Mr.305/Polo Grounds Music/RCA Records", "artists": [ { "id": "0TnOYISbd1XYRBk9myaseg", "name": "Pitbull", "type": "artist", "uri": "spotify:artist:0TnOYISbd1XYRBk9myaseg", "external_urls": { "spotify": "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg" }, "images": [ { "url": "https://i.scdn.co/image/ab6761610000e5eb700606d9484bcfff3fba700d", "height": 640, "width": 640 }, { "url": "https://i.scdn.co/image/ab67616100005174700606d9484bcfff3fba700d", "height": 320, "width": 320 }, "… 1 more" ] } ], "copyrights": [ { "text": "(P) 2012 RCA Records, a division of Sony Music Entertainment", "type": "P" } ], "tracks": { "items": [ { "id": "6OmhkSOpvYBokMKQxpIGx2", "name": "Global Warming (feat. Sensato)", "type": "track", "uri": "spotify:track:6OmhkSOpvYBokMKQxpIGx2", "external_urls": { "spotify": "https://open.spotify.com/track/6OmhkSOpvYBokMKQxpIGx2" }, "duration_ms": 85400, "explicit": true, "disc_number": 1, "track_number": 1, "is_playable": true, "artists": [ { "…": "5 fields" }, { "…": "5 fields" } ], "album": null, "playcount": 10836176 }, { "id": "2iblMMIgSznA464mNov7A8", "name": "Don't Stop the Party (feat. TJR)", "type": "track", "uri": "spotify:track:2iblMMIgSznA464mNov7A8", "external_urls": { "spotify": "https://open.spotify.com/track/2iblMMIgSznA464mNov7A8" }, "duration_ms": 206120, "explicit": false, "disc_number": 1, "track_number": 2, "is_playable": true, "artists": [ { "…": "5 fields" }, { "…": "5 fields" } ], "album": null, "playcount": 304420644 }, "… 16 more" ], "total": 18 } }}Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string | A Spotify album id, spotify:album: URI, or open.spotify.com/album/ link (URL-encoded). Example: 4aawyAB9vmqN3uQ7FjRGTy. |
Response fields
200 with a SpotifyAlbumResponse, in the shape of the Spotify Web API’s own objects.
| Field | Type | Description |
|---|---|---|
album | SpotifyAlbum | A simplified album. |
Status codes
| Status | Meaning |
|---|---|
200 | The album with its tracks. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Spotify object by that id, or it is not public. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Spotify is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How many tracks?
Up to 500.
Spotify is a trademark of Spotify AB. We are not affiliated with or endorsed by Spotify.