# Spotify Charts + Search Hybrid Scraper (`w3crawler/spotify-charts-search-hybrid-scraper`) Actor

Snapshot public Spotify Top 50 playlist metadata and, with eligible official credentials, merge search tracks with accessible chart positions.

- **URL**: https://apify.com/w3crawler/spotify-charts-search-hybrid-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 charts & searches

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 Charts + Search Hybrid Scraper

Compare a **public Spotify chart snapshot** with **public Spotify search results** for one query. The dataset can contain one `chartSnapshot` row for the chart playlist and one `hybridTrack` row per search result, including ID-based chart matching so you can see which search tracks are currently charting and at what chart position.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-charts-search-hybrid-scraper) and select **Try for free** or open the **Input** tab.
2. Enter a `query` and choose a two-letter `country`.
3. Keep `maxItems` small for the first run; it caps search results, not the chart snapshot.
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

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

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `query` | string | Required | Not supplied | Keyword searched on Spotify's public search page, 1–200 characters. |
| `country` | string | Optional | `US` | Two-letter code. `US` and `GB` use their public Top 50 playlist; other codes use the public global chart fallback. |
| `maxItems` | integer | Optional | `10` | Maximum public Songs search results retained, 1–10. The chart snapshot is additional. |
| `requestDelayMs` | integer | Optional | `1000` | Polite delay before each browser navigation, 0–30000 ms. |
| `timeoutSecs` | integer | Optional | `45` | Timeout for each public page, 10–90 seconds. |
| `maxResponseBytes` | integer | Optional | `3000000` | Hard initial response-body limit per page, 100000–5000000 bytes. |
| `proxyConfiguration` | object | Optional | `{"useApifyProxy":false}` | Optional Apify Proxy settings; direct browsing is the default. |

Full default input (supply `query` before running):

```json
{
  "country": "US",
  "maxItems": 10,
  "requestDelayMs": 1000,
  "timeoutSecs": 45,
  "maxResponseBytes": 3000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

The Actor reads anonymous, public Spotify chart and search pages. It does not log in, call the official Web API, capture Web Player tokens, download audio, or solve access challenges.

### Output

The dataset contains one chart snapshot and zero or more hybrid track rows. Optional values are omitted rather than inferred, and no diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordId` | string | Always | Stable key for the chart snapshot or hybrid track. |
| `recordType` | string | Always | `chartSnapshot` or `hybridTrack`. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `query` | string | Always | Search query used for the run. |
| `country` | string | Always | Two-letter country context; other codes retain the requested code while using the global chart. |
| `chartPlaylistId` | string | Always | Public chart playlist ID actually used. |
| `spotifyUrl` | string | Always | Chart playlist URL on snapshot rows; track URL on hybrid rows. |
| `chartContentsStatus` | string | Always | Chart availability: `public_preview`, `partial_rendered`, or `unavailable_public_page`. |
| `searchStatus` | string | Always | Search availability: `public_preview` or `unavailable_public_page`. |
| `hybridMergeStatus` | string | Always | `public_preview` when both sides contributed, `chart_unavailable` when the chart could not be read, or `unavailable_public_page` when no search rows were available. |
| `sourceUrl` | string | Always | Exact public page URL that produced the row. Observed field not declared in `dataset_schema.json`. |
| `chartPlaylistName` | string | Chart snapshot rows | Public chart playlist name. |
| `description` | string | Chart snapshot rows, when visible | Public chart playlist description. |
| `declaredItemCount` | integer | Chart snapshot rows, when visible | Declared chart song count, at least 0. |
| `declaredSaveCount` | integer | Chart snapshot rows, when visible | Public chart save count, at least 0. |
| `chartTracks` | object array | Chart snapshot rows; may be empty | Retained chart rows; see the nested shape below. |
| `renderedTrackCount` | integer | Chart snapshot rows | Number of chart track rows retained, at least 0. |
| `trackId` | string | When a track is rendered | 22-character public track ID. |
| `name` | string | When a track is rendered | Track name. |
| `artists` | object array | When artist links are visible | Artists with `artistId` and `name`; the track-level `spotifyUrl` identifies the track. |
| `artistNames` | string | When artist names are visible | Comma-separated artist names. |
| `album` | string | When an album is visible | Album name. |
| `albumId` | string | When an album link is visible | Public album ID. |
| `albumUrl` | string | When an album link is visible | Public album URL. |
| `durationFormatted` | string | When rendered | Track duration as displayed. |
| `playCount` | integer | Chart rows, when visible | Public chart play count; it appears inside `chartTracks`, not on hybrid search rows. |
| `searchPosition` | integer | Hybrid track rows | One-based position in the public search result list. |
| `chartPosition` | integer | When the track also charts | One-based chart position; also present inside `chartTracks` for snapshots. |
| `isCharting` | boolean | Hybrid track rows | Whether the search track ID matched a retained chart track. |

