# 🎧 Spotify Scraper (`scraper-engine/spotify-scraper`) Actor

🎧 Spotify Scraper extracts Spotify artist, track & playlist data fast and reliably. 🚀 Great for music research, data projects, playlists, and analytics—save time with automated scraping. 🔍📊

- **URL**: https://apify.com/scraper-engine/spotify-scraper.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Developer tools, Other, Automation
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🎧 Spotify Scraper — Artists, Tracks, Albums & Playlists

Search [Spotify](https://open.spotify.com) by keyword or scrape **artist, album, track, and playlist URLs** to get monthly listeners, play counts, followers, world rank, biographies, top tracks, related artists, and full track listings — in JSON, CSV, or Excel. **No Spotify login or API key needed.**

### 🤔 What does it do?

Spotify Scraper extracts rich, structured metadata from Spotify. It works in two modes:

- 🔗 **URL mode** — paste Spotify links (artists, albums, tracks, playlists) and get detailed data for each.
- 🔍 **Search mode** — search by keyword and get matching tracks, artists, albums, or playlists.

#### 📦 What data you get

| Entity | Highlights |
|--------|-----------|
| 🎤 **Artists** | Monthly listeners, followers, world rank, biography, image, top tracks (with play counts), related artists, external links (Instagram, Facebook, etc.) |
| 💿 **Albums** | Cover art, release date, label, full track listing with per-track play counts |
| 🎵 **Tracks** | Artists, album, duration, release date, play count, explicit flag, audio preview URL |
| 📋 **Playlists** | Owner, description, followers, cover image, full track listing with durations & play counts |

### ⭐ Why Choose Us?

- 🆓 **No API key** — works entirely from public Spotify data.
- 🧩 **Rich nested output** — artists ship with their top tracks & related artists; playlists ship with their full track listing.
- 🛡️ **Smart proxy ladder** — starts with a direct connection and only escalates to datacenter then residential proxies if Spotify blocks, keeping runs cheap and reliable.
- 📊 **Per-section tables** — browse artists, tracks, albums, and playlists each in their own view.
- ⚡ **Live results** — records appear in the output as they are collected.

### 🚀 How to Use (Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open **Spotify Scraper**.
3. Pick a **mode**:
   - 🔗 **Scrape by URL** → paste Spotify URLs.
   - 🔍 **Search by keyword** → enter queries and choose a result type.
4. (Optional) Set **Max results**, toggle audio previews / genres, or configure a proxy.
5. Click **Start** and watch results stream in live.
6. Open the **Output** tab — switch between the 🎧 All / 🎤 Artists / 🎵 Tracks / 💿 Albums / 📋 Playlists views.
7. Export to **JSON / CSV / XLSX**.

### 🧾 Input

```json
{
  "mode": "urls",
  "urls": [
    "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ],
  "maxResults": 50,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `mode` | string | `urls` or `search`. |
| `urls` | array | Spotify URLs (URL mode). Artist / album / track / playlist. |
| `searchTerms` | array | Keywords (search mode). |
| `searchType` | string | `tracks`, `artists`, `albums`, or `playlists` (search mode). |
| `maxResults` | integer | Max items per query / records per URL. |
| `includeAudioPreview` | boolean | Fetch 30s preview URLs for tracks. |
| `includeGenres` | boolean | Best-effort artist genres. |
| `enrichSearch` | boolean | Fetch extra detail per search hit. |
| `concurrency` | integer | Parallel requests. |
| `maxRetries` | integer | Retries before escalating the proxy. |
| `proxyConfiguration` | object | Proxy for the fallback tiers. |

### 📤 Output

An **artist** record (URL mode):

```json
{
  "type": "artist",
  "id": "06HL4z0CvFAxyc27GXpf02",
  "name": "Taylor Swift",
  "url": "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
  "imageUrl": "https://i.scdn.co/image/...",
  "monthlyListeners": 101992498,
  "followers": 159206573,
  "worldRank": 6,
  "genres": [],
  "biography": "…",
  "topTracks": [
    { "trackId": "…", "title": "The Fate of Ophelia", "artists": "Taylor Swift",
      "duration": 226073, "durationFormatted": "3:46", "playCount": 1451642910,
      "isExplicit": false, "isPlayable": true, "audioPreviewUrl": null }
  ],
  "relatedArtists": [ { "name": "Sabrina Carpenter", "id": "…", "url": "…" } ],
  "externalLinks": [ { "name": "INSTAGRAM", "url": "https://instagram.com/taylorswift" } ],
  "scrapedAt": "2026-06-17T07:38:00.575Z"
}
```

A **track** record (search mode):

```json
{
  "type": "track",
  "id": "5FVd6KXrgO9B3JPmC8OPst",
  "name": "Do I Wanna Know?",
  "artists": "Arctic Monkeys",
  "albumName": "AM",
  "albumArt": "https://i.scdn.co/image/...",
  "releaseDate": null,
  "duration": 272394,
  "durationFormatted": "4:32",
  "playCount": null,
  "isExplicit": false,
  "isPlayable": true,
  "audioPreviewUrl": null,
  "url": "https://open.spotify.com/track/5FVd6KXrgO9B3JPmC8OPst",
  "scrapedAt": "2026-06-17T06:41:35.457Z",
  "searchTerm": "arctic monkeys"
}
```

### 🤖 Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"urls","urls":["https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"],"maxResults":50}'
```

### 💡 Best Use Cases

- 🎵 **Music analytics** — track monthly listeners, play counts, and follower growth.
- 📊 **Playlist research** — analyze editorial and user playlists.
- 🎤 **Artist monitoring** — biographies, top tracks, and related artists.
- 🧠 **Recommendation datasets** — build catalogs of artists, tracks, and relationships.

### 💳 Pricing

This Actor uses a **pay-per-event** model. You are charged per **result item** delivered to the dataset, plus the standard Apify platform usage. Set **Max results** to control spend.

### ❓ FAQ

**Do I need a Spotify account or API key?** No. All data comes from public Spotify pages.

**Why is `genres` empty for some artists?** Spotify stopped exposing genres for many artists; the Actor fills it when available and leaves `[]` otherwise.

**Why is `audioPreviewUrl` null?** Many tracks simply have no 30-second preview on Spotify.

**Will it get blocked?** The Actor starts direct and automatically escalates to datacenter then residential proxies if Spotify pushes back.

### ⚖️ Legal & Compliance

This Actor collects only **publicly available** data. You are responsible for complying with Spotify's Terms of Service and applicable laws (GDPR, CCPA, etc.). Do not use scraped data to infringe copyright or for unlawful purposes.

### 🆘 Support & Feedback

Found a bug or want a new field? Open an issue on the Actor's **Issues** tab — feedback is welcome.

# Actor input Schema

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

Choose how to scrape. 🔗 URL mode pulls rich data from Spotify links. 🔍 Search mode finds items by keyword.

## `urls` (type: `array`):

One or more Spotify links — artist, album, track, or playlist (e.g. https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02). Bulk input supported.

## `searchTerms` (type: `array`):

Keywords to search on Spotify. Each query returns items of the selected search type.

## `searchType` (type: `string`):

Which kind of Spotify result to return in Search mode.

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

Maximum items per search query, or maximum records per URL, to collect.

## `includeAudioPreview` (type: `boolean`):

Fetch the 30-second audio preview URL for tracks (one extra request per track). Many tracks have no preview.

## `includeGenres` (type: `boolean`):

Best-effort genre tags for artists. Spotify leaves this empty for many artists.

## `enrichSearch` (type: `boolean`):

Fetch extra detail for each search hit (play counts, followers, release dates, etc.). Slower but far richer.

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

Proxy for the fallback tiers. The scraper starts with a direct connection (no proxy) and automatically switches to a datacenter proxy, then a residential proxy, only if Spotify starts blocking — then sticks with it.

## Actor input object example

```json
{
  "mode": "urls",
  "urls": [
    "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ],
  "searchTerms": [
    "arctic monkeys"
  ],
  "searchType": "tracks",
  "maxResults": 10,
  "includeAudioPreview": false,
  "includeGenres": false,
  "enrichSearch": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "mode": "urls",
    "urls": [
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
        "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
    ],
    "searchTerms": [
        "arctic monkeys"
    ],
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/spotify-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 = {
    "mode": "urls",
    "urls": [
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
        "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M",
    ],
    "searchTerms": ["arctic monkeys"],
    "maxResults": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

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

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

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

```

## CLI example

```bash
echo '{
  "mode": "urls",
  "urls": [
    "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ],
  "searchTerms": [
    "arctic monkeys"
  ],
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scraper-engine/spotify-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraper-engine/spotify-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8YrCDRMRwbFZzSp0b/builds/fyivtbkjagFn5QdfT/openapi.json
