# Spotify Playlist Scraper (Tracks, Artists, Previews) (`webdatatools/spotify-playlist-scraper`) Actor

Scrape Spotify playlists, albums and artist top tracks: track name, artists, duration, Spotify URI, preview link and cover, from the public Spotify embed pages.

- **URL**: https://apify.com/webdatatools/spotify-playlist-scraper.md
- **Developed by:** [Murat Uzun](https://apify.com/webdatatools) (community)
- **Categories:** Other, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 tracks

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 Scraper (Tracks, Artists, Previews)

### What is Spotify Playlist Scraper?

Spotify Playlist Scraper reads public Spotify playlists, albums and artist pages and returns one row per track: track name, artists, duration, Spotify track id and URI, a 30-second preview link and the playlist cover. It works from the public embed pages that Spotify serves for each playlist, album and artist, so no Spotify login or API key is needed.

Use it to build playlist datasets, track lists for music research, preview-link libraries, or lists of an artist's top tracks. The embed pages have limits (see below): playlists and albums are cut at 50 tracks, and an artist page shows 10 top tracks.

### What data does Spotify Playlist Scraper extract?

| Field | Type | Meaning |
|---|---|---|
| kind | string | playlist, album or artist |
| sourceId | string | Spotify id of the playlist, album or artist |
| sourceName | string or null | Playlist, album or artist name |
| sourceUrl | string | Spotify page of the source |
| sourceOwner | string or null | Playlist owner as shown on the page (Spotify for editorial playlists) |
| sourceTrackCount | number | Tracks on the embed page (50 cap for playlists and albums, 10 for artists) |
| sourceCoverUrl | string or null | Cover image (playlists only, on the embed page) |
| position | number | Track position on the source page |
| trackId | string or null | Spotify track id |
| trackUri | string or null | Spotify track URI, e.g. spotify:track:... |
| trackName | string or null | Track title |
| artists | string or null | Artist line as shown on the page |
| durationMs | number or null | Track length in milliseconds |
| explicit | boolean or null | Explicit flag |
| playable | boolean or null | Playable flag as shown on the page |
| previewUrl | string or null | 30-second MP3 preview link |
| scrapedAt | string | ISO timestamp of the scrape |

### How to use Spotify Playlist Scraper

1. Paste one or more links into "Spotify links", one per line: a playlist, album or artist URL, or a spotify:playlist:... URI.
2. Set "Max tracks" (default 100) for the total number of rows.
3. Start the run, then download the dataset or read it through the API.

### Example input

```json
{
    "links": [
        "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M",
        "spotify:album:1DFixLWuPkv3KT3TnV35m3",
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
    ],
    "maxResults": 100
}
```

### Example output

Real row from a run on 23 Oct 2026 (first track of Spotify's "Today's Top Hits"):

```json
{
    "kind": "playlist",
    "sourceId": "37i9dQZF1DXcBWIGoYBM5M",
    "sourceName": "Today’s Top Hits",
    "sourceUrl": "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M",
    "sourceOwner": "Spotify",
    "sourceTrackCount": 50,
    "sourceCoverUrl": "https://i.scdn.co/image/ab67706f00000002e8ccdd567fff6a597b87586b",
    "position": 1,
    "trackId": "2sFepQNyl1WjpROruP8bJ0",
    "trackUri": "spotify:track:2sFepQNyl1WjpROruP8bJ0",
    "trackName": "Housewife",
    "artists": "Tate McRae",
    "durationMs": 208810,
    "explicit": false,
    "playable": true,
    "previewUrl": "https://p.scdn.co/mp3-preview/724b097d9dc53e0541de27d199adfe3f610944ba",
    "scrapedAt": "2026-10-23T10:31:45.842Z"
}
```

### Input parameters

| Parameter | Default | Description |
|---|---|---|
| links | Today's Top Hits playlist | Playlist, album or artist links or URIs, one per line |
| maxResults | 100 | Total track rows per run, 1 to 1,000 |

### Pricing

Pay per track: **$1.00 per 1,000 tracks** on the free plan ($0.001 per track). Volume tiers lower the price on paid Apify plans.

Measured on 23 Oct 2026 at 256 MB: a run for 75 tracks (one 50-track playlist, one 15-track album, one 10-track artist page) used $0.001 of platform usage in 7 seconds. A second run for 30 tracks used $0.000. The CLI prints usage to three decimals, so these are rounded figures.

### Spotify Playlist Scraper vs. alternatives

The Spotify Web API returns full playlists with OAuth, but it needs your own developer app and token, and its terms limit some uses. This Actor needs no token and reads only the public embed pages, so it returns less: at most 50 tracks per playlist or album, and 10 per artist, with no album cover or release date per track.

### Using Spotify Playlist Scraper with AI agents / MCP

An agent sends `links` and `maxResults` and reads the track rows. For playlists longer than 50 tracks, the agent should say that the result is the first 50, not the whole playlist.

### FAQ

**Is this legal?** The Actor reads the public embed pages that Spotify publishes for websites to show a player. It does not log in and does not use a private API. Check Spotify's terms for your use. Preview links are 30-second clips for listening, not for redistribution.

**Why do I get only 50 tracks from a long playlist?** Spotify's embed page lists the first 50 tracks. In a test on 23 Oct 2026, three playlists (Today's Top Hits, Top 50 - Global, RapCaviar) all returned exactly 50 tracks. The embed page does not expose more tracks, so the Actor cannot page further.

**Why are there only 10 tracks for an artist?** The artist embed page shows the artist's top tracks, 10 at a time.

**Why is sourceCoverUrl empty for album and artist rows?** The album and artist embed pages in the test carried no cover field the Actor reads. Playlist covers are present.

**Can I call it from n8n, Make or Zapier?** Those tools can start any Apify Actor through their Apify integrations. This was not tested for this Actor.

**What about errors and limits?** A link that Spotify does not serve (private, removed or not a playlist, album or artist) is reported in the log and skipped. The run fails only when no track is collected.

### Related Actors

Other Actors from the same publisher are listed on its Apify profile.

### Support

Open an issue on the Actor's Issues tab on Apify. Include the run ID, the links you used and the log lines.

### Limitations

- Playlists and albums are capped at 50 tracks; artists at 10.
- Spotify can change the embed page layout; the parser was checked on 23 Oct 2026.
- Previews are 30-second MP3 links from Spotify's CDN and may not exist for every track (previewUrl is null then).
- Track data is what the embed page shows. Full metadata such as ISRC, album release date and popularity is not included.

# Actor input Schema

## `links` (type: `array`):

Playlist, album or artist links, one per line, e.g. https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M or spotify:album:1DFixLWuPkv3KT3TnV35m3. Spotify embed pages list up to 50 tracks per playlist or album and 10 per artist.

## `maxResults` (type: `integer`):

Maximum track rows in total, e.g. 100. Each source adds at most 50 (playlists and albums) or 10 (artists) rows.

## Actor input object example

```json
{
  "links": [
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ],
  "maxResults": 100
}
```

# Actor output Schema

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

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,webdatatools/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/dRJ5D1Vnf2deErKbU/builds/bKdqEcGHlpgg9PVsG/openapi.json