Each `chartTracks` entry contains `chartPosition`, `trackId`, `name`, `spotifyUrl`, `artists`, `artistNames`, `album`, `albumId`, `albumUrl`, `playCount`, and `durationFormatted` when visible.

#### Full JSON output

The two examples below are real saved rows from the 2026-10-25 verification run. The second row's `chartTracks` array is shortened from 50 entries to two; scalar values are unchanged.

Chart snapshot row:

```json
{
  "recordId": "spotify_chart_US_37i9dQZEVXbLRQDuF5jeBp",
  "recordType": "chartSnapshot",
  "query": "Pitbull",
  "country": "US",
  "chartPlaylistId": "37i9dQZEVXbLRQDuF5jeBp",
  "chartPlaylistName": "Top 50 - USA",
  "spotifyUrl": "https://open.spotify.com/playlist/37i9dQZEVXbLRQDuF5jeBp",
  "description": "Public Playlist Top 50 - USA Your daily update of the most played tracks right now - USA. Spotify • 3,233,835 saves • 50 songs , about 3 hr • Oct 25, 2026",
  "declaredItemCount": 50,
  "declaredSaveCount": 3233835,
  "chartTracks": [
    {
      "chartPosition": 1,
      "trackId": "2sFepQNyl1WjpROruP8bJ0",
      "name": "Housewife",
      "spotifyUrl": "https://open.spotify.com/track/2sFepQNyl1WjpROruP8bJ0",
      "artists": [
        {
          "artistId": "45dkTj5sMRSjrmBSBeiHym",
          "name": "Tate McRae"
        }
      ],
      "artistNames": "Tate McRae",
      "album": "Housewife",
      "albumId": "6JvmSyocXef7RZDZFaymNl",
      "albumUrl": "https://open.spotify.com/album/6JvmSyocXef7RZDZFaymNl",
      "playCount": 1825853,
      "durationFormatted": "3:28"
    },
    {
      "chartPosition": 2,
      "trackId": "70cHKK8bHAfJrOGVnfRG9J",
      "name": "Nicole Kidman",
      "spotifyUrl": "https://open.spotify.com/track/70cHKK8bHAfJrOGVnfRG9J",
      "artists": [
        {
          "artistId": "2qanRMyA5bNuTvz1dK45OP",
          "name": "ADÉLA"
        }
      ],
      "artistNames": "ADÉLA",
      "album": "PRIMA",
      "albumId": "2yDFVH9CeOHt0sc9eI0aBs",
      "albumUrl": "https://open.spotify.com/album/2yDFVH9CeOHt0sc9eI0aBs",
      "playCount": 1321803,
      "durationFormatted": "3:01"
    }
  ],
  "renderedTrackCount": 50,
  "chartContentsStatus": "public_preview",
  "searchStatus": "public_preview",
  "hybridMergeStatus": "public_preview",
  "sourceUrl": "https://open.spotify.com/playlist/37i9dQZEVXbLRQDuF5jeBp",
  "scrapedAt": "2026-10-25T21:00:46.656Z"
}
```

Hybrid track row:

```json
{
  "recordId": "spotify_hybrid_US_6Rb0ptOEjBjPPQUlQtQGbL",
  "recordType": "hybridTrack",
  "scrapedAt": "2026-10-25T21:00:46.659Z",
  "query": "Pitbull",
  "country": "US",
  "chartPlaylistId": "37i9dQZEVXbLRQDuF5jeBp",
  "spotifyUrl": "https://open.spotify.com/track/6Rb0ptOEjBjPPQUlQtQGbL",
  "trackId": "6Rb0ptOEjBjPPQUlQtQGbL",
  "name": "Hotel Room Service",
  "artists": [
    {
      "artistId": "0TnOYISbd1XYRBk9myaseg",
      "name": "Pitbull"
    }
  ],
  "artistNames": "Pitbull",
  "durationFormatted": "3:57",
  "searchPosition": 1,
  "isCharting": false,
  "chartContentsStatus": "public_preview",
  "searchStatus": "public_preview",
  "hybridMergeStatus": "public_preview",
  "sourceUrl": "https://open.spotify.com/search/Pitbull"
}
```

### 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 records chart and search coverage as well as saved-row counts.

