# Spotify Play Count Scraper: Tracks, Albums, Artists, Playlists (`epicscrapers/spotify-play-count-scraper`) Actor

Get exact Spotify play counts (streams) for every track of an album, playlist or artist discography, plus monthly listeners, world rank and top cities. One row per track with release date and label. Schedule it to track daily streams. $2 per 1,000 links.

- **URL**: https://apify.com/epicscrapers/spotify-play-count-scraper.md
- **Developed by:** [Epic Scrapers](https://apify.com/epicscrapers) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 spotify links

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/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 Play Count Scraper: exact play counts and daily streams for any track, album, artist or playlist

Spotify Play Count Scraper gets the exact play count Spotify shows next to every song, for any artist, not just your own. Schedule it and it becomes a daily stream tracker: every run adds the streams each track gained since the last run. Paste track, album, artist or playlist links and get one spreadsheet row per track with its play count, album, release date, label and artists. Artist links add monthly listeners, followers, world rank and top cities.

- **Daily streams, built in.** Turn on **Compare with previous run** and schedule it. Every row then has `playCountChange`, the streams since the last run, so you don't have to merge exports in a spreadsheet. Artists get the change in monthly listeners.
- **Any artist, any catalog.** Spotify for Artists only shows your own music. This works for any track, so you can follow competitors, prospects, playlists and a whole label's roster the same way.
- **Whole discographies in one link.** One artist link can return every track of every album, single, EP and compilation, with the play count, release date and label on each row.
- **Exact numbers, not estimates.** The play count is the number Spotify shows in its app. The official Spotify Web API doesn't have it; it only offers a 0–100 "popularity" score.
- **$2 per 1,000 links, no start fee.** An album counts as one link, whatever the number of tracks. A daily check of 10 albums costs $0.60 a month. No Spotify account, API key or proxy setup.

### Who uses it, and how

| You are                             | What you schedule                                           | What you read                                                                         |
| ----------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Artist manager or marketer          | Your new release, daily                                     | `playCountChange` per track, before and after ads, press or a playlist add            |
| Label or distributor                | Your roster's artist links with their discographies, weekly | Streams per release, per artist and per label for catalog reports                     |
| A\&R scout                           | Hundreds of emerging artists, daily                         | `monthlyListenersChange`, top cities and top-track growth to spot who is breaking out |
| Catalog investor or royalty analyst | Full discographies before a deal, then monthly              | Total plays, plays per year since `releaseDate`, and the monthly growth or decay      |
| Playlist curator or promoter        | The playlists you run or pitch to, daily                    | Which tracks gain the most streams, and how newly added tracks perform                |
| Prediction market trader            | The artists in a monthly-listeners market, every few hours  | `monthlyListeners`, `monthlyListenersChange` and the gap to the leader                |
| Music journalist or researcher      | The artists or charts you cover                             | Exact numbers with an `observedAt` timestamp for every data point                     |

### How it compares

| What you need              | Spotify Play Count Scraper             | Most Spotify play count scrapers on Apify | Spotify for Artists            | Spotify Web API (official)  |
| -------------------------- | -------------------------------------- | ----------------------------------------- | ------------------------------ | --------------------------- |
| Exact play counts          | Yes                                    | Yes                                       | Yes                            | No, only a 0–100 popularity |
| Any artist                 | Yes                                    | Yes                                       | Only your own                  | Yes                         |
| Streams since the last run | Built in (`playCountChange`)           | No, compare exports yourself              | Yes, for your own music        | No                          |
| One row per track          | Yes, with release date and label       | Often one nested record per link          | Dashboard                      | One object per track        |
| Playlists                  | Any size, with position and date added | Often not supported                       | Only playlists with your music | Without play counts         |
| Whole artist discography   | Albums, singles, EPs, compilations     | Some                                      | Your own                       | Without play counts         |
| Price                      | $2 per 1,000 links                     | Mostly $3 to $4 per 1,000 links           | Free, your own music only      | Free, with app registration |

### Quick start

1. Click **Try for free** and sign in to Apify. The free plan's monthly credit covers about 2,500 links.
2. Paste Spotify links into **Spotify links**, one per line. In the Spotify app, use **Share → Copy link**.
3. Turn on **Compare with previous run** if you'll run it again.
4. Click **Start**. When the run finishes, open the **Output** tab and export the **Play counts** view to CSV, Excel or JSON.

```json
{
    "urls": [
        "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
        "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd"
    ],
    "compareWithPreviousRun": true
}
```

Then save it as a task and schedule it, as described below.

### Track daily streams with scheduled runs

A play count on its own is a snapshot. The same links run every day give you streams per day for each track, for any artist.

#### 1. Save your input as a task

Open the actor, add your links, turn on **Compare with previous run**, then click **Save as a new task**. A task is a saved input you can run again with one click or on a schedule. Make one task per purpose, for example one for your releases and one for the artists you scout.

#### 2. Schedule the task

In Apify Console, go to **Schedules**, click **Create new**, choose how often to run (for example daily at 07:00 in your time zone), and add your task. See [Schedules](https://docs.apify.com/platform/schedules) and [How to create a schedule](https://help.apify.com/en/articles/7120817-how-to-create-a-schedule).

Watch how to schedule an Actor:

https://www.youtube.com/watch?v=1jI7WcVQmwM

Or schedule a saved task:

https://www.youtube.com/watch?v=GRFW_Loo2dk

Common schedules:

| Use case                                 | Frequency       | Cron expression |
| ---------------------------------------- | --------------- | --------------- |
| Release launch, campaigns, playlist adds | Daily           | `0 7 * * *`     |
| A\&R watchlist                            | Daily           | `0 7 * * *`     |
| Label and catalog reports                | Weekly (Monday) | `0 7 * * 1`     |
| Catalog valuation and royalty tracking   | Monthly         | `0 7 1 * *`     |

Spotify doesn't update public play counts live, so daily runs are enough for play counts. For monthly-listener races, run more often near the deadline (see [For Polymarket traders](#for-polymarket-and-prediction-market-traders)).

#### 3. Send the numbers to a spreadsheet

Connect Google in the task's **Integrations** tab to add every run's rows to Google Sheets automatically. Each day's rows land below the previous day's, which gives you a stream history to chart.

https://www.youtube.com/watch?v=IFTeKdj6ZGM

The **Integrations** tab also connects Slack, email, Make, Zapier, n8n and webhooks, for example to post the day's top gainers to a Slack channel.

#### 4. Read the changes

Open the **Changes since last run** view in the **Output** tab, or use these fields:

- `playCountChange`: streams since `previousObservedAt`. With a daily schedule, these are the track's daily streams.
- `previousPlayCount` and `previousObservedAt`: the value and time of the last run that saw the track.
- `monthlyListenersChange` and `previousFollowers` on artist rows.

How the comparison works:

- The actor remembers the last play count of each track and the audience of each artist in your Apify account.
- A track is compared with the last run that saw it, from any of your tasks. If two tasks include the same track, the change is since whichever ran last.
- The first run of a track has empty `previous…` fields. Changes start from the second run.
- Runs aren't always exactly 24 hours apart. For an exact daily rate, divide `playCountChange` by the hours between `previousObservedAt` and `observedAt`, then multiply by 24.

### For Polymarket and prediction market traders

Polymarket and other prediction markets list Spotify markets such as "Which artist will have the most monthly Spotify listeners this month?". These markets resolve on the monthly listener count shown on each artist's public Spotify profile at a fixed time, usually on the last day of the month. That is the number this actor returns as `monthlyListeners`.

Put the artists of a market in one task and schedule it:

```json
{
    "urls": [
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
        "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4",
        "https://open.spotify.com/artist/1Xyo4u8uXC1ZmMpatF05PJ"
    ],
    "compareWithPreviousRun": true
}
```

- **Follow the race.** Each run returns every artist's `monthlyListeners` and `monthlyListenersChange` since the previous run. Chart the gap between the leader and the challengers, and see who is gaining.
- **Understand the momentum.** `topCities` shows where an artist's listeners come from, and the 10 top tracks with `playCountChange` show which songs drive the growth, for example a new single or a viral track.
- **Run it often near the deadline.** A run of 10 artists costs $0.02. Every 3 hours (`0 */3 * * *`) for a month is about $4.80; switch to hourly (`0 * * * *`) in the last days.
- **Get alerts.** Connect Slack, email or a webhook in the task's **Integrations** tab and send yourself the numbers after every run.
- **Check the market's own rules.** Each market sets its own time, time zone, tie-break and which profiles count (usually primary artist profiles only). The actor reports what Spotify shows at the time of the run, with `observedAt` in UTC.

### Ready-to-run examples

#### Daily streams of a new release

```json
{
    "urls": ["https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm"],
    "compareWithPreviousRun": true
}
```

Schedule it daily from release day. Compare `playCountChange` before and after an ad campaign, a press feature or a playlist add to see what it did.

#### Weekly catalog report for a roster

```json
{
    "urls": [
        "https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH",
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
    ],
    "artistReleases": ["albums", "singles", "compilations"],
    "compareWithPreviousRun": true
}
```

Every track of every release, each week, with the streams it gained since last week. Pivot by `label`, `albumName` or `artistName`.

#### A\&R watchlist: who is breaking out

```json
{
    "urls": [
        "https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH",
        "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"
    ],
    "compareWithPreviousRun": true
}
```

Add hundreds of artist links. Each one returns the profile and the 10 top tracks as a single link. Sort the **Artists** view by `monthlyListenersChange`, and check `topCities` to see where the growth comes from.

#### Playlist monitoring

```json
{
    "urls": ["https://open.spotify.com/playlist/6UeSakyzhiEt4NB3UAd6NQ"],
    "compareWithPreviousRun": true
}
```

Every track's play count with its `playlistPosition` and `addedToPlaylistAt`. Run daily to see which tracks gain the most streams and how new additions perform.

#### Catalog valuation

```json
{
    "urls": ["https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH"],
    "artistReleases": ["albums", "singles", "compilations"]
}
```

A one-off export of a whole catalog with release dates and labels. Schedule it monthly afterwards to measure how fast the catalog grows or decays.

### What data can you extract?

Every track is one row:

| Group    | Fields                                                                                                                         |
| -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Plays    | `playCount`, `observedAt`, and with **Compare with previous run** `playCountChange`, `previousPlayCount`, `previousObservedAt` |
| Track    | `trackName`, `trackId`, `trackUrl`, `trackNumber`, `discNumber`, `durationMs`, `explicit`, `playable`                          |
| Artists  | `artistName` (all credited artists), `artists` (ID, name and link of each)                                                     |
| Release  | `albumName`, `albumId`, `albumUrl`, `albumType` (album, single, EP, compilation), `releaseDate`, `label`, `coverUrl`           |
| Playlist | `playlistName`, `playlistId`, `playlistPosition`, `addedToPlaylistAt`                                                          |
| Source   | `input` (your link), `source` (track, album, playlist, artist-top-tracks, artist-discography), `artistTopTrackRank`            |

Artist links also add one artist row (`type: "artist"`):

| Group    | Fields                                                                                                                                       |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Audience | `monthlyListeners`, `followers`, `worldRank`, `topCities` (city, region, country, listeners)                                                 |
| Changes  | `monthlyListenersChange`, `previousMonthlyListeners`, `previousFollowers`, `previousObservedAt`                                              |
| Profile  | `artistName`, `artistId`, `artistUrl`, `verified`, `albumCount`, `singleCount`, `compilationCount`, `biography`, `externalLinks`, `imageUrl` |

### Input reference

| Field                    | Type             | Default  | Effect                                                                                                                                 |
| ------------------------ | ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `urls`                   | Array of strings | Required | Track, album, artist or playlist URLs (any language version of open.spotify.com), `spotify:` URIs or bare IDs, one per line.           |
| `compareWithPreviousRun` | Boolean          | `false`  | Add the previous play count and the change since the last run. Turn it on for scheduled runs.                                          |
| `artistReleases`         | Array of strings | `[]`     | For artist links: `albums`, `singles` (incl. EPs), `compilations`, `popular`. Empty = the artist's profile and its 10 top tracks only. |
| `maxTracksPerUrl`        | Integer          | `0`      | Stop after this many tracks per playlist, album or artist. `0` = all.                                                                  |

Moving from another Spotify play count actor? Inputs in the `{ "url": "…" }` format and the `followAlbums`, `followSingles` and `followPopularReleases` options work too, so your integration keeps working.

### Analyze the results with ChatGPT or Claude

Export the **Play counts** or **Changes since last run** view as CSV and attach it to a chat with ChatGPT, Claude or another AI assistant. Some prompts to start with:

**Daily report.** "This is today's Spotify data for my roster (`playCountChange` = streams since yesterday). Write a short report: total streams per `artistName`, the 5 tracks that gained the most, and any track whose daily streams are high compared with its total `playCount`."

**Find breakouts.** "These are artist rows from a daily A\&R run. Rank the artists by `monthlyListenersChange` relative to `monthlyListeners`, and list their top cities. Which ones grow fastest from a small base?"

**Value a catalog.** "This is an artist's full catalog. For each release (`albumName`), show total `playCount` and plays per year since `releaseDate`. Assuming $0.003 per stream, estimate yearly earnings per release and for the catalog."

The dataset is also available through the [Apify API](https://docs.apify.com/api/v2) and integrations such as Make, Zapier and n8n, so you can feed it into a dashboard or a database.

### Output

Results go to the run's default dataset. Use the views **Play counts**, **Changes since last run**, **Playlist tracks** or **Artists**, or export everything as JSON, CSV, Excel, XML or HTML.

A track row from a scheduled run. The play count is real (October 8, 2026); the `previous…` values show what a run on the next day adds:

```json
{
    "type": "track",
    "trackId": "2x8evxqUlF0eRabbW2JBJd",
    "trackName": "Fluorescent Adolescent",
    "playCount": 1239776084,
    "trackUrl": "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd",
    "artistName": "Arctic Monkeys",
    "artists": [
        {
            "id": "7Ln80lUS6He07XvHI8qqHH",
            "name": "Arctic Monkeys",
            "url": "https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH"
        }
    ],
    "albumName": "Favourite Worst Nightmare",
    "albumId": "1XkGORuUX2QGOEIL4EbJKm",
    "albumType": "album",
    "albumUrl": "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
    "releaseDate": "2007-04-22",
    "label": "Domino Recording Co",
    "trackNumber": 5,
    "discNumber": null,
    "durationMs": 183893,
    "explicit": false,
    "playable": true,
    "coverUrl": "https://i.scdn.co/image/ab67616d0000b273b1f8da74f225fa1225cdface",
    "playlistId": null,
    "playlistName": null,
    "playlistPosition": null,
    "addedToPlaylistAt": null,
    "artistTopTrackRank": null,
    "previousPlayCount": 1239512330,
    "playCountChange": 263754,
    "previousObservedAt": "2026-10-07T07:00:12.420Z",
    "source": "track",
    "input": "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd",
    "observedAt": "2026-10-08T07:00:11.902Z"
}
```

A real artist row (October 8, 2026, first run, with the biography and lists shortened):

```json
{
    "type": "artist",
    "artistId": "7Ln80lUS6He07XvHI8qqHH",
    "artistName": "Arctic Monkeys",
    "artistUrl": "https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH",
    "verified": true,
    "monthlyListeners": 56300019,
    "followers": 35845435,
    "worldRank": 44,
    "topCities": [
        { "city": "London", "region": "ENG", "country": "GB", "listeners": 1032786 },
        { "city": "Mexico City", "region": "CMX", "country": "MX", "listeners": 811466 }
    ],
    "albumCount": 8,
    "singleCount": 31,
    "compilationCount": 0,
    "imageUrl": "https://i.scdn.co/image/ab6761610000e5eb7da39dea0a72f581535fb11f",
    "biography": "With their nervy and literate indie rock sound, Arctic Monkeys are …",
    "externalLinks": [{ "name": "INSTAGRAM", "url": "https://instagram.com/arcticmonkeys" }],
    "previousMonthlyListeners": null,
    "monthlyListenersChange": null,
    "previousFollowers": null,
    "previousObservedAt": null,
    "input": "https://open.spotify.com/artist/7Ln80lUS6He07XvHI8qqHH",
    "observedAt": "2026-10-08T12:57:59.759Z"
}
```

The run's key-value store also has an `OUTPUT` record with the status and number of tracks of each link.

#### Notes on fields

- `playCount` is the all-time number of plays Spotify shows for the track.
- `releaseDate` has the precision Spotify gives: `2007-04-22`, `2007-04` or `2007`.
- `worldRank` is set only for artists in Spotify's global ranking.
- Artist links without release types return the artist's 10 top tracks, with `artistTopTrackRank`. Discography rows also have it when the track is one of the top tracks.
- `discNumber` is empty for single track links; album, playlist and discography rows have it.
- Missing values are `null`. Every row has `observedAt` in UTC.

### FAQ

#### Does the official Spotify API give play counts?

No. The Spotify Web API only has a "popularity" score from 0 to 100. It's relative and can't be turned into a play count. This actor returns the exact count Spotify shows in its app.

#### How is this different from Spotify for Artists?

Spotify for Artists shows detailed stats, but only for your own music. This actor gives the public play counts and audience numbers of any artist, so you can track competitors, prospects, playlists and whole catalogs, and get the data as a spreadsheet or through an API.

#### How do I get daily streams?

Turn on **Compare with previous run**, save the input as a task and schedule it daily. From the second run on, `playCountChange` is the number of streams since the previous run. See [Track daily streams with scheduled runs](#track-daily-streams-with-scheduled-runs).

#### How accurate are the play counts?

They are the numbers Spotify shows in its app at the time of the run, not estimates. Every row has an `observedAt` timestamp.

#### How fast is it?

An album or a track takes about a second. In our tests, the full discographies of Drake and Taylor Swift (326 releases, 2,318 tracks) took about 80 seconds.

#### What links can I use?

Track, album, artist and playlist links from open.spotify.com (any language version), `spotify:` URIs and bare 22-character IDs. Podcasts and episodes have no play counts and are skipped.

#### Why is a link missing from the results?

The track, album or playlist was deleted, is unavailable, or the ID is wrong. The log says which link it was, the `OUTPUT` record shows its status, and you aren't charged for it.

#### Why did my run stop early?

If the log says the charge limit was reached, the run hit its maximum cost or your account's spending limit. Everything collected before that is saved. Raise the limit in the run options to collect more.

#### Do I need a Spotify account, API key or proxies?

No. The actor handles connections and retries itself and doesn't log in.

#### Is it legal to scrape Spotify play counts?

The actor collects publicly visible catalog data: play counts, track and album details and artist statistics. It doesn't collect personal data of listeners. You are responsible for how you use the data, including Spotify's terms.

### Cost

This actor uses pay-per-event pricing, with no subscription and no start fee:

**$2 per 1,000 Spotify links ($0.002 per link).** Each track, album, artist or playlist link counts once, whatever the number of tracks.

- **Artist discographies:** the artist counts as one link, and each album, single or EP it collects counts as one link.
- **Playlists:** every 100 tracks count as one link.
- Links that aren't found are free. Platform usage is included.

Example runs:

| Run                                                | Links per run | Cost          |
| -------------------------------------------------- | ------------- | ------------- |
| A 12-track album                                   | 1             | $0.002        |
| 1,000 track links                                  | 1,000         | $2.00         |
| Taylor Swift's full discography (154 releases)     | 155           | $0.31         |
| A new album, daily for 30 days                     | 1             | $0.06 a month |
| 10 albums, daily for 30 days                       | 10            | $0.60 a month |
| A 100-track playlist, daily for 30 days            | 1             | $0.06 a month |
| A\&R watchlist of 200 artists, daily for 30 days    | 200           | $12 a month   |
| Roster of 20 artists with 30 releases each, weekly | 620           | $5.40 a month |
| 10 artists in a listeners market, every 3 hours    | 10            | $4.80 a month |

Set a maximum cost per run; the actor stops cleanly when it's reached. The **Pricing** tab always shows the current prices.

### Support

Report problems or request features in the **Issues** tab. Include the run ID, the input and what you expected. We read every issue.

This actor is not affiliated with or endorsed by Spotify AB or Polymarket. "Spotify" is a trademark of Spotify AB. Nothing here is financial advice.

# Actor input Schema

## `urls` (type: `array`):

One per line: track, album, artist or playlist URLs (e.g. https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm), spotify: URIs or bare IDs. Each track gets its own row with its exact play count.

## `artistReleases` (type: `array`):

Which releases to collect for artist links. Leave empty for the artist's profile (monthly listeners, followers, world rank, top cities) and its 10 top tracks. Pick release types to get every track of the artist's discography.

## `compareWithPreviousRun` (type: `boolean`):

Remember play counts between runs and add the previous play count, the change since then and when it was seen. Turn it on in a schedule (e.g. daily) to track streams per day. Artists get the change in monthly listeners.

## `maxTracksPerUrl` (type: `integer`):

Stop after this many tracks per playlist, album or artist. Set to 0 for all tracks.

## Actor input object example

```json
{
  "urls": [
    "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
    "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd"
  ],
  "artistReleases": [],
  "compareWithPreviousRun": false,
  "maxTracksPerUrl": 0
}
```

# Actor output Schema

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

No description

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

No description

## `summary` (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 = {
    "urls": [
        "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
        "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("epicscrapers/spotify-play-count-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 = { "urls": [
        "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
        "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("epicscrapers/spotify-play-count-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 '{
  "urls": [
    "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
    "https://open.spotify.com/track/2x8evxqUlF0eRabbW2JBJd"
  ]
}' |
apify call epicscrapers/spotify-play-count-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epicscrapers/spotify-play-count-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/b9HdBJhpjg2VVfBOc/builds/xG5xBf44y2Jo9686j/openapi.json
