# Spotify Scraper (`sourabhbgp/spotify-scraper`) Actor

Scrape Spotify artists, tracks, albums and playlists. Get monthly listeners, top tracks, track lists, preview URLs. HTTP-only, fast, reliable. 100 free results.

- **URL**: https://apify.com/sourabhbgp/spotify-scraper.md
- **Developed by:** [Sourabh Kumar](https://apify.com/sourabhbgp) (community)
- **Categories:** Social media, Marketing
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 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.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 — 100 Free | Artists, Tracks, Albums & Playlists

Extract structured data from Spotify with zero browser overhead — this actor uses HTTP-only requests, making it the fastest and cheapest Spotify scraper on Apify. Supports 4 modes: **artist**, **track**, **album**, and **playlist**, all powered by Spotify's embed SSR endpoint and Googlebot SEO pages.

---

### 🎵 What data can you extract?

#### Artist mode
- Name, Spotify ID, profile image URL
- Monthly listeners (live, from SEO page)
- Genres, top tracks (up to 10)
- Each top track: name, duration, preview URL, track URI

#### Track mode
- Name, Spotify ID, track URI
- Artist names (array)
- Album name, album image
- Duration (milliseconds)
- Release date (YYYY-MM-DD)
- Preview URL (30-second MP3)
- Explicit flag

#### Album mode
- Name, Spotify ID, album URI
- Artist name
- Release date
- Total track count
- Full track listing: name, duration, track number, preview URL, explicit flag

#### Playlist mode
- Name, Spotify ID, playlist URI
- Description, owner name
- Follower / save count (live, from SEO page)
- Up to 50 tracks: name, artists, duration, album name, preview URL, explicit flag

---

### 💡 Use cases

1. **Music market research** — Track monthly listener trends across hundreds of artists to spot emerging talent before mainstream coverage.
2. **Playlist monitoring** — Monitor follower counts on competitor playlists or editorial playlists to understand what drives playlist saves over time.
3. **Artist analytics** — Pull top-track data and preview URLs in bulk for A&R teams, music supervisors, or sync licensing databases.
4. **Track metadata collection** — Build or enrich a music database with duration, release date, explicit flags, and artist associations — no Spotify API key required.
5. **Album cataloguing** — Scrape full track listings for discography databases, music journalism tools, or streaming analytics platforms.
6. **Competitor benchmarking** — Compare monthly listeners and top tracks across a roster of competing artists for label strategy or marketing reports.
7. **Content pipeline automation** — Feed Spotify metadata into downstream tools (Google Sheets, Airtable, webhooks) for automated newsletter generation, social posts, or editorial calendars.

---

### 💰 How much does it cost?

| Tier | Price |
|------|-------|
| First 100 results | **Free** (lifetime, not per month) |
| After 100 results | **$3.00 per 1,000 results** ($0.003/result) |
| Platform compute | ~$0.10–$0.50 per 1,000 results |

**Example:** scraping 500 artists costs $1.20 in actor fees (first 100 are free, so you pay for 400 × $0.003) plus a small platform compute fee.

No subscription. No monthly minimum. Pay only for what you use.

---

### 📥 Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `mode` | string | No | `"artist"` | One of: `artist`, `track`, `album`, `playlist` |
| `spotifyUrls` | string[] | No | `[]` | List of Spotify URLs, URIs, or bare IDs |
| `maxResults` | number | No | `10` | Maximum number of results to return |

**Example input:**

```json
{
  "mode": "artist",
  "spotifyUrls": [
    "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4",
    "spotify:artist:06HL4z0CvFAxyc27GXpf02",
    "1Xyo4u8uXC1ZmMpatF05PJ"
  ],
  "maxResults": 5
}
````

***

### 📤 Output

Each result is pushed to the default dataset. Example output for **artist mode** (Drake):

```json
{
  "type": "artist",
  "id": "3TVXtAsR1Inumwj472S9r4",
  "name": "Drake",
  "uri": "spotify:artist:3TVXtAsR1Inumwj472S9r4",
  "imageUrl": "https://i.scdn.co/image/ab6761610000e5eb...",
  "monthlyListeners": 88000000,
  "genres": ["canadian hip hop", "rap"],
  "topTracks": [
    {
      "id": "1zi7xx7UVEFkmKfv06H8x0",
      "name": "One Dance",
      "uri": "spotify:track:1zi7xx7UVEFkmKfv06H8x0",
      "durationMs": 173986,
      "previewUrl": "https://p.scdn.co/mp3-preview/..."
    }
  ]
}
```

***

### 💡 Tips

#### URL formats accepted

All three formats work for any entity type:

- Full URL: `https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4`
- Spotify URI: `spotify:artist:3TVXtAsR1Inumwj472S9r4`
- Bare ID: `3TVXtAsR1Inumwj472S9r4` (requires `mode` to be set correctly)

#### Rate limits

This actor uses public Spotify embed and Googlebot SEO endpoints. There are no API keys or OAuth tokens involved. At normal scraping speeds (sequential requests), no rate limiting has been observed. Do not run hundreds of concurrent requests — the actor processes entities sequentially by design.

#### What is NOT available

- **Play counts per track** — not exposed in any public endpoint; requires Spotify partner API access
- **Follower counts for artists** — Spotify hides this from public pages (monthly listeners is available instead)
- **Search** — this actor resolves known URLs/IDs, it does not search Spotify by keyword
- **Podcast / episode data** — only music entities (artists, tracks, albums, playlists) are supported

#### Daily health test behavior

Apify runs a daily health test by sending an empty `{}` input. The actor defaults to `mode: "artist"` with Drake's ID and `maxResults: 1` when no input is provided, ensuring the daily test always passes cleanly.

# Actor input Schema

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

What to scrape. Auto-detected from URL if not set.

## `spotifyUrls` (type: `array`):

Spotify URLs, URIs, or raw IDs. Examples: https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4, spotify:artist:3TVXtAsR1Inumwj472S9r4, or just 3TVXtAsR1Inumwj472S9r4

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

Maximum number of entities to scrape. 0 = unlimited.

## Actor input object example

```json
{
  "mode": "artist",
  "spotifyUrls": [
    "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"
  ],
  "maxResults": 50
}
```

# Actor output Schema

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

Scraped Spotify data.

# 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": "artist",
    "spotifyUrls": [
        "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sourabhbgp/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": "artist",
    "spotifyUrls": ["https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"],
}

# Run the Actor and wait for it to finish
run = client.actor("sourabhbgp/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": "artist",
  "spotifyUrls": [
    "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"
  ]
}' |
apify call sourabhbgp/spotify-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Spotify Scraper",
        "description": "Scrape Spotify artists, tracks, albums and playlists. Get monthly listeners, top tracks, track lists, preview URLs. HTTP-only, fast, reliable. 100 free results.",
        "version": "0.0",
        "x-build-id": "EqflPfwkdgv3quE3t"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sourabhbgp~spotify-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sourabhbgp-spotify-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/sourabhbgp~spotify-scraper/runs": {
            "post": {
                "operationId": "runs-sync-sourabhbgp-spotify-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/sourabhbgp~spotify-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-sourabhbgp-spotify-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "artist",
                            "track",
                            "album",
                            "playlist"
                        ],
                        "type": "string",
                        "description": "What to scrape. Auto-detected from URL if not set.",
                        "default": "artist"
                    },
                    "spotifyUrls": {
                        "title": "Spotify URLs or IDs",
                        "type": "array",
                        "description": "Spotify URLs, URIs, or raw IDs. Examples: https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4, spotify:artist:3TVXtAsR1Inumwj472S9r4, or just 3TVXtAsR1Inumwj472S9r4",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of entities to scrape. 0 = unlimited.",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
