# Spotify Search Albums (`headlessagent/spotify-search-albums`) Actor

Search Spotify albums by keyword. Supports multiple queries in a single run.

- **URL**: https://apify.com/headlessagent/spotify-search-albums.md
- **Developed by:** [Headless Agent](https://apify.com/headlessagent) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 results

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?

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 Search Albums

Search Spotify albums by keyword. Run multiple queries in a single Actor run. No API key required.

### 🤔 What can this Actor do?

This Actor lets you **search Spotify albums** by one or more keywords and extract structured album data in bulk.

🔍 Search albums by **title, artist name, or any keyword**

💿 Get structured **album metadata** — type, release year, image sets, and color palette

📦 Run **multiple queries at once** — each query produces its own dataset item

🔁 Rotate **proxies** to avoid rate limiting (optional)

📦 Download results in **JSON, CSV, XML, or Excel** from the Apify Dataset

🦾 Integrate via **API, webhooks, SDKs** (Python & Node.js), or connect with Zapier, n8n, Make, and more

### ✅ What data does this Actor return?

For each album item, the Actor returns:

- Album type, URI, ID, name
- Album type label, release year, playable status, pre-release status
- Artists list (name, URI)
- Album images in multiple sizes
- Album colors converted to hex (dominant, encore text, contrast palettes)

### 🔧 How to use

1. [Create](https://console.apify.com/sign-up) a free Apify account.
2. Open **Spotify Search Albums**.
3. Enter one or more search **queries** (e.g. `["different world alan walker", "x coldplay"]`).
4. Optionally adjust **limit**, **numberOfTopResults**, and **proxy** settings.
5. Click **Save & Start** and wait for the results.
6. Download your data in JSON, CSV, XML, Excel, or access it via the Apify API.

### ⬇️ Input

| Field                  | Type       | Description                                                                 |
| ---------------------- | ---------- | --------------------------------------------------------------------------- |
| `queries`              | `string[]` | **Required.** List of search keywords. Results are flattened to one album per dataset item. |
| `limit`                | `integer`  | Max results per query (default: `10`).                                      |
| `numberOfTopResults`   | `integer`  | Number of top results to include (default: `5`).                            |
| `proxyConfiguration`   | `object`   | Optional. Apify Proxy or custom proxy URLs.                                 |

Offset is handled internally by the Actor (starts from `0`) and is not exposed as input.

#### Example input

```json
{
    "queries": ["different world alan walker", "x coldplay", "midnights taylor swift"],
    "limit": 10,
    "numberOfTopResults": 5
}
```

### ⬆️ Output

Each album result is pushed as one dataset item:

```json
{
    "query": "different world alan walker",
    "data": {
        "type": "album",
        "id": "1vLYpcbwwGVClagTen3lXN",
        "uri": "spotify:album:1vLYpcbwwGVClagTen3lXN",
        "name": "2001x",
        "album_type": "SINGLE",
        "year": 2026,
        "playable": true,
        "pre_release": false,
        "artists": [
            {
                "name": "Adrian Khalif",
                "uri": "spotify:artist:6X28gNASnalAWseUA8uI4X"
            }
        ],
        "images": [
            {
                "width": 640,
                "height": 640,
                "url": "https://i.scdn.co/image/ab67616d0000b273e7cecaed4e0dfbb8acfd371e"
            },
            {
                "width": 300,
                "height": 300,
                "url": "https://i.scdn.co/image/ab67616d00001e02e7cecaed4e0dfbb8acfd371e"
            },
            {
                "width": 64,
                "height": 64,
                "url": "https://i.scdn.co/image/ab67616d00004851e7cecaed4e0dfbb8acfd371e"
            }
        ],
        "colors": {
            "dominant": "#383038",
            "encore_text": "#C2B8C2",
            "high_contrast": {
                "background": "#383038",
                "background_tinted": "#5A515A",
                "text": "#FFFFFF",
                "accent": "#FFFFFF",
                "subdued": "#D5CAD4"
            }
        }
    }
}
```

### 🔗 Integrations

Connect this Actor with your favorite tools via [Apify integrations](https://apify.com/integrations): **Zapier, n8n, Make, Slack, Google Sheets, Google Drive, Airbyte, GitHub**, and many more.

Use [webhooks](https://docs.apify.com/integrations/webhooks) to trigger actions automatically when a run finishes.

### 🦾 Using the Apify API

- **Python**: [`apify-client`](https://pypi.org/project/apify-client/) on PyPI
- **Node.js**: [`apify-client`](https://www.npmjs.com/package/apify-client) on NPM

### ❓ FAQ

#### Does this require a Spotify account or API key?

No. This Actor works without a Spotify account or API key — authentication tokens are generated automatically per session.

#### Can I run multiple search queries at once?

Yes. Pass an array to the `queries` field. Each query runs independently and produces its own dataset item.

#### Is it legal to scrape Spotify?

This Actor only accesses publicly available Spotify data. Ensure you have a legitimate purpose and consult legal counsel if unsure. See also Apify's blog on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `queries` (type: `array`):

List of search keywords to run. Each query produces one dataset item.

## `limit` (type: `integer`):

Maximum number of results per query (default: 10).

## `numberOfTopResults` (type: `integer`):

Number of top results to include per query (default: 5).

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

Optional. Use Apify Proxy (RESIDENTIAL, DATACENTER) or custom proxy URLs.

## Actor input object example

```json
{
  "queries": [
    "different world alan walker",
    "x coldplay",
    "midnights taylor swift"
  ],
  "limit": 10,
  "numberOfTopResults": 5
}
```

# 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 = {
    "queries": [
        "different world alan walker",
        "x coldplay",
        "midnights taylor swift"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("headlessagent/spotify-search-albums").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 = { "queries": [
        "different world alan walker",
        "x coldplay",
        "midnights taylor swift",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("headlessagent/spotify-search-albums").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 '{
  "queries": [
    "different world alan walker",
    "x coldplay",
    "midnights taylor swift"
  ]
}' |
apify call headlessagent/spotify-search-albums --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,headlessagent/spotify-search-albums"
        }
    }
}

```

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/f7aanhjCEXC8vP8Ix/builds/wcdftWi5EHqa2ZhW4/openapi.json
