# Spotify Related Artists Graph Scraper (`w3crawler/spotify-related-artists-graph-scraper`) Actor

Validate a public Spotify artist seed and report the current availability of related-artist graph edges.

- **URL**: https://apify.com/w3crawler/spotify-related-artists-graph-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 related artists

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 Related Artists Graph Scraper

Capture the public **Fans also like** relationship shelf for a seed artist and optionally follow a tightly bounded second hop. The Actor writes a seed row for the requested artist plus one edge row per related artist rendered by Spotify, using only stable public artist links and without creating synthetic relationships.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-related-artists-graph-scraper) and select **Try for free**, or open the **Input** tab.
2. Enter one public Spotify artist URL or 22-character artist ID in `seedArtistUrl`.
3. Keep `depth` at `1` for the seed shelf, or set `2` to also visit up to five related artist pages. Keep the other defaults 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

`seedArtistUrl` 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 |
| --- | --- | --- | --- | --- |
| `seedArtistUrl` | string | Required | Not supplied | Public Spotify artist URL or 22-character artist ID. 1–300 characters. |
| `market` | string | Optional | `"US"` | Two-letter provenance label copied to output. No market-filtered API request is made. |
| `depth` | integer | Optional | `1` | `1` reads the seed shelf; `2` also visits up to five related public artist pages. 1–2. |
| `maxRelatedArtists` | integer | Optional | `10` | Maximum Fans also like cards retained per visited artist. 1–25. |
| `requestDelayMs` | integer | Optional | `1000` | Polite delay before browser navigation, in milliseconds. 0–30000. |
| `timeoutSecs` | integer | Optional | `45` | Timeout for each public page, in seconds. 10–90. |
| `maxResponseBytes` | integer | Optional | `3000000` | Maximum initial page response size, in bytes. 100000–5000000. |
| `proxyConfiguration` | object | Optional | `{"useApifyProxy":false}` | Optional Apify Proxy configuration; direct browsing is the default. |

Full default input:

```json
{
  "market": "US",
  "depth": 1,
  "maxRelatedArtists": 10,
  "requestDelayMs": 1000,
  "timeoutSecs": 45,
  "maxResponseBytes": 3000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

The default input omits the required `seedArtistUrl` field; supply one artist before running. The Actor reads anonymous public artist pages. It does not use the official Spotify Web API, credentials, login sessions, Web Player tokens, browser network payloads, audio downloads, or access-control bypasses.

### Output

The dataset contains one `relatedArtistSeed` row for the requested artist and zero or more `relatedArtistEdge` rows for the observed **Fans also like** shelf. Missing optional values are omitted rather than inferred, and no synthetic edges or diagnostic rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordId` | string | Always | Stable Actor record key. |
| `recordType` | string enum | Always | Row discriminator: `relatedArtistSeed` or `relatedArtistEdge`. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `artistId` | string | Always | Seed artist ID on every row in the graph. |
| `name` | string | Always | Seed artist name on seed and edge rows. |
| `spotifyUrl` | string | Always | Public seed artist URL. |
| `description` | string | When published | Public artist description when rendered. |
| `imageUrl` | string | When published | Public artist artwork when rendered. |
| `monthlyListeners` | integer | Seed row | Public monthly listener count when exposed. |
| `worldRank` | integer | Seed row | Public artist rank when exposed. |
| `market` | string | Always | Requested two-letter provenance label. |
| `marketObserved` | string | Always | Observed locale or market label. |
| `marketApplied` | boolean | Always | Always `false`; no market filter is applied. |
| `depth` | integer | Always | `0` for the seed row, `1` or `2` for edge rows. |
| `observedFromArtistId` | string | When published | Artist page from which an edge was observed, when recorded. |
| `pageTitleAvailable` | boolean | Always | Whether a public page title was observed. |
| `visibleRelatedArtistCount` | integer | Always | Related artist cards visible on the page. |
| `relationshipRecordCount` | integer | Always | Edge rows observed for the page. |
| `relatedArtistsStatus` | string | Always | Related-artist availability status, such as `public_preview`. |
| `relationshipEvidenceStatus` | string | Always | Evidence status for the observed relationship. |
| `relatedArtistId` | string | Edge rows | Related artist ID. |
| `relatedArtistName` | string | Edge rows | Related artist name. |
| `relatedArtistUrl` | string | Edge rows | Public related artist URL. |
| `relatedArtistImageUrl` | string | Edge rows | Related artist artwork URL. |
| `relationship` | string | Edge rows | Observed relationship label, such as `fans_also_like`. |
| `relationshipRank` | integer | Edge rows | Visible order of the related artist card. |
| `sourceUrl` | string | Always | Public artist page used for the row. Observed in saved rows; not declared in the dataset schema. |

#### Full JSON output

The example below is an unchanged `relatedArtistEdge` row saved by the 2026-10-25 run. Seed-only listener and rank fields are absent from edge rows.

