# Spotify Metadata Scraper (`fascinating_lentil/spotify-metadata-scraper`) Actor

Extract public Spotify metadata from tracks, artists, albums, playlists, shows, and episodes, including names, dates, durations, images, URLs, and nested tracks. No login or API key required.

- **URL**: https://apify.com/fascinating\_lentil/spotify-metadata-scraper.md
- **Developed by:** [Md Jakaria Mirza](https://apify.com/fascinating_lentil) (community)
- **Categories:** Automation, Developer tools, Social media
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 spotify items

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 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 Metadata Scraper

Extract structured public metadata from Spotify tracks, artists, albums, playlists, podcast shows, and episodes. Provide Spotify web URLs or `spotify:` URIs and receive clean dataset rows ready for catalog enrichment, playlist research, podcast indexing, reporting, and automation.

No Spotify login or API key is required. The Actor reads public Spotify embed data and does not download full audio.

### Quick start

Run this one-item example:

```json
{
  "startUrls": [
    "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC"
  ],
  "maxItems": 1,
  "maxConcurrency": 1,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

The result can be exported as JSON, CSV, Excel, XML, or HTML, or consumed through the Apify API, webhooks, Make, Zapier, n8n, or other integrations.

### What you can scrape

- Tracks
- Artists and their public top-track lists
- Albums and their public track lists
- Playlists and up to 50 publicly exposed tracks
- Podcast shows
- Podcast episodes
- Spotify web URLs and `spotify:` URIs

### Output fields

Each requested Spotify item produces one dataset row.

| Group | Fields |
| --- | --- |
| Identity | `sourceUrl`, `url`, `spotifyUri`, `type`, `resolvedType`, `id`, `name` |
| Context | `subtitle`, `artists`, `authors`, `releaseDate` |
| Playback | `durationMs`, `durationText`, `explicit`, `playable`, `playabilityReason`, `previewUrl` |
| Media | `imageUrl`, `images` |
| Nested content | `trackCount`, `tracksMayBePartial`, `tracks`, `featuredItem` |
| Audit | `scrapedAt` |

Nested track rows include position, type, Spotify ID and URI, URL, name, subtitle, duration, explicit flag, playability, and preview URL when Spotify exposes one.

### Verified sample output

This shortened example comes from a successful public Actor run:

```json
{
  "sourceUrl": "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
  "url": "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
  "spotifyUri": "spotify:track:4uLU6hMCjMI75M1A2tKUQC",
  "type": "track",
  "resolvedType": "track",
  "id": "4uLU6hMCjMI75M1A2tKUQC",
  "name": "Never Gonna Give You Up",
  "artists": [
    {
      "name": "Rick Astley",
      "uri": "spotify:artist:0gxyHStUsqpMadRV0Di1Qt",
      "url": "https://open.spotify.com/artist/0gxyHStUsqpMadRV0Di1Qt"
    }
  ],
  "releaseDate": "1987-11-12T00:00:00Z",
  "durationMs": 213573,
  "durationText": "3:33",
  "explicit": false,
  "playable": true,
  "trackCount": 0,
  "tracksMayBePartial": false,
  "scrapedAt": "2026-06-11T08:05:21.284Z"
}
```

Values can change when Spotify updates its public metadata. Optional fields may be `null`.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `startUrls` | array | One sample track | Spotify web URLs or `spotify:` URIs, one per line |
| `maxItems` | integer | `1` | Maximum number of unique inputs to process, from 1 to 10,000 |
| `maxConcurrency` | integer | `1` | Parallel Spotify requests, from 1 to 20 |
| `proxyConfiguration` | object | Proxy off | Optional Apify Proxy configuration |

Duplicate Spotify items are processed once. Unsupported and failed inputs are written to the separate `failed-urls` dataset.

### Common workflows

#### Resolve a mixed Spotify list

Paste track, artist, album, playlist, show, and episode URLs together. The `type` and `resolvedType` fields make the output easy to filter.

#### Enrich a music catalog

Join canonical Spotify IDs, artist references, release dates, durations, images, and public preview URLs to an internal catalog.

#### Monitor playlists or artist pages

Schedule repeated runs and compare nested `tracks` arrays over time. Playlist embeds may expose only the first 50 tracks.

#### Index public podcast metadata

Collect show or episode names, authors, publish dates, images, and preview links where available.

### Pricing

This Actor uses Pay Per Event pricing.

| Event | Price |
| --- | ---: |
| Actor start | $0.00005 |
| Each successfully saved `spotify-item` | $0.0015 |

Nested tracks are included in the parent item charge. Failed inputs are not charged as `spotify-item` events. The Actor stops taking new work when the run reaches the user's maximum-cost limit.

### Limits and reliability

- Public Spotify embed data can change without notice.
- Playlist embeds currently expose at most 50 tracks. Check `tracksMayBePartial`.
- A show embed can resolve to a featured episode; the resolved item is placed in `featuredItem`.
- `previewUrl`, release date, duration, and playability fields may be unavailable for some items or markets.
- The Actor does not access private playlists, account data, listening history, or full audio.
- Start with low concurrency. Increase it only when processing larger lists.

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/fascinating_lentil~spotify-metadata-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "startUrls": ["https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC"],
    "maxItems": 1,
    "maxConcurrency": 1,
    "proxyConfiguration": {"useApifyProxy": false}
  }'
```

### Responsible use

Use this Actor only for lawful collection of publicly available metadata. You are responsible for complying with Spotify's terms, copyright rules, privacy laws, and regulations that apply to your use case.

This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Spotify.

### Local development

```powershell
npm install
npm run build
New-Item -ItemType Directory -Force storage/key_value_stores/default
Copy-Item test_input.json storage/key_value_stores/default/INPUT.json
npm start
```

### License

Apache-2.0.

# Actor input Schema

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

Spotify web URLs or spotify: URIs, one per line.

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

Maximum number of unique Spotify URLs to process.

## `maxConcurrency` (type: `integer`):

Number of Spotify pages fetched in parallel.

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

Optional proxy settings. The public embed endpoint usually works without a proxy.

## Actor input object example

```json
{
  "startUrls": [
    "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
    "https://open.spotify.com/album/4m2880jivSbbyEGAKfITCa",
    "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
  ],
  "maxItems": 1,
  "maxConcurrency": 1,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Clean dataset items containing public Spotify item metadata, images, URLs, durations, track counts, nested tracks, and scraped timestamps.

# 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 = {
    "startUrls": [
        "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
        "https://open.spotify.com/album/4m2880jivSbbyEGAKfITCa",
        "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/MdMjbCe6TXo7POX7u/builds/gU1v0NvIRXaQTVQus/openapi.json
