# Spotify Playlist Scraper (`datahamster/spotify-playlist-scraper`) Actor

Spotify playlist scraper: every track of any public Spotify playlist, past the 100-track embed limit, with added date, play count, album, release date, BPM, musical key, explicit flag and preview URL. No login. Monitor mode returns tracks added to and removed from each playlist since the last run.

- **URL**: https://apify.com/datahamster/spotify-playlist-scraper.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 9 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.24 / 1,000 50 tracks

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spotify Playlist Scraper

Get every track of any public Spotify playlist as one row per track: position, track, artists, album, release date, the date it was added to the playlist, play count, duration, explicit flag, BPM, musical key and a 30-second preview link. Paste playlist links or IDs. No Spotify account, no API key. Turn on monitor mode and each run returns only the tracks that were added to or removed from your playlists since the last run.

**Try it:** the prefilled example returns 20 rows in about 5 seconds and costs about $0.003. Results cost $0.0028 per 50 tracks of a playlist, about $0.056 per 1,000 tracks.

Coverage limits: public playlists only. Preview links are filled for the first 100 tracks of each playlist. Spotify's web player data has no ISRC and no 0-100 popularity score, so neither is in the output; the exact play count is there instead. The owner's name is given only for playlists Spotify itself owns.

### Why this one

- **Added and removed tracks, per playlist.** Monitor mode returns only what changed since the last run: tracks added (`event: "added"`) and tracks removed (`event: "removed"`, with the position they had), with an optional webhook or Telegram message. Useful for playlist pitching, label and curator tracking. The most-used Spotify playlist actor in the Store has no monitor mode or change tracking in its input.
- **BPM, musical key and Camelot key on every track.** For DJs and curators sorting by tempo and harmonic mix: 750 of 751 tracks in a test run had them. They are not in the leader's output.
- **Whole playlists, 500 tracks per request.** A test run on 05.11.2026 read four playlists (Lofi Girl's 500, All Out 80s' 150, RapCaviar, Today's Top Hits) into 751 rows in 10 seconds (build 0.1.3). The embed widget other tools read stops at 100.
- **One flat row per track** with its position in the playlist, ready for a spreadsheet, instead of a track list nested inside one playlist row.
- **Unique tracks across playlists.** Set `dedupeTracks` and a list of playlists becomes a list of unique tracks.
- **Price:** $0.0028 per 50 tracks of a playlist (about $0.056 per 1,000 tracks), 30% below the leader's $0.004 per page, plus Apify platform usage (about $0.0003 per 50 tracks), no start fee.

### What you get

One row per playlist entry:

| playlistName | position | trackName | artists | addedAt | playCount | bpm | camelotKey |
|---|---|---|---|---|---|---|---|
| All Out 80s | 1 | Thriller | Michael Jackson | 2026-07-09 | 1,119,287,223 | 118.5 | 12A |
| All Out 80s | 2 | Take on Me | a-ha | 2026-07-09 | 2,987,107,641 | 84.4 | 11B |
| All Out 80s | 3 | Heaven Is A Place On Earth | Belinda Carlisle | 2026-07-09 | 806,859,892 | 122.9 | 12B |
| Lofi Girl - beats to relax/study to | 11 | mahogany | Enluv, Dom Lawrence, Homson | 2026-11-05 | 319,868 | 135.8 | 8B |
| Lofi Girl - beats to relax/study to | 251 | Rainy Seasons | anbuu | 2026-11-05 | 832,327 | 136.1 | 6A |

A full row:

```json
{
  "id": "0vvXsWCC9xrXsKd4FyS8kM:57f48547bcd7acc5",
  "url": "https://open.spotify.com/track/5EEuttO6cB90ei7zxnqVPT",
  "playlistId": "0vvXsWCC9xrXsKd4FyS8kM",
  "playlistName": "Lofi Girl - beats to relax/study to",
  "playlistUrl": "https://open.spotify.com/playlist/0vvXsWCC9xrXsKd4FyS8kM",
  "playlistDescription": "A daily selection of chill beats - perfect to help you relax & study 📚 Click here if you need lofi sleep 💤",
  "playlistFollowers": 7128485,
  "playlistTotalTracks": 500,
  "ownerName": null,
  "isSpotifyOwned": false,
  "isEditorial": false,
  "position": 11,
  "itemType": "track",
  "trackId": "5EEuttO6cB90ei7zxnqVPT",
  "trackName": "mahogany",
  "artists": ["Enluv", "Dom Lawrence", "Homson"],
  "artistIds": ["5g8EUiiIZDqp2xd9eUUHin", "2OXkJJTLJ7UhXEY3LnKalQ", "4tFyFMcMdlqK8b4RoADlS2"],
  "albumId": "79rSoGxgGA3ln0IrJuM761",
  "albumName": "Lofi Girl: Fall Collection 2026",
  "albumReleaseDate": "2026-09-28",
  "durationMs": 165050,
  "explicit": false,
  "playCount": 319868,
  "addedAt": "2026-11-05T03:00:39.956Z",
  "discNumber": 1,
  "trackNumber": 24,
  "isPlayable": true,
  "bpm": 135.8,
  "musicalKey": "C major",
  "camelotKey": "8B",
  "previewUrl": "https://p.scdn.co/mp3-preview/6a510f69e97376d7d87bf9de0386ca594646c7a2",
  "source": "pathfinder",
  "event": null,
  "scrapedAt": "2026-11-05T18:03:10.539222Z"
}
```

Fields: `playlistId`, `playlistName`, `playlistUrl`, `playlistDescription`, `playlistFollowers`, `playlistTotalTracks`, `playlistImageUrl`, `ownerName` (Spotify-owned playlists only), `isSpotifyOwned`, `isEditorial`, `position` (1-based), `itemType` (`track` or `episode`), `trackId`, `trackName`, `artists`, `artistIds`, `albumId`, `albumName`, `albumReleaseDate`, `albumCoverUrl`, `durationMs`, `explicit`, `playCount`, `addedAt` (UTC), `discNumber`, `trackNumber`, `isPlayable`, `bpm`, `musicalKey`, `camelotKey`, `previewUrl`, `source`, `event` (monitor mode), `url`, `scrapedAt`.

Who owns a playlist made by a private user, and who added each track, are not in the output: those are people. E-mail addresses and phone numbers in descriptions of playlists not owned by Spotify are removed.

### Input

| Field | Meaning | Default |
|---|---|---|
| `playlists` | Playlist links, `spotify:playlist:` URIs or 22-character IDs | All Out 80s |
| `maxTracksPerPlaylist` | Tracks to read from the top of each playlist, up to 10,000 | 1000 |
| `dedupeTracks` | Skip tracks an earlier playlist of the run already returned (scrape mode) | false |
| `maxItems` | Stop after this many rows in total | 1000 |
| `mode` | `scrape`, or `monitor` for added and removed tracks only | `scrape` |

### Monitor mode

Set `mode` to `monitor`, list your playlists and schedule the task (daily works well: many editorial playlists refresh once a day). The first run records each playlist's tracks and returns nothing (no result charges). Every later run reads each playlist in full and returns:

- tracks added since the last run, with `event: "added"` and all track fields;
- tracks removed since the last run, with `event: "removed"`, the track, artists, album and the position the track had.

A track moving up or down is not reported. Keep `maxTracksPerPlaylist` above the playlist's size: tracks are compared within that range, so a track pushed below it would look removed. Each monitor run costs one `monitor-check` event ($0.005) plus $0.001 per added or removed track; unchanged tracks cost nothing. Add `webhookUrl`, or `telegramBotToken` and `telegramChatId`, to get a message when something changed.

If a monitor run is killed and the next one ends with `overlapping_run`, wait for the killed run's timeout or start over with a new `monitorStateId`.

### Pricing

| Event | Price |
|---|---|
| result | $0.0028 per chunk of up to 50 tracks of one playlist (about $0.056 per 1,000 tracks) |
| monitor-check | $0.005 per monitor run |
| change | $0.001 per added or removed track in monitor mode |

Apify platform usage is billed to you separately; the actor runs without a proxy and with 512 MB, so it is small (751 rows used about $0.004 of platform usage in a test run). Rows stay one per track; a playlist's tracks are billed in chunks of 50, and its last chunk counts as one even when shorter (a 120-track playlist is 3 chunks, $0.0084). `maxItems` counts rows. A run that finds nothing pushes nothing and costs no result events.

### Limits

- Public playlists only. Private and collaborative-private playlists cannot be read without the owner's login.
- `previewUrl` is filled for the first 100 tracks of each playlist; Spotify has no preview for some tracks at all.
- No ISRC and no popularity score: Spotify's web player does not serve them. `playCount` is the exact all-time play count.
- `addedAt` is when the entry was added to the playlist. Editorial playlists are often rebuilt at once, so many tracks share one date.
- The actor reads the same data Spotify's web player loads. If Spotify changes it, the actor refreshes the query from the current web player automatically; if that fails, scrape mode falls back to the first 100 tracks from the embed widget (`source: "embed"`, fewer fields) and monitor mode skips the playlist for that run rather than reporting false removals.

### FAQ

**Can it read playlists with more than 100 tracks?** Yes. It reads 500 tracks per request and pages on, up to 10,000.

**Why is the owner empty for most playlists?** A playlist made by a user belongs to a person, so the actor gives the owner only for playlists Spotify owns. `isSpotifyOwned` and `isEditorial` say which kind it is.

**Can I find playlists by keyword?** Not in this version: paste the playlists you want to read.

### Changelog

- 0.1.3: billing per chunk of up to 50 tracks of one playlist ($0.0028 per chunk, about $0.056 per 1,000 tracks) instead of per track; rows stay one per track; `change` stays $0.001 per added or removed track.
- 0.1: first release. Every track of public playlists at 500 per request, with added date, play count, BPM, key and previews; monitor mode for added and removed tracks; dedupe across playlists.

### Related actors

- [YouTube Search Scraper](https://apify.com/datahamster/youtube-search-scraper): videos for a keyword, with views and channels.
- [TikTok Video Scraper](https://apify.com/datahamster/tiktok-video-scraper): video stats for TikTok links.
- [YouTube Transcript Scraper](https://apify.com/datahamster/youtube-transcript-scraper): full transcripts of YouTube videos.

***

If this actor saved you time, a short review on its Store page helps other people find it. Found a bug or need a field? Open a ticket on the **Issues** tab.

# Actor input Schema

## `maxItems` (type: `integer`):

Stop after this many rows in total across all playlists (you are charged only for pushed rows).

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## `playlists` (type: `array`):

Public playlists to read: links ("https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"), URIs ("spotify:playlist:...") or 22-character IDs, one per line. The same playlist listed twice is read once.

## `maxTracksPerPlaylist` (type: `integer`):

Read at most this many tracks of each playlist, from the top. Spotify playlists hold up to 10,000 tracks; 500 are read per request. In monitor mode added/removed tracks are detected within this range, so set it above the playlist's size.

## `dedupeTracks` (type: `boolean`):

Skip a track that an earlier playlist of this run already returned, so a list of playlists gives a list of unique tracks. Scrape mode only.

## Actor input object example

```json
{
  "maxItems": 20,
  "mode": "scrape",
  "playlists": [
    "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"
  ],
  "maxTracksPerPlaylist": 1000,
  "dedupeTracks": false
}
```

# Actor output Schema

## `results` (type: `string`):

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 20,
    "playlists": [
        "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"
    ],
    "maxTracksPerPlaylist": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/spotify-playlist-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "maxItems": 20,
    "playlists": ["https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"],
    "maxTracksPerPlaylist": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/spotify-playlist-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 20,
  "playlists": [
    "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"
  ],
  "maxTracksPerPlaylist": 1000
}' |
apify call datahamster/spotify-playlist-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datahamster/spotify-playlist-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KiEsCluMh0bHGtEkU/builds/15oxPt8D6KxO16QGB/openapi.json
