# Spotify Unified Public Search and Global Chart Snapshot (`w3crawler/spotify-unified-data-scraper`) Actor

Route one anonymous rendered public-page workflow: typed public search, global Top 50 snapshot, or featured playlists, with explicit market-neutral context and bounded pagination.

- **URL**: https://apify.com/w3crawler/spotify-unified-data-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 unified 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 Unified Public Search and Global Chart Snapshot

Collect public Spotify data through three workflows in one Actor: search visible entity cards, snapshot the public Global Top 50 playlist, or discover featured playlists from Spotify's music landing page. Every row is mode-tagged, includes source provenance, and keeps requested market context separate from the global chart scope.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-unified-data-scraper) and select **Try for free**, or open the **Input** tab.
2. Choose `mode`: `search`, `charts`, or `featured-playlists`.
3. For `search`, enter a `query`. For `charts` or `featured-playlists`, leave `query` empty.
4. Set `maxItems` and the scroll limits, start the Actor, and open the dataset. Export as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT_SUMMARY`) to check the outcome and counts.

### Input

No field is globally required, but `query` must be supplied when `mode` is `search`. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `mode` | string enum | Optional | `"search"` | `search`, `charts` (Global Top 50), or `featured-playlists`. |
| `query` | string | Conditional | Not supplied | Required in `search` mode; ignored in `charts` and `featured-playlists`. Up to 200 characters. |
| `market` | string | Optional | `"US"` | Two-letter context retained in every row. Public-page extraction does not apply market filtering. |
| `maxItems` | integer | Optional | `40` | Maximum rows emitted by the selected mode. 1–50. |
| `maxScrollPasses` | integer | Optional | `3` | Bounded rendered-page scroll passes. 1–12. |
| `timeoutSecs` | integer | Optional | `60` | Timeout for page navigation and visible content, in seconds. 10–180. |
| `maxResponseBytes` | integer | Optional | `8000000` | Maximum rendered HTML size accepted. 200000–15000000. |
| `requestDelayMs` | integer | Optional | `500` | Delay between bounded scroll passes, in milliseconds. 0–5000. |
| `maxRetries` | integer | Optional | `1` | Maximum retries for transient public-page failures. 0–2. |

Full default input for search mode:

```json
{
  "mode": "search",
  "market": "US",
  "maxItems": 40,
  "maxScrollPasses": 3,
  "timeoutSecs": 60,
  "maxResponseBytes": 8000000,
  "requestDelayMs": 500,
  "maxRetries": 1
}
```

The default input omits `query`; add it when using `mode: "search"`. The Actor reads anonymous public pages. It does not use the Spotify Web API, credentials, login sessions, Web Player tokens, audio downloads, CAPTCHA solving, or access-control bypasses.

### Output

The dataset contains one row per saved item, tagged by `mode` and `recordType`: `chartTrack`, `featuredPlaylist`, or `unifiedSearchResult`. Optional information is omitted when the source does not publish it, and no diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordId` | string | Always | Stable mode and entity record ID. |
| `recordType` | string enum | Always | `chartTrack`, `featuredPlaylist`, or `unifiedSearchResult`. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `mode` | string enum | Always | `search`, `charts`, or `featured-playlists`. |
| `source` | string | Always | Human-readable public source, such as `public Global Top 50 playlist`. |
| `entityType` | string enum | Always | `track`, `artist`, `album`, or `playlist`. |
| `entityId` | string | Always | 22-character public Spotify entity ID. |
| `name` | string | Always | Visible public entity name. |
| `url` | string | Always | Canonical public Spotify entity URL. |
| `position` | integer | Always | One-based position in the selected public source. |
| `imageUrl` | string | When published | Visible artwork URL. |
| `description` | string | When published | Visible playlist or search-card text. |
| `artistNames` | string array | When published | Visible artist names. |
| `artistIds` | string array | When published | Visible artist IDs. |
| `albumName` | string | When published | Visible album name. |
| `albumId` | string | When published | Visible album ID. |
| `releaseDate` | string | When published | Visible release date or year. |
| `durationMs` | integer | When published | Track duration in milliseconds. |
| `explicit` | boolean | When published | Visible explicit marker. |
| `ownerName` | string | When published | Visible playlist owner. |
| `totalItems` | integer | When published | Visible playlist item count. |
| `query` | string | Search mode | Normalized search query on search rows. |
| `requestedMarket` | string | Always | Requested market context; never used as a local chart geography. |
| `marketApplied` | boolean | Always | Always `false` for this public-page Actor. |
| `chartScope` | string enum | Chart rows | `global_top_50` on Global Top 50 rows. |
| `chartMarket` | string enum | Chart rows | `global` on Global Top 50 rows. |
| `sourceUrl` | string | Always | Public page used for the row. |