| Field | Meaning |
| --- | --- |
| `recordType` | Always `runSummary`. |
| `status` | Actor outcome: `SUCCEEDED` or `FAILED`. |
| `query` | Search query used for the run. |
| `country` | Country context requested for the run. |
| `requestedMaxItems` | Search-result limit requested. |
| `recordsStored` | All saved rows, including the chart snapshot. |
| `hybridTrackCount` | Saved hybrid track rows. |
| `chartSnapshotCount` | Saved chart snapshot rows. |
| `renderedChartTrackCount` | Chart track rows retained. |
| `chartRowsObservedAcrossScrollPasses` | Chart rows observed during scrolling. |
| `chartScrollPasses` | Chart scroll passes performed. |
| `chartScrollableContainers` | Scrollable containers found on the chart page. |
| `chartDeclaredTrackCount` | Chart song count declared by the page. |
| `chartMatchCount` | Hybrid rows whose track ID matched the chart. |
| `searchRowsObservedAcrossScrollPasses` | Search rows observed during scrolling. |
| `searchScrollPasses` | Search scroll passes performed. |
| `searchScrollableContainers` | Scrollable containers found on the search page. |
| `searchTrackAnchorCount` | Track links observed in the search results. |
| `errorRecordCount` | Page or extraction failures recorded for the run. |
| `chartPlaylistId` | Chart playlist ID actually used. |
| `authenticationMode` | Always `anonymous_public_page`. |
| `sourceTransport` | Transport description recorded for the run. |
| `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` | Chart and search completed without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | At least one row was saved, but a page or output write failed. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The run completed cleanly and produced no rows. |
| `FAILED` | `FAILED` | The run failed before any usable row was saved. |

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

```json
{
  "recordType": "runSummary",
  "status": "SUCCEEDED",
  "query": "Pitbull",
  "country": "US",
  "requestedMaxItems": 4,
  "recordsStored": 5,
  "hybridTrackCount": 4,
  "chartSnapshotCount": 1,
  "renderedChartTrackCount": 50,
  "chartRowsObservedAcrossScrollPasses": 249,
  "chartScrollPasses": 6,
  "chartScrollableContainers": 1,
  "chartDeclaredTrackCount": 50,
  "chartMatchCount": 0,
  "searchRowsObservedAcrossScrollPasses": 4,
  "searchScrollPasses": 5,
  "searchScrollableContainers": 2,
  "searchTrackAnchorCount": 4,
  "errorRecordCount": 0,
  "chartPlaylistId": "37i9dQZEVXbLRQDuF5jeBp",
  "authenticationMode": "anonymous_public_page",
  "sourceTransport": "anonymous Chromium public pages",
  "startedAt": "2026-10-25T21:00:11.662Z",
  "completedAt": "2026-10-25T21:00:47.314Z",
  "durationMs": 35652,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

Only `US` and `GB` map to their country Top 50 playlist; every other two-letter code uses Spotify's public global chart while `country` keeps the requested value. The chart snapshot is a separate row, so `recordsStored` can be one more than `maxItems`. Chart tracks are read from a virtualized list with bounded scrolling and may be partial; `chartContentsStatus` records that outcome.

`chartPosition` and `isCharting` are ID-based matches between the retained chart rows and the search rows. A search track that is not in the retained chart window is reported as not charting, not inferred from title or artist. Search results, chart contents, save counts, and play counts change over time. If the chart page cannot be read, the search rows can still be saved with `hybridMergeStatus: "chart_unavailable"`. Failed pages are counted in the summary and logged, never written as data rows.

### Usage and support

Apify compute and storage costs vary with browser time, chart scroll passes, and the number of search rows. The chart snapshot attempts to read the full Top 50, so a run is heavier than a search-only scrape. Start with a small `maxItems`, inspect the dataset and run summary, then scale gradually. See the Actor's Pricing tab for current account rates.

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

# Actor input Schema

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

Keyword searched on Spotify's public search page.

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

Two-letter code. US and GB use their public Top 50 playlist; other codes use the public global chart fallback.

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

Maximum public Songs results to retain.

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

Polite delay before each browser navigation.

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

Timeout for each public page.

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

Hard initial response-body limit per page.

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

Optional Apify Proxy configuration; direct browsing is default.

## Actor input object example

```json
{
  "query": "Coldplay",
  "country": "US",
  "maxItems": 10,
  "requestDelayMs": 1000,
  "timeoutSecs": 45,
  "maxResponseBytes": 3000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

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

Run status and counters stored by the Actor.

## `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 = {
    "query": "Coldplay"
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/spotify-charts-search-hybrid-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 = { "query": "Coldplay" }

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

```

## MCP server setup

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