# Spotify Artist Scraper (`khadinakbar/spotify-artist-scraper`) Actor

Scrape Spotify artist data — monthly listeners, followers, world rank, top cities, top tracks, and discography — by URL, ID, or artist name. HTTP-only, no API key. MCP/API-ready.

- **URL**: https://apify.com/khadinakbar/spotify-artist-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, MCP servers
- **Stats:** 10 total users, 9 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 artist scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Spotify Artist Scraper

Scrape **Spotify artist data** — monthly listeners, followers, world rank, top cities, biography, verified status, top tracks, and a discography summary — from a Spotify **URL, URI, ID, or just an artist name**. HTTP-only, no login, no API key. Built for AI agents (MCP-ready) and bulk lists alike.

### What you get

One flat record per artist:

| Field | Description |
|---|---|
| `name`, `id`, `uri`, `url` | Artist identity + canonical Spotify link |
| `verified` | Whether the artist profile is verified |
| `biography` | Artist bio text (when present) |
| `monthlyListeners` | Current monthly listeners (Partner API) |
| `followers` | Total followers |
| `worldRank` | Global popularity rank (when available) |
| `topCities[]` | Top listener cities — `city`, `country`, `region`, `listeners` |
| `topTracks[]` | Top tracks — `name`, `id`, `uri`, `playcount`, `durationMs`, `explicit` |
| `discography` | `albumCount`, `singleCount`, `compilationCount`, and `latest` release |
| `externalLinks[]` | Artist's linked socials/sites |
| `avatarImage`, `headerImage` | Profile + header image URLs |
| `popularityDataAvailable`, `dataSource`, `scrapedAt` | Provenance + ISO-8601 timestamp |

### When to use it

- A\&R scouts and labels tracking an artist's reach, growth, and geography
- Music marketers and playlist pluggers prioritising by monthly listeners / world rank
- Analysts building artist datasets keyed on top cities and catalog size
- AI agents that need structured Spotify artist data from a name or URL

**Not for** albums, tracks, playlists, or podcasts — use the **Spotify All-in-One Scraper** for those.

### Input

| Field | Type | Notes |
|---|---|---|
| `artists` | string\[] | Artist URLs, URIs, or bare 22-char IDs |
| `artistNames` | string\[] | Free-text names; resolved to the top-matching artist via search |
| `maxResults` | integer | Cap on artists returned/billed (default 50) |
| `responseFormat` | `concise` | `detailed` | `detailed` returns the full top-track list |
| `proxyConfiguration` | object | Defaults to Apify Residential (required) |

#### Example input

```json
{
  "artists": [
    "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
    "spotify:artist:06HL4z0CvFAxyc27GXpf02"
  ],
  "artistNames": ["Billie Eilish"],
  "maxResults": 50,
  "responseFormat": "concise"
}
```

#### Example output (truncated, synthetic)

```json
{
  "type": "artist",
  "id": "0TnOYISbd1XYRBk9myaseg",
  "url": "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
  "name": "Example Artist",
  "verified": true,
  "monthlyListeners": 41250000,
  "followers": 9800000,
  "worldRank": 42,
  "topCities": [
    { "city": "Mexico City", "country": "MX", "region": null, "listeners": 980000 }
  ],
  "topTracks": [
    { "name": "Example Track", "id": "1abc...", "playcount": 512000000, "durationMs": 201000, "explicit": false }
  ],
  "discography": { "albumCount": 6, "singleCount": 28, "compilationCount": 1, "latest": { "name": "New Single", "type": "SINGLE", "date": "2026-05-01" } },
  "popularityDataAvailable": true,
  "dataSource": "partner",
  "scrapedAt": "2026-06-20T00:00:00.000Z"
}
```

### Pricing

Pay-per-event:

- **Actor start** — $0.00005 per run
- **Artist scraped** — $0.005 per artist record returned

A 50-artist run costs about **$0.25**. You are billed only for records actually returned.

### How it works

The actor extracts Spotify's current web-player TOTP secret and GraphQL operation hashes **at runtime**, so it self-heals when Spotify rotates them. It calls Spotify's Partner API for rich popularity data and falls back to the public embed page for baseline metadata if the token is unavailable. Apify Residential proxies are used by default because Spotify's edge (Akamai) blocks datacenter IPs.

### MCP / AI agents

This actor is MCP-ready. Exposed via Apify MCP as `apify--spotify-artist-scraper`. Give an agent an artist name or URL and it returns structured JSON it can reason over directly.

### Legal

Use this actor in compliance with Spotify's Terms of Service and applicable laws. It collects only publicly available data and performs no login or authentication. You are responsible for how you use the data. This actor is not affiliated with or endorsed by Spotify.

# Actor input Schema

## `artists` (type: `array`):

Spotify artists to scrape, each as a profile URL (https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg), a URI (spotify:artist:0TnOYISbd1XYRBk9myaseg), or a bare 22-character artist ID. Locale URL prefixes like /intl-de/ are accepted. Non-artist references (album, track, playlist, podcast) are skipped with a warning — this actor returns artists only.

## `artistNames` (type: `array`):

Artist names to look up when you do not have a URL or ID (e.g. 'Taylor Swift', 'Bad Bunny'). Each name is resolved to the top-matching Spotify artist via search, then scraped. One search request is used per name. Use the 'artists' field instead when you already have the exact URL/ID to avoid ambiguous matches.

## `maxResults` (type: `integer`):

Maximum number of artist records to return and bill for in one run. The run stops once this cap is hit. Defaults to 50. Set lower to cap cost on large input lists; one artist is billed per record at $0.005.

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

Controls record richness. 'concise' (default) returns the artist profile, stats, top cities, discography summary, and up to 10 top tracks — compact for AI agents. 'detailed' returns the full top-track list. It does NOT page through the full discography; both modes return discography counts plus the latest release.

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

Proxy settings. Defaults to Apify automatic (datacenter) proxy, which clears Spotify's token and Partner API and is available on every Apify account. Residential also works if you prefer it — set it here. Geo is not required; Spotify popularity data is global, so the actor uses US automatically.

## Actor input object example

```json
{
  "artists": [
    "spotify:artist:3TVXtAsR1Inumwj472S9r4"
  ],
  "artistNames": [
    "The Weeknd",
    "Dua Lipa"
  ],
  "maxResults": 50,
  "responseFormat": "concise",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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 = {
    "artists": [
        "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
    ],
    "artistNames": [
        "Billie Eilish"
    ],
    "maxResults": 50,
    "responseFormat": "concise",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/spotify-artist-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 = {
    "artists": [
        "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
        "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02",
    ],
    "artistNames": ["Billie Eilish"],
    "maxResults": 50,
    "responseFormat": "concise",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/spotify-artist-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "artists": [
    "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
    "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
  ],
  "artistNames": [
    "Billie Eilish"
  ],
  "maxResults": 50,
  "responseFormat": "concise",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call khadinakbar/spotify-artist-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khadinakbar/spotify-artist-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/NYrk0up1ZYFLXQ3fS/builds/fzEI6JgVnpjKNLVZg/openapi.json