```json
{
  "recordId": "spotify_related_edge_0TnOYISbd1XYRBk9myaseg_0jnsk9HBra6NMjO2oANoPY",
  "recordType": "relatedArtistEdge",
  "artistId": "0TnOYISbd1XYRBk9myaseg",
  "name": "Pitbull",
  "spotifyUrl": "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
  "market": "US",
  "marketObserved": "US",
  "marketApplied": false,
  "depth": 1,
  "sourceUrl": "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg",
  "scrapedAt": "2026-10-25T21:03:13.748Z",
  "pageTitleAvailable": true,
  "visibleRelatedArtistCount": 5,
  "relationshipRecordCount": 5,
  "relatedArtistsStatus": "public_preview",
  "relatedArtistId": "0jnsk9HBra6NMjO2oANoPY",
  "relatedArtistName": "Flo Rida",
  "relatedArtistUrl": "https://open.spotify.com/artist/0jnsk9HBra6NMjO2oANoPY",
  "relatedArtistImageUrl": "https://i.scdn.co/image/ab67616100005174655ca8f3196953554b479452",
  "relationship": "fans_also_like",
  "relationshipRank": 1,
  "relationshipEvidenceStatus": "stable_related_artist_id_rendered"
}
```

### 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`. |
| `seedArtistId` | Seed artist ID used for the graph. |
| `seedArtistName` | Seed artist name. |
| `requestedDepth` | Requested traversal depth. |
| `maxSecondHopArtists` | Maximum second-hop artists allowed. |
| `market` | Requested market label. |
| `marketApplied` | Whether market filtering was applied; always `false`. |
| `visitedArtistCount` | Artist pages visited. |
| `artistRecordCount` | Seed rows saved. |
| `relationshipRecordCount` | Edge rows saved. |
| `recordsStored` | Total dataset rows saved. |
| `relatedArtistsStatus` | Recorded related-artist availability status. |
| `relationshipScope` | Relationship scope, such as `fans_also_like_one_hop`. |
| `authenticationMode` | Extraction mode, `anonymous_public_page` in the saved 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` | `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 artist page completed cleanly with no visible related artist 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",
  "seedArtistId": "0TnOYISbd1XYRBk9myaseg",
  "seedArtistName": "Pitbull",
  "requestedDepth": 1,
  "maxSecondHopArtists": 5,
  "market": "US",
  "marketApplied": false,
  "visitedArtistCount": 1,
  "artistRecordCount": 1,
  "relationshipRecordCount": 5,
  "recordsStored": 6,
  "relatedArtistsStatus": "public_preview",
  "relationshipScope": "fans_also_like_one_hop",
  "authenticationMode": "anonymous_public_page",
  "startedAt": "2026-10-25T21:02:54.315Z",
  "completedAt": "2026-10-25T21:03:14.236Z",
  "durationMs": 19921,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

The Actor reads the rendered **Fans also like** shelf and records only artist cards backed by stable public artist links. It does not call a related-artists API, use browser network payloads, or invent edges to fill a graph. `depth: 1` visits the seed page only; `depth: 2` additionally visits up to five related artists and records their shelves, subject to `maxRelatedArtists` per page. The seed row uses `depth: 0`.

`monthlyListeners` and `worldRank` are seed-page header values, not graph-wide metrics, and are absent from edge rows. `description` and `imageUrl` appear only when the rendered page exposes them. A missing shelf does not prove that an artist has no related artists; it means no stable public cards were observable during the run. Private pages, access challenges, and page changes cannot be recovered. `market` is a provenance label only. `sourceUrl` is present in saved rows even though the dataset schema does not declare it.

### Usage and support

Compute charges vary with browser time and the number of visited pages. Depth `2` can visit up to six artist pages and cost more than a one-hop graph; start with `depth: 1` and a small `maxRelatedArtists` value. See the Actor's Pricing tab for current account rates.

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

# Actor input Schema

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

Public Spotify artist URL or 22-character artist ID.

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

Two-letter provenance label; no API market request is made.

## `depth` (type: `integer`):

One hop reads the seed shelf; two hops also visit up to five related public artist pages.

## `maxRelatedArtists` (type: `integer`):

Maximum Fans also like cards retained per visited artist.

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

Polite delay before browser navigation.

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

Timeout for each public page.

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

Maximum initial page response size.

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

Optional Apify Proxy configuration; direct browsing is default.

## Actor input object example

```json
{
  "seedArtistUrl": "https://open.spotify.com/artist/4gzpq5DPGxSnKTe4SA8HAU",
  "market": "US",
  "depth": 1,
  "maxRelatedArtists": 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 = {
    "seedArtistUrl": "https://open.spotify.com/artist/4gzpq5DPGxSnKTe4SA8HAU"
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/spotify-related-artists-graph-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 = { "seedArtistUrl": "https://open.spotify.com/artist/4gzpq5DPGxSnKTe4SA8HAU" }

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/spotify-related-artists-graph-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 '{
  "seedArtistUrl": "https://open.spotify.com/artist/4gzpq5DPGxSnKTe4SA8HAU"
}' |
apify call w3crawler/spotify-related-artists-graph-scraper --silent --output-dataset

```

## MCP server setup

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