# Spotify Track Metadata and Audio-Feature Availability Scraper (`w3crawler/spotify-audio-features-scraper`) Actor

Collect public Spotify track metadata and return official audio-feature vectors when supplied credentials have eligible Spotify API access.

- **URL**: https://apify.com/w3crawler/spotify-audio-features-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 track metadata & audio features

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 Track Metadata and Audio-Feature Availability Scraper

Extract **public Spotify track metadata** and determine whether public audio-preview or audio-feature data is exposed on the page. The Actor returns track identity, artists, album context, release year, duration, and visible play count, then reports audio-feature availability explicitly: tempo, key, danceability, energy, valence, and similar vectors are **not invented** when Spotify's public page does not expose them.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/spotify-audio-features-scraper) and select **Try for free** or open the **Input** tab.
2. Add one to 25 public track URLs or 22-character track IDs to `trackUrls`.
3. Keep `includeAudioFeatures` enabled to record the public availability outcome in every row.
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

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

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `trackUrls` | string array | Required | Not supplied | One to 25 public `open.spotify.com/track/...` URLs or 22-character Spotify track IDs. |
| `includeAudioFeatures` | boolean | Optional | `true` | Report the public audio-feature availability outcome. This does not compute features and never enables audio decoding. |
| `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, 100000–5000000 bytes. |
| `proxyConfiguration` | object | Optional | `{"useApifyProxy":false}` | Optional Apify Proxy settings; direct browsing is the default. |

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

```json
{
  "includeAudioFeatures": true,
  "requestDelayMs": 1000,
  "timeoutSecs": 45,
  "maxResponseBytes": 3000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

The Actor reads anonymous, public Spotify track pages. It does not log in, call the official Web API or audio-features endpoint, capture Web Player tokens, download audio, decode audio, or solve access challenges.

### Output

The dataset contains one row per saved track. Optional values are omitted rather than inferred, and no diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordId` | string | Always | Stable key in the form `spotify_track_<trackId>`. |
| `recordType` | string | Always | Row discriminator; always `track`. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `trackId` | string | Always | 22-character public Spotify track ID. |
| `name` | string | Always | Track title rendered on the public page. |
| `spotifyUrl` | string | Always | Canonical `https://open.spotify.com/track/<id>` URL. |
| `artists` | object array | When artist links are visible | Linked artists with `artistId`, `name`, and `spotifyUrl`. |
| `artistNames` | string | When artist names are visible | Comma-separated artist names. |
| `album` | string | When the track header exposes it | Album title. |
| `albumId` | string | When an album link is visible | Public album ID. |
| `albumUrl` | string | When an album link is visible | Public album URL. |
| `imageUrl` | string | When `og:image` is exposed | Artwork URL. It was not present in the saved run. |
| `releaseYear` | integer | When rendered | Release year, at least 0. |
| `durationMs` | integer | When rendered | Duration in milliseconds, at least 0. |
| `durationFormatted` | string | When rendered | Duration as displayed by Spotify. |
| `playCount` | integer | When rendered | Public play count, at least 0. |
| `audioFeaturesAvailable` | boolean | Always | Always `false` for anonymous public pages; it is never inferred from audio. |
| `audioFeaturesStatus` | string | Always | `unavailable_public_page`, `not_requested`, or `preview_available_features_not_computed`. |
| `audioFeaturesNote` | string | Always | Explanation of the public-data boundary recorded for the row. |
| `publicPreviewAvailable` | boolean | Always | Whether a public preview reference was visible. |
| `publicPreviewUrl` | string | When preview tags are exposed | Public preview URL. It was not present in the saved run. |
| `publicPreviewMimeType` | string | When preview tags are exposed | Preview MIME type. It was not present in the saved run. |
| `publicPreviewDurationSeconds` | integer | When preview tags are exposed | Preview duration in seconds, at least 0. |
| `publicPreviewSource` | string | When preview tags are exposed | Metadata source for the preview reference. |
| `previewMetricsStatus` | string | Always | `metadata_only_not_decoded` when preview metadata exists; otherwise `no_public_preview_metadata`. |
| `sourceUrl` | string | Always | Exact public page URL that produced the row. Observed field not declared in `dataset_schema.json`. |

The saved run observed no public preview tags, so `publicPreviewUrl`, `publicPreviewMimeType`, `publicPreviewDurationSeconds`, `publicPreviewSource`, and `imageUrl` are absent from its row. They remain declared schema fields and are emitted only when the page exposes them.

#### Full JSON output

The example below is a real saved row from the 2026-10-25 verification run.

```json
{
  "recordId": "spotify_track_3C0nOe05EIt1390bVABLyN",
  "recordType": "track",
  "scrapedAt": "2026-10-25T20:58:41.591Z",
  "trackId": "3C0nOe05EIt1390bVABLyN",
  "name": "On The Floor",
  "spotifyUrl": "https://open.spotify.com/track/3C0nOe05EIt1390bVABLyN",
  "artists": [
    {
      "artistId": "2DlGxzQSjYe5N6G9nkYghR",
      "name": "Jennifer Lopez",
      "spotifyUrl": "https://open.spotify.com/artist/2DlGxzQSjYe5N6G9nkYghR"
    }
  ],
  "artistNames": "Jennifer Lopez",
  "album": "Love?",
  "albumId": "3sysiYphqNRQw7VKLCg1yE",
  "albumUrl": "https://open.spotify.com/album/3sysiYphqNRQw7VKLCg1yE",
  "releaseYear": 2011,
  "durationMs": 284000,
  "durationFormatted": "4:44",
  "playCount": 1313346286,
  "audioFeaturesAvailable": false,
  "audioFeaturesStatus": "unavailable_public_page",
  "audioFeaturesNote": "Spotify public track pages exposed no public preview metadata; audio-feature vectors such as tempo, key, danceability, energy, or valence are unavailable.",
  "publicPreviewAvailable": false,
  "previewMetricsStatus": "no_public_preview_metadata",
  "sourceUrl": "https://open.spotify.com/track/3C0nOe05EIt1390bVABLyN"
}
```

### 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 the outcome and the audio-feature and preview counts.

| Field | Meaning |
| --- | --- |
| `recordType` | Always `runSummary`. |
| `status` | Actor outcome: `SUCCEEDED` or `FAILED`. |
| `requestedTrackCount` | Track inputs requested. |
| `trackRecordCount` | Track records produced. |
| `errorRecordCount` | Track pages that failed extraction. |
| `recordsStored` | Track rows saved to the dataset. |
| `audioFeaturesAvailableCount` | Rows with publicly available audio features; always `0` for this public-page workflow. |
| `audioFeaturesUnavailableCount` | Rows reporting no public audio-feature data. |
| `publicPreviewObservedCount` | Rows with a public preview reference. |
| `previewMetricsComputedCount` | Preview metrics computed; always `0` because previews are metadata-only. |
| `includeAudioFeatures` | Audio-feature reporting setting used for the run. |
| `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` | Every requested track produced a row without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | At least one row was saved, but another track or output write failed. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The run completed cleanly and produced no track rows. |
| `FAILED` | `FAILED` | The run failed before any usable track row was saved. |

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

```json
{
  "recordType": "runSummary",
  "status": "SUCCEEDED",
  "requestedTrackCount": 1,
  "trackRecordCount": 1,
  "errorRecordCount": 0,
  "recordsStored": 1,
  "audioFeaturesAvailableCount": 0,
  "audioFeaturesUnavailableCount": 1,
  "publicPreviewObservedCount": 0,
  "previewMetricsComputedCount": 0,
  "includeAudioFeatures": true,
  "authenticationMode": "anonymous_public_page",
  "sourceTransport": "anonymous Chromium public page",
  "startedAt": "2026-10-25T20:58:28.832Z",
  "completedAt": "2026-10-25T20:58:42.105Z",
  "durationMs": 13273,
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "failureCount": 0,
  "outputWriteFailureCount": 0
}
```

### Coverage and limitations

The Actor reads public track-page metadata only. Spotify's anonymous public pages do not expose its audio-feature vector, so `audioFeaturesAvailable` is always `false` and no tempo, key, danceability, energy, valence, loudness, or similar value is calculated or guessed. `includeAudioFeatures` controls whether this availability outcome is reported; it does not call the official audio-features API.

Preview fields are limited to references visible in public page metadata such as `og:audio` and `music:duration`. When such metadata is absent, the preview fields are omitted and `previewMetricsStatus` reports `no_public_preview_metadata`; the Actor never downloads or decodes audio. Duration, play count, release year, album context, and artwork are page-dependent. Failed track 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 and the number of track pages. Start with a few tracks, 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-audio-features-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-audio-features-scraper/changelog.md

# Actor input Schema

## `trackUrls` (type: `array`):

One to 25 Spotify track URLs or 22-character IDs.

## `includeAudioFeatures` (type: `boolean`):

Report whether audio-feature vectors are present on the public page. This remains false for anonymous public pages.

## `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.

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

Optional Apify Proxy configuration; direct browsing is default.

## Actor input object example

```json
{
  "trackUrls": [
    "https://open.spotify.com/track/3RiPr603aXAoi4GHyXx0uy"
  ],
  "includeAudioFeatures": true,
  "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 = {
    "trackUrls": [
        "https://open.spotify.com/track/3RiPr603aXAoi4GHyXx0uy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/spotify-audio-features-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 = { "trackUrls": ["https://open.spotify.com/track/3RiPr603aXAoi4GHyXx0uy"] }

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/spotify-audio-features-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 '{
  "trackUrls": [
    "https://open.spotify.com/track/3RiPr603aXAoi4GHyXx0uy"
  ]
}' |
apify call w3crawler/spotify-audio-features-scraper --silent --output-dataset

```

## MCP server setup

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