#### Full JSON output

The example below is an unchanged `chartTrack` row saved by the 2026-10-25 run. Chart scope fields appear only on chart rows; `query` appears only on search rows.

```json
{
  "entityType": "track",
  "entityId": "70cHKK8bHAfJrOGVnfRG9J",
  "name": "Nicole Kidman",
  "url": "https://open.spotify.com/track/70cHKK8bHAfJrOGVnfRG9J",
  "artistNames": [
    "ADÉLA"
  ],
  "artistIds": [
    "2qanRMyA5bNuTvz1dK45OP"
  ],
  "albumName": "PRIMA",
  "albumId": "2yDFVH9CeOHt0sc9eI0aBs",
  "durationMs": 181000,
  "explicit": true,
  "position": 3,
  "recordId": "spotify_unified_charts_track_70cHKK8bHAfJrOGVnfRG9J",
  "recordType": "chartTrack",
  "mode": "charts",
  "source": "public Global Top 50 playlist",
  "requestedMarket": "US",
  "marketApplied": false,
  "chartScope": "global_top_50",
  "chartMarket": "global",
  "sourceUrl": "https://open.spotify.com/playlist/37i9dQZEVXbMDoHDwVN2tF",
  "scrapedAt": "2026-10-25T20:48:56.131Z"
}
```

### Run summary

**Run summary** is stored in the run's key-value store under `OUTPUT_SUMMARY`. The same object is mirrored to `OUTPUT` for compatibility.

