# Spotify Multi-Entity Scraper (`w3crawler/spotify-multi-entity-scraper`) Actor

Fetch any mix of Spotify artists, tracks, albums, and playlists by URL or ID in one run.

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

## Pricing

from $2.99 / 1,000 entity records

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/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 Multi-Entity Scraper

Resolve a mixed batch of **public Spotify artist, track, album, and playlist URLs or IDs** into one dataset with a consistent identity and provenance shape. Each entity is read from its public Spotify page, so artist listener counts, album release facts, track artist names, or playlist item/save counts appear when that page exposes them.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-multi-entity-scraper) and select **Try for free** or open the **Input** tab.
2. Add public Spotify URLs or 22-character IDs to any of `artistUrls`, `trackUrls`, `albumUrls`, or `playlistUrls`. At least one entry is required.
3. Keep the batch small for the first run; at most 50 unique entities are accepted across all four arrays.
4. Start the Actor, open the dataset, and export the saved records as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT_SUMMARY`) to check the outcome and counts.

### Input

No single field is required by the schema, but a run fails validation unless at least one entity array contains a valid entry. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `artistUrls` | string array | Optional | Not supplied | Spotify artist URLs or 22-character IDs, up to 50 entries. |
| `trackUrls` | string array | Optional | Not supplied | Spotify track URLs or 22-character IDs, up to 50 entries. |
| `albumUrls` | string array | Optional | Not supplied | Spotify album URLs or 22-character IDs, up to 50 entries. |
| `playlistUrls` | string array | Optional | Not supplied | Spotify playlist URLs or 22-character IDs, up to 50 entries. |
| `market` | string | Optional | `US` | Two-letter market context included in each row. The public page is not market-forced. |
| `timeoutSecs` | integer | Optional | `30` | Maximum seconds for each public Spotify page request, 5–60. |
| `maxResponseBytes` | integer | Optional | `2000000` | Safety limit for each downloaded public page, 100000–5000000 bytes. |

Full default input (add at least one entity URL or ID before running):

```json
{
  "market": "US",
  "timeoutSecs": 30,
  "maxResponseBytes": 2000000
}
```

Duplicate IDs are removed across arrays, and the combined unique batch is capped at 50 entities. The Actor reads public Spotify pages over direct HTTP and does not log in, call `api.spotify.com`, capture tokens, download audio, or bypass access challenges.

### Output

The dataset contains one `spotifyEntity` row per resolved entity. Optional values are omitted rather than inferred, and no diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordId` | string | Always | Stable key in the form `spotify_entity_<type>_<id>`. |
| `recordType` | string | Always | Row discriminator; always `spotifyEntity`. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `entityType` | string | Always | `artist`, `track`, `album`, or `playlist`. |
| `entityId` | string | Always | 22-character public Spotify entity ID. |
| `name` | string | Always | Entity name from the public page metadata. |
| `spotifyUrl` | string | Always | Canonical `https://open.spotify.com/<type>/<id>` URL. |
| `description` | string | When page metadata supplies one | Public description. |
| `releaseDate` | string | When page metadata supplies one | Release date for albums or tracks. |
| `imageUrl` | string | When `og:image` is exposed | Artwork URL. |
| `artistNames` | string | When the type and description expose them | Artist names for albums or tracks. |
| `releaseYear` | integer | When the description exposes a year | Release year for albums or tracks, at least 0. |
| `monthlyListeners` | integer | For artists when rendered | Public monthly-listener count, at least 0. |
| `declaredTrackCount` | integer | For albums when the description exposes it | Declared album song count, at least 0. |
| `declaredItemCount` | integer | For playlists when the description exposes it | Declared playlist item count, at least 0. |
| `declaredSaveCount` | integer | For playlists when the description exposes it | Declared playlist save count, at least 0. |
| `market` | string | Always | Requested market context; it is provenance, not a market override. |
| `sourceUrl` | string | Always | Exact public page URL that produced the row. Observed field not declared in `dataset_schema.json`. |

#### Full JSON output

The example below is a real saved row from the 2026-10-25 verification run.

```json
{
  "recordId": "spotify_entity_album_4aawyAB9vmqN3uQ7FjRGTy",
  "recordType": "spotifyEntity",
  "scrapedAt": "2026-10-25T20:52:43.749Z",
  "entityType": "album",
  "entityId": "4aawyAB9vmqN3uQ7FjRGTy",
  "name": "Global Warming",
  "spotifyUrl": "https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy",
  "description": "Listen to Global Warming on Spotify · album · Pitbull · 2012 · 18 songs",
  "releaseDate": "2012-11-16",
  "imageUrl": "https://i.scdn.co/image/ab67616d0000b2732c5b24ecfa39523a75c993c4",
  "artistNames": "Pitbull",
  "releaseYear": 2012,
  "declaredTrackCount": 18,
  "market": "US",
  "sourceUrl": "https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy"
}
```

