Spotify playlist API
A public playlist's tracks, 50 a page; `parent` is the playlist.
GET /v1/spotify/playlist
GET /v1/spotify/playlist
A public playlist's tracks, 50 a page; parent is the playlist. Pass the cursor back until it is null.
- 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 playlist URL. Accepted hosts: open.spotify.com, spotify.com, spotify.link. |
id | string | one of | Spotify playlist 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:
cursor: the cursor from the previous page (Pagination).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/playlist" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "id=37i9dQZF1DX4UtSsGT1Sbe"1import os2import requests34params = {5 "id": "37i9dQZF1DX4UtSsGT1Sbe",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/spotify/playlist",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/playlist");2url.search = new URLSearchParams({3 "id": "37i9dQZF1DX4UtSsGT1Sbe"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 playlist",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/playlist",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "id",19 "value": "37i9dQZF1DX4UtSsGT1Sbe"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_b30e35c1d5168cb158179ba4",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "song",13 "platform": "spotify",14 "id": "2LlQb7Uoj1kKyGhlkBf9aC",15 "url": "https://open.spotify.com/track/2LlQb7Uoj1kKyGhlkBf9aC",16 "title": "Thriller",17 "artists": [18 "Michael Jackson"19 ],20 "album": "Thriller",21 "duration_seconds": 358.807,22 "cover_url": "https://i.scdn.co/image/ab67616d0000b27332a7d87248d1b75463483df5",23 "preview_url": null,24 "released_at": "1982-11-30",25 "isrc": null,26 "explicit": false,27 "is_original": null,28 "stats": {29 "plays": 1101594236,30 "uses": null,31 "likes": null32 },33 "extra": {34 "added_at": "2026-07-09T14:06:14.326Z",35 "album_id": "2ANVost0y2y52ema1E9xAZ",36 "artist_ids": [37 "3fMbdgg4jU18AjLCKBhRSm"38 ],39 "audio_attributes": {40 "bpm": 118.4749984741211,41 "key": {42 "camelotKey": {43 "color": "#56eff2",44 "value": "12A"45 },46 "key": "C#",47 "mode": "MODE_MINOR"48 }49 },50 "disc_number": 1,51 "playable": true,52 "track_number": 4,53 "uri": "spotify:track:2LlQb7Uoj1kKyGhlkBf9aC",54 "video_count": 155 }56 },57 {58 "object": "song",59 "platform": "spotify",60 "id": "2WfaOiMkCvy7F5fcp2zZ8L",61 "url": "https://open.spotify.com/track/2WfaOiMkCvy7F5fcp2zZ8L",62 "title": "Take on Me",63 "artists": [64 "a-ha"65 ],66 "album": "Hunting High and Low",67 "duration_seconds": 225.28,68 "cover_url": "https://i.scdn.co/image/ab67616d0000b273e8dd4db47e7177c63b0b7d53",69 "preview_url": null,70 "released_at": "1985-06-01",71 "isrc": null,72 "explicit": false,73 "is_original": null,74 "stats": {75 "plays": 2979495144,76 "uses": null,77 "likes": null78 },79 "extra": {80 "added_at": "2026-07-09T14:06:14.326Z",81 "album_id": "1ER3B6zev5JEAaqhnyyfbf",82 "artist_ids": [83 "2jzc5TC5TVFLXQlBNiIUzE"84 ],85 "audio_attributes": {86 "bpm": 84.41200256347656,87 "key": {88 "camelotKey": {89 "color": "#56d9f8",90 "value": "11B"91 },92 "key": "A",93 "mode": "MODE_MAJOR"94 }95 },96 "disc_number": 1,97 "playable": true,98 "track_number": 1,99 "uri": "spotify:track:2WfaOiMkCvy7F5fcp2zZ8L",100 "video_count": 1101 }102 }103 ],104 "cursor": "eyJvIjo1MH0",105 "has_more": true,106 "parent": {107 "object": "collection",108 "platform": "spotify",109 "id": "37i9dQZF1DX4UtSsGT1Sbe",110 "url": "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe",111 "kind": "playlist",112 "title": "All Out 80s",113 "description": "The biggest songs of the 1980s. Cover: Michael Jackson",114 "owner": {115 "id": "spotify",116 "handle": "spotify",117 "name": "Spotify",118 "url": "https://open.spotify.com/user/spotify",119 "avatar_url": "https://i.scdn.co/image/ab6775700000ee8555c25988a6ac314394d3fbf5",120 "verified": null121 },122 "item_count": 150,123 "cover_url": "https://i.scdn.co/image/ab67706f000000028c767aab2034bb8fafd33124",124 "updated_at": null,125 "extra": {126 "followers": 12060235,127 "format": "editorial",128 "uri": "spotify:playlist:37i9dQZF1DX4UtSsGT1Sbe"129 }130 }131 },132 "cursor": "eyJvIjo1MH0",133 "has_more": true134}Response#
A list of Song objects in data.items, with data.cursor and data.has_more.
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_4859afa56f5410054468e1ce"10}Related endpoints#
- Spotify artist (
GET /v1/spotify/artist) - Spotify album (
GET /v1/spotify/album) - Spotify track (
GET /v1/spotify/track) - Spotify podcast (
GET /v1/spotify/podcast) - Spotify podcast episodes (
GET /v1/spotify/podcast/episodes) - Spotify search (
GET /v1/spotify/search)