# Spotify Typed Multi-Entity Search Results (`w3crawler/spotify-search-scraper`) Actor

Search rendered public Spotify search pages for typed artist, track, album, playlist, show, and episode cards with independent per-type limits, stable IDs, and reconciled counts.

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

## Pricing

from $2.99 / 1,000 search 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/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 Typed Multi-Entity Search Results

Search one public Spotify search page and collect visible artist, track, album, playlist, show, and episode cards in a typed dataset. Each row carries an explicit entity type, stable 22-character entity ID, per-type position, search query, market context, and the public search URL used for the result.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-search-scraper) and select **Try for free**, or open the **Input** tab.
2. Enter a non-empty `query` and choose a `type`, or keep `type: "all"` for all six supported entity types.
3. Set `maxItems` for the number of rows per type and keep the scroll and timeout limits small for the first run.
4. Start the Actor and open the dataset. Export the rows as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT_SUMMARY`) to check the outcome and counts.

### Input

`query` is required. All other fields are optional. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `query` | string | Required | Not supplied | Non-empty Spotify search text. 1–200 characters. |
| `type` | string enum | Optional | `"all"` | Return one type or all six: `artist`, `track`, `album`, `playlist`, `show`, `episode`, or `all`. |
| `market` | string | Optional | `"US"` | Two-letter context retained in each row. Public-page search does not apply market filtering. |
| `maxItems` | integer | Optional | `10` | Maximum rows emitted independently for every requested entity type. 1–1000 per type. |
| `maxScrollPasses` | integer | Optional | `3` | Bounded rendered-page scroll passes used to discover more result cards. 1–20. |
| `timeoutSecs` | integer | Optional | `60` | Timeout for public page navigation and visible content, in seconds. 10–180. |
| `maxResponseBytes` | integer | Optional | `8000000` | Maximum rendered HTML size accepted for the search page. 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:

```json
{
  "type": "all",
  "market": "US",
  "maxItems": 10,
  "maxScrollPasses": 3,
  "timeoutSecs": 60,
  "maxResponseBytes": 8000000,
  "requestDelayMs": 500,
  "maxRetries": 1
}
```

The default input omits the required `query` field; supply a search phrase before running. The Actor reads anonymous public search 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 `searchResult` row per unique visible card. `maxItems` is applied separately to each requested type, and `position` restarts at 1 for each type. 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 type-scoped record ID. |
| `recordType` | string | Always | Row discriminator, always `searchResult`. |
| `entityType` | string enum | Always | `artist`, `track`, `album`, `playlist`, `show`, or `episode`. |
| `entityId` | string | Always | 22-character Spotify entity ID. |
| `name` | string | Always | Visible public result name. |
| `url` | string | Always | Canonical public Spotify entity URL. |
| `position` | integer | Always | One-based position within the requested entity type. |
| `searchQuery` | string | Always | Normalized query used for the public search page. |
| `market` | string | Always | Requested two-letter market context. |
| `marketApplied` | boolean | Always | Always `false`; public-page search does not apply market filtering. |
| `imageUrl` | string | When published | Visible Spotify CDN artwork URL. |
| `description` | string | When published | Visible card text. |
| `artistNames` | string | When published | Visible artist names for track or album cards. |
| `artistIds` | string array | When published | Visible artist IDs. |
| `albumName` | string | When published | Visible album context. |
| `albumId` | string | When published | Visible album context ID. |
| `releaseDate` | string | When published | Visible release year when present. |
| `durationFormatted` | string | When published | Visible duration in `minutes:seconds` form. |
| `explicit` | boolean | When published | Visible explicit marker. |
| `ownerName` | string | When published | Visible playlist owner. |
| `totalItems` | integer | When published | Visible playlist, show, or episode item count. |
| `sourceUrl` | string | Always | Public search page used for the row. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |

#### Full JSON output

The example below is an unchanged album row saved by the 2026-10-25 run. Fields such as `durationFormatted` and `totalItems` appear only for card types that expose them.

```json
{
  "recordId": "spotify_search_album_4Lkkfpt8ZkDmw4viHHi0IM",
  "recordType": "searchResult",
  "entityType": "album",
  "entityId": "4Lkkfpt8ZkDmw4viHHi0IM",
  "name": "PITCOIN",
  "url": "https://open.spotify.com/album/4Lkkfpt8ZkDmw4viHHi0IM",
  "position": 1,
  "searchQuery": "Pitbull",
  "market": "US",
  "marketApplied": false,
  "imageUrl": "https://i.scdn.co/image/ab67616d00001e02fb5868a9fc3d54f8f0b95b0a",
  "description": "PITCOIN 2026 • Pitbull",
  "artistNames": "Pitbull",
  "artistIds": [
    "0TnOYISbd1XYRBk9myaseg"
  ],
  "albumName": "PITCOIN",
  "albumId": "4Lkkfpt8ZkDmw4viHHi0IM",
  "sourceUrl": "https://open.spotify.com/search/Pitbull",
  "scrapedAt": "2026-10-25T21:06:13.735Z"
}
```

### 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`. |
| `query` | Search query used. |
| `requestedType` | Requested `type` value. |
| `requestedEntityTypes` | Entity types requested. |
| `allModeEntityTypes` | Entity types covered by `type: "all"`. |
| `outputTypesComplete` | Whether every requested type reached its declared limit. |
| `market` | Requested market context. |
| `marketApplied` | Whether market filtering was applied; always `false`. |
| `maxItemsPerType` | Effective per-type row limit. |
| `maxScrollPasses` | Configured scroll bound. |
| `declaredMaxItemsByType` | Per-type row limit declared for the run. |
| `recordsByType` | Rows saved for each entity type. |
| `recordTypesEmitted` | Entity types that produced rows. |
| `resultRecordCount` | Result rows produced. |
| `uniqueResultCount` | Unique results after deduplication. |
| `deduplicatedCount` | Duplicate cards removed. |
| `recordsStored` | Rows saved to the dataset. |
| `errorRecordCount` | Error records; diagnostics are kept out of the dataset. |
| `searchUrl` | Public search URL used. |
| `searchPagesProcessed` | Search pages processed. |
| `searchCandidateCount` | Cards observed before deduplication and limits. |
| `rowsObservedAcrossScrollPasses` | Rows seen across scroll passes. |
| `searchScrollPasses` | Scroll passes performed. |
| `paginationMode` | Pagination method used. |
| `deduplicationKey` | Key used to deduplicate results. |
| `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` | Every requested type was collected to its declared limit without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | Rows were saved, but at least one requested type was short or a later problem occurred. |
| `SUCCEEDED` | `NO_RESULTS` | The search completed cleanly with no visible matching cards. |
| `FAILED` | `FAILED` | A fatal error occurred before any usable row was saved. |