### Run summary

**Run summary** is stored in the run's key-value store under `OUTPUT_SUMMARY`; the same object is also written to `OUTPUT`. It reports requested entity types and saved rows.

| Field | Meaning |
| --- | --- |
| `recordType` | Always `runSummary`. |
| `status` | Actor outcome: `SUCCEEDED` or `FAILED`. |
| `market` | Market context used for the run. |
| `requestedByType` | Requested unique entity counts by `artist`, `track`, `album`, and `playlist`. |
| `requestedCount` | Total unique entities requested. |
| `recordsStored` | Entity rows saved to the dataset. |
| `errorRecordCount` | Entity pages that failed extraction. |
| `startedAt` | Run start time, in ISO UTC. |
| `completedAt` | Time the summary was written, in ISO UTC. |
| `durationMs` | Run duration in milliseconds. |
| `runStatus` | Canonical run status; matches `status`. |
| `dataStatus` | Completeness of saved rows: `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `failureCount` | Operational failures and failed dataset writes. |
| `outputWriteFailureCount` | Summary or optional key-value writes that failed. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | Every requested entity produced a row without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | At least one row was saved, but another entity or output write failed. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The run completed cleanly and produced no entity rows. |
| `FAILED` | `FAILED` | The run failed before any usable entity row was saved. |

Example `OUTPUT_SUMMARY` from the saved run (also written to `OUTPUT`):

```json
{
  "recordType": "runSummary",
  "status": "SUCCEEDED",
  "market": "US",
  "requestedByType": {
    "artist": 1,
    "track": 0,
    "album": 1,
    "playlist": 0
  },
  "requestedCount": 2,
  "recordsStored": 2,
  "errorRecordCount": 0,
  "startedAt": "2026-10-25T20:52:43.119Z",
  "completedAt": "2026-10-25T20:52:43.791Z",
  "durationMs": 672,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

The Actor resolves one public page per unique entity and does not expand into track lists, albums by an artist, or playlists that reference an entity. Entity fields are deliberately type-specific: artists can expose monthly listeners; albums can expose release date, artist names, release year, and a declared song count; playlists can expose declared item and save counts; tracks can expose artist names and a release year when the page description includes them.

These values come from JSON-LD and Open Graph metadata, plus text patterns in the public description. If the page omits a count or date, the field is absent rather than estimated. At most 50 unique entities are accepted per run, duplicates are removed, and `market` is recorded as provenance but does not force a market-specific page. Failures are counted in the summary and logged, never written as data rows.

### Usage and support

Apify compute and storage costs vary with the number of entity pages requested and output size; this Actor uses direct HTTP rather than a browser, so cost is usually lower than browser-based Spotify scrapers. Start with a small mixed batch, inspect the dataset and run summary, then scale toward the 50-entity cap. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/spotify-multi-entity-scraper/issues) to report a problem. Include the run ID, the input used, and the `OUTPUT_SUMMARY`; do not include tokens, cookies, or private data. This Actor is an independent community tool and is not affiliated with, endorsed by, or sponsored by Spotify. Use it only for public data and in accordance with Spotify's terms, robots guidance, and applicable law.

# Changelog

This Actor's version history is a separate document: https://apify.com/w3crawler/spotify-multi-entity-scraper/changelog.md

# Actor input Schema

## `artistUrls` (type: `array`):

Spotify artist URLs or 22-character IDs. Optional when another entity array is supplied.

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

Spotify track URLs or 22-character IDs. Optional when another entity array is supplied.

## `albumUrls` (type: `array`):

Spotify album URLs or 22-character IDs. Optional when another entity array is supplied.

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

Spotify playlist URLs or 22-character IDs. Optional when another entity array is supplied.

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

Two-letter market context included in output provenance.

## `timeoutSecs` (type: `integer`):

Maximum seconds for each public Spotify page request.

## `maxResponseBytes` (type: `integer`):

Safety limit for each downloaded public page.

## Actor input object example

```json
{
  "market": "US",
  "timeoutSecs": 30,
  "maxResponseBytes": 2000000
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

Requested, successful, failed, and per-entity counts under OUTPUT_SUMMARY.

## `compatibilitySummary` (type: `string`):

No description

## `sourceMetadata` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/spotify-multi-entity-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/spotify-multi-entity-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 '{}' |
apify call w3crawler/spotify-multi-entity-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/spotify-multi-entity-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/pXiwpNH5nMvSXClUm/builds/JrKx27rQz6JfGHESw/openapi.json