| Field | Meaning |
| --- | --- |
| `recordType` | Always `runSummary`. |
| `status` | Actor process outcome: `SUCCEEDED` or `FAILED`. |
| `mode` | Mode used for the run. |
| `requestedMarket` | Requested market context. |
| `marketApplied` | Whether market filtering was applied; always `false`. |
| `marketPolicy` | Recorded market policy, `ignored_public_page_context` in the saved run. |
| `chartScope` | Chart scope when `mode` is `charts`. |
| `chartMarket` | Chart geography when `mode` is `charts`. |
| `chartPlaylistId` | Public Global Top 50 playlist ID when applicable. |
| `maxItems` | Configured row cap. |
| `maxScrollPasses` | Configured scroll bound. |
| `candidateCount` | Candidate items observed before limits. |
| `rowsObservedAcrossScrollPasses` | Rows seen across scroll passes. |
| `scrollPasses` | Scroll passes performed. |
| `paginationMode` | Pagination method used. |
| `duplicateCount` | Duplicate items removed. |
| `recordsByType` | Saved rows grouped by entity type. |
| `recordTypesEmitted` | Dataset record types emitted. |
| `resultRecordCount` | Result rows produced. |
| `recordsStored` | Rows saved to the dataset. |
| `errorRecordCount` | Error records; diagnostics are kept out of the dataset. |
| `authenticationMode` | Extraction mode, `anonymous_public_page` in the saved run. |
| `credentialFieldsIgnored` | Whether supplied compatibility credentials were ignored. |
| `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` | `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `failureCount` | Operational and dataset-write failures. |
| `outputWriteFailureCount` | Summary or optional key-value writes that failed. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | Rows were saved without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | Rows were saved, but a later problem prevented a complete run. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The selected source completed cleanly with no matching rows. |
| `FAILED` | `FAILED` | A fatal error occurred before any usable row was saved. |

Example `OUTPUT_SUMMARY` from the saved run:

```json
{
  "recordType": "runSummary",
  "status": "SUCCEEDED",
  "mode": "charts",
  "requestedMarket": "US",
  "marketApplied": false,
  "marketPolicy": "ignored_public_page_context",
  "chartScope": "global_top_50",
  "chartMarket": "global",
  "chartPlaylistId": "37i9dQZEVXbMDoHDwVN2tF",
  "maxItems": 5,
  "maxScrollPasses": 3,
  "candidateCount": 28,
  "rowsObservedAcrossScrollPasses": 28,
  "scrollPasses": 0,
  "paginationMode": "bounded_rendered_scroll_passes",
  "duplicateCount": 0,
  "recordsByType": {
    "track": 5
  },
  "recordTypesEmitted": [
    "chartTrack"
  ],
  "resultRecordCount": 5,
  "recordsStored": 5,
  "errorRecordCount": 0,
  "authenticationMode": "anonymous_public_page",
  "credentialFieldsIgnored": false,
  "startedAt": "2026-10-25T20:48:52.805Z",
  "completedAt": "2026-10-25T20:48:56.721Z",
  "durationMs": 3916,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

`search` reads one public search page and can return visible track, artist, album, and playlist cards. `charts` reads the public Global Top 50 playlist and returns `chartTrack` rows. `featured-playlists` reads Spotify's music landing page and returns `featuredPlaylist` rows. A run uses exactly one mode.

`query` is required only in search mode. Chart rows always carry `chartScope: "global_top_50"` and `chartMarket: "global"`; the requested market is never attached to a row as a local chart geography. `position` is relative to the selected source, not a global ranking across modes. `maxItems` caps the mode's output, and a chart run cannot exceed the public playlist length.

Only rendered items are saved. The Actor does not open every entity page, follow additional search pages beyond the scroll budget, or infer ranks. Optional fields such as artwork, owners, release dates, and item counts are omitted when absent. Access challenges, redirects, and page changes cannot be recovered. `market` is context only and `marketApplied` is always `false`.

### Usage and support

Each run loads one public page, so cost is driven by browser startup, page size, scroll passes, and retained rows. Chart and featured-playlist runs do not need a query. Start with a small `maxItems` value and inspect the mode-tagged rows before scaling. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/spotify-unified-data-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, sponsored by, or endorsed by Spotify. Use it only for public data and in accordance with Spotify's terms, robots guidance, and applicable law. Public pages can contain personal information; use the output only for lawful purposes.

# Changelog

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

# Actor input Schema

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

Choose public search, the global Top 50 playlist, or featured playlists.

## `query` (type: `string`):

Required in search mode and ignored by charts and featured-playlists modes.

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

Two-letter context retained in every row. Anonymous public-page extraction does not apply market filtering.

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

Maximum rows emitted by the selected mode. Charts can return at most the public Global Top 50 rows.

## `maxScrollPasses` (type: `integer`):

Bounded rendered-page scroll passes used to discover additional visible rows.

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

Timeout in seconds for public-page navigation and visible content.

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

Maximum rendered HTML size accepted from the public page.

## `requestDelayMs` (type: `integer`):

Delay in milliseconds between bounded scroll passes.

## `maxRetries` (type: `integer`):

Maximum retries for transient public-page failures.

## Actor input object example

```json
{
  "mode": "search",
  "market": "US",
  "maxItems": 40,
  "maxScrollPasses": 3,
  "timeoutSecs": 60,
  "maxResponseBytes": 8000000,
  "requestDelayMs": 500,
  "maxRetries": 1
}
```

# Actor output Schema

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

No description

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

Run status and counters stored by the Actor.

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

No description

## `compatibilitySummary` (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-unified-data-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-unified-data-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-unified-data-scraper --silent --output-dataset

```

## MCP server setup

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