Spotify playlist API
  1. Docs
  2. Spotify
  3. Spotify playlist API

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_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 playlist URL. Accepted hosts: open.spotify.com, spotify.com, spotify.link.
idstringone ofSpotify 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: 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/playlist" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "id=37i9dQZF1DX4UtSsGT1Sbe"

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_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.

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_4859afa56f5410054468e1ce"10}