Example `OUTPUT_SUMMARY` from the saved run:

```json
{
  "recordType": "runSummary",
  "status": "SUCCEEDED",
  "query": "Pitbull",
  "requestedType": "all",
  "requestedEntityTypes": [
    "artist",
    "track",
    "album",
    "playlist",
    "show",
    "episode"
  ],
  "allModeEntityTypes": [
    "artist",
    "track",
    "album",
    "playlist",
    "show",
    "episode"
  ],
  "outputTypesComplete": true,
  "market": "US",
  "marketApplied": false,
  "maxItemsPerType": 3,
  "maxScrollPasses": 2,
  "declaredMaxItemsByType": {
    "artist": 3,
    "track": 3,
    "album": 3,
    "playlist": 3,
    "show": 3,
    "episode": 3
  },
  "recordsByType": {
    "artist": 3,
    "track": 3,
    "album": 3,
    "playlist": 3,
    "show": 3,
    "episode": 3
  },
  "recordTypesEmitted": [
    "artist",
    "track",
    "album",
    "playlist",
    "show",
    "episode"
  ],
  "resultRecordCount": 18,
  "uniqueResultCount": 18,
  "deduplicatedCount": 0,
  "recordsStored": 18,
  "errorRecordCount": 0,
  "searchUrl": "https://open.spotify.com/search/Pitbull",
  "searchPagesProcessed": 1,
  "searchCandidateCount": 18,
  "rowsObservedAcrossScrollPasses": 77,
  "searchScrollPasses": 0,
  "paginationMode": "bounded_rendered_scroll_passes",
  "deduplicationKey": "entityType:entityId",
  "authenticationMode": "anonymous_public_page",
  "credentialFieldsIgnored": false,
  "startedAt": "2026-10-25T21:06:08.602Z",
  "completedAt": "2026-10-25T21:06:14.208Z",
  "durationMs": 5606,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

The Actor loads one public search route and reads the rendered cards that Spotify exposes. `maxItems` is a per-type limit, not a global total; `type: "all"` can therefore save up to six times that limit. `position` is relative to its own type. Results are deduplicated by `entityType:entityId`, and `outputTypesComplete` is the reliable signal that every requested type reached its declared limit.

The page exposes only the cards Spotify renders and scroll loading makes visible. The Actor does not paginate beyond the configured scroll passes, open every entity page, or recover hidden results. A type can be short or empty without meaning the catalog has no matches. `market` is retained as context only. The Actor stops or records a diagnostic when Spotify redirects away from the search route, presents an access challenge, exceeds the byte limit, or returns an HTTP failure. Optional card fields are omitted when absent and are never inferred.

### Usage and support

A run is anchored on one search page, so `type: "all"` can be more efficient than separate runs for each type. Cost varies with browser startup, query latency, page size, scroll passes, and the number of saved rows. Start with `maxItems` around 10 and a small scroll budget. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/spotify-search-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-search-scraper/changelog.md

# Actor input Schema

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

Non-empty Spotify search text.

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

Return one type or all six supported types: artist, track, album, playlist, show, and episode.

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

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

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

Maximum rows emitted independently for every requested entity type. Supports the original contract up to 1,000 rows per type when the public page exposes them.

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

Bounded rendered-page scroll passes used to discover additional public result cards.

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

Timeout in seconds for public page navigation and visible content.

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

Maximum rendered HTML size accepted for the public search 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
{
  "type": "all",
  "market": "US",
  "maxItems": 10,
  "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-search-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-search-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-search-scraper --silent --output-dataset

```

## MCP server setup

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