# Spotify Playlist & Track Metadata Scraper (`fanndev/spotify-playlist-track-scraper`) Actor

Export any Spotify playlist to JSON, CSV or Excel: every track with artists, album, release date, duration, cover art and Spotify's real lifetime PLAY COUNT - a number the official API never publishes. Optional ISRC and popularity lookup. No Spotify account or API key needed.

- **URL**: https://apify.com/fanndev/spotify-playlist-track-scraper.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/fanndev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 & Track Metadata Scraper

Turn any Spotify playlist into a spreadsheet: every track with its artists,
album, release date, duration, cover art — and **`playcount`**, Spotify's real
lifetime stream count for that recording, which its official API does not
publish at all.

Built for curators, DJs, labels and content teams who need playlist contents
*outside* Spotify: to migrate a playlist to another platform, to analyse what a
tastemaker is actually playing, or to keep a catalogue in sync.

No Spotify account, no developer app, no API key, no browser.

***

### What you get per track

| Field | Notes |
| --- | --- |
| **`playcount`** | Lifetime streams for this recording. **Not available in Spotify's official API** |
| `trackName`, `artistName`, `artistNames`, `artists` | Title and every credited artist, with ids and links |
| `albumName`, `albumUrl`, `releaseDate` | The release this recording sits on |
| `duration`, `durationMs` | `3:32` and `212879` |
| `position`, `addedAt` | Where it sits in the playlist and when it was added |
| `explicit`, `playable`, `discNumber`, `trackNumber` | Content and sequencing flags |
| `trackId`, `trackUri`, `trackUrl`, `coverArt` | Stable identifiers plus the largest cover image |
| `isrc`, `popularity`, `previewUrl` | Only when **ISRC enrichment** is on — see below |

Plus one **`PLAYLIST`** row per playlist: name, description, follower count,
owner, cover art, and — for Spotify's own editorial charts — `lastUpdated`,
`rankType` and `newEntriesCount`.

***

### Quick start

```json
{
  "playlistUrls": ["https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"],
  "maxTracksPerPlaylist": 1000,
  "exportFormats": ["csv"]
}
```

Share links with a `?si=` tail, `/intl-id/` localised links, `spotify:playlist:`
URIs and bare ids are all accepted. Individual songs go in `trackUrls` and come
back with the **record label** and copyright lines as a bonus.

***

### About ISRC and the popularity score

These two fields are **off by default**, and it is worth knowing why.

Spotify's playlist API does not carry them. They exist on exactly one endpoint
an anonymous client can reach — Spotify's search endpoint — so each track needs
its own extra request. That endpoint is also the only rate-limited surface
involved: after a few dozen lookups it starts refusing, and **the refusal
follows your IP for roughly 20 hours**, not your session.

So:

- Leave `enrichWithIsrc` off for ordinary playlist exports. You still get
  `playcount`, which is the more useful number for most work.
- Turn it on when you genuinely need ISRC (royalty matching, radio reporting,
  cross-platform linking), keep `maxIsrcLookups` modest, and **enable the
  proxy** so the rate limit does not land on a shared address.
- If the limit is hit mid-run, enrichment stops and everything else still
  completes. Affected rows are marked `isrcLookup: "skipped-quota"` rather than
  silently left blank.

`isrcLookup` always tells you how solid the match is: `exact` means the very
same recording id, `title-artist` means the same song but possibly a different
release — which can carry a **different ISRC**.

***

### Cost

One request per 100 tracks, plus one to pick up an anonymous token. A 50-track
playlist is two requests; a 1 000-track playlist is eleven. ISRC enrichment adds
one request per track on top.

***

### Limits worth knowing

- **Private and follower-only playlists are not readable.** They come back as a
  `not_found` error row, the same as a deleted playlist — Spotify does not
  distinguish them from outside.
- **Playlists can contain podcast episodes and local files.** Those are skipped
  rather than emitted as empty rows; track `position` still reflects the real
  playlist order.
- **Spotify issues a separate track id per release.** The same song can appear
  under several ids with different play counts. `trackUri` is what identifies
  the exact recording in the playlist.

***

### Output

Every run writes to the Apify dataset. Set `exportFormats` to also drop a
ready-made `spotify-playlist-tracks.csv`, `.xlsx`, `.json` or `.ndjson` into the
run's key-value store.

See [CRAWLING_METHOD.md](CRAWLING_METHOD.md) for how the data is obtained.

# Actor input Schema

## `playlistUrls` (type: `array`):

Spotify playlists to read. Share links (with or without the ?si= tail), localised /intl-xx/ links, spotify:playlist: URIs and bare playlist ids all work. Editorial playlists such as Top 50 - Global are readable too.

## `trackUrls` (type: `array`):

Single tracks to look up, for when you already know the songs and only want their metadata. Each one costs a single request and returns the same columns as a playlist track, plus the record label and copyright lines.

## `startUrls` (type: `array`):

Playlist and track links mixed together, for callers that keep one list. Each entry is routed by what it points at.

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

Stop after this many tracks from each playlist. Spotify serves 100 tracks per request, so a 1000-track playlist costs 10 requests.

## `includePlaylistRecord` (type: `boolean`):

Emit one PLAYLIST record per playlist carrying its name, description, follower count, owner and cover art, alongside the TRACK records. Turn this off if you only want the songs.

## `enrichWithIsrc` (type: `boolean`):

ISRC and Spotify's 0-100 popularity score are not part of the playlist payload. They exist only on Spotify's search endpoint, so each track needs its own extra request. That endpoint also rate-limits by IP: after a few dozen lookups it starts refusing for about 20 hours, and enrichment then stops for the rest of the run while everything else still completes. Leave this off unless you specifically need ISRC, and enable the proxy when you do. Playcount - Spotify's real lifetime stream count, which the official API never exposes - is always included either way.

## `maxIsrcLookups` (type: `integer`):

Hard ceiling on the extra search requests when ISRC enrichment is on, so a large playlist cannot burn the daily search allowance in one run. Tracks beyond it are marked not-attempted.

## `market` (type: `string`):

Two-letter country code used when looking up ISRC and popularity. It decides which release of a song Spotify considers available, so set it to the market you actually care about.

## `exportFormats` (type: `array`):

Besides the dataset, write ready-made files into this run's key-value store. Nested fields become dotted columns in the tabular formats.

## `proxyConfiguration` (type: `object`):

Off by default, and genuinely optional: none of the Spotify endpoints this actor reads has a WAF or an IP block, so the platform's own address reaches all of them. Turn it on if you enable ISRC enrichment, which is rate-limited per IP.

## Actor input object example

```json
{
  "playlistUrls": [
    "https://open.spotify.com/playlist/37i9dQZEVXbMDoHDwVN2tF"
  ],
  "maxTracksPerPlaylist": 1000,
  "includePlaylistRecord": true,
  "enrichWithIsrc": false,
  "maxIsrcLookups": 200,
  "market": "US",
  "exportFormats": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Every track, each playlist summary and any error records from this run.

# 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 = {
    "playlistUrls": [
        "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fanndev/spotify-playlist-track-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 = { "playlistUrls": ["https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"] }

# Run the Actor and wait for it to finish
run = client.actor("fanndev/spotify-playlist-track-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 '{
  "playlistUrls": [
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ]
}' |
apify call fanndev/spotify-playlist-track-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fanndev/spotify-playlist-track-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/mpVCbleVSaKTNJrfM/builds/XvUHBsoIfys3WEwIE/openapi.json
