Docs menu

Spotify playlist

Beta 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
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • 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).

curl
curl -G "https://api.socialscrape.io/v1/spotify/playlist" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "id=37i9dQZF1DX4UtSsGT1Sbe"
Python
import os
import requests

params = {
    "id": "37i9dQZF1DX4UtSsGT1Sbe",
}
res = requests.get(
    "https://api.socialscrape.io/v1/spotify/playlist",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/spotify/playlist");
url.search = new URLSearchParams({
  "id": "37i9dQZF1DX4UtSsGT1Sbe"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape Spotify playlist",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/spotify/playlist",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "37i9dQZF1DX4UtSsGT1Sbe"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Example response#

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

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_b30e35c1d5168cb158179ba4",
  "data": {
    "object": "list",
    "items": [
      {
        "object": "song",
        "platform": "spotify",
        "id": "2LlQb7Uoj1kKyGhlkBf9aC",
        "url": "https://open.spotify.com/track/2LlQb7Uoj1kKyGhlkBf9aC",
        "title": "Thriller",
        "artists": [
          "Michael Jackson"
        ],
        "album": "Thriller",
        "duration_seconds": 358.807,
        "cover_url": "https://i.scdn.co/image/ab67616d0000b27332a7d87248d1b75463483df5",
        "preview_url": null,
        "released_at": "1982-11-30",
        "isrc": null,
        "explicit": false,
        "is_original": null,
        "stats": {
          "plays": 1101594236,
          "uses": null,
          "likes": null
        },
        "extra": {
          "added_at": "2026-07-09T14:06:14.326Z",
          "album_id": "2ANVost0y2y52ema1E9xAZ",
          "artist_ids": [
            "3fMbdgg4jU18AjLCKBhRSm"
          ],
          "audio_attributes": {
            "bpm": 118.4749984741211,
            "key": {
              "camelotKey": {
                "color": "#56eff2",
                "value": "12A"
              },
              "key": "C#",
              "mode": "MODE_MINOR"
            }
          },
          "disc_number": 1,
          "playable": true,
          "track_number": 4,
          "uri": "spotify:track:2LlQb7Uoj1kKyGhlkBf9aC",
          "video_count": 1
        }
      },
      {
        "object": "song",
        "platform": "spotify",
        "id": "2WfaOiMkCvy7F5fcp2zZ8L",
        "url": "https://open.spotify.com/track/2WfaOiMkCvy7F5fcp2zZ8L",
        "title": "Take on Me",
        "artists": [
          "a-ha"
        ],
        "album": "Hunting High and Low",
        "duration_seconds": 225.28,
        "cover_url": "https://i.scdn.co/image/ab67616d0000b273e8dd4db47e7177c63b0b7d53",
        "preview_url": null,
        "released_at": "1985-06-01",
        "isrc": null,
        "explicit": false,
        "is_original": null,
        "stats": {
          "plays": 2979495144,
          "uses": null,
          "likes": null
        },
        "extra": {
          "added_at": "2026-07-09T14:06:14.326Z",
          "album_id": "1ER3B6zev5JEAaqhnyyfbf",
          "artist_ids": [
            "2jzc5TC5TVFLXQlBNiIUzE"
          ],
          "audio_attributes": {
            "bpm": 84.41200256347656,
            "key": {
              "camelotKey": {
                "color": "#56d9f8",
                "value": "11B"
              },
              "key": "A",
              "mode": "MODE_MAJOR"
            }
          },
          "disc_number": 1,
          "playable": true,
          "track_number": 1,
          "uri": "spotify:track:2WfaOiMkCvy7F5fcp2zZ8L",
          "video_count": 1
        }
      }
    ],
    "cursor": "eyJvIjo1MH0",
    "has_more": true,
    "parent": {
      "object": "collection",
      "platform": "spotify",
      "id": "37i9dQZF1DX4UtSsGT1Sbe",
      "url": "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe",
      "kind": "playlist",
      "title": "All Out 80s",
      "description": "The biggest songs of the 1980s. Cover: Michael Jackson",
      "owner": {
        "id": "spotify",
        "handle": "spotify",
        "name": "Spotify",
        "url": "https://open.spotify.com/user/spotify",
        "avatar_url": "https://i.scdn.co/image/ab6775700000ee8555c25988a6ac314394d3fbf5",
        "verified": null
      },
      "item_count": 150,
      "cover_url": "https://i.scdn.co/image/ab67706f000000028c767aab2034bb8fafd33124",
      "updated_at": null,
      "extra": {
        "followers": 12060235,
        "format": "editorial",
        "uri": "spotify:playlist:37i9dQZF1DX4UtSsGT1Sbe"
      }
    }
  },
  "cursor": "eyJvIjo1MH0",
  "has_more": true
}

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:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_4859afa56f5410054468e1ce"
}