# Spotify Track Search 🎵 (`easyapi/spotify-track-search`) Actor

Extract and search Spotify tracks data using keywords. Get comprehensive track information including artists, album details, track URLs, and preview links - perfect for music data analysis and content discovery.

- **URL**: https://apify.com/easyapi/spotify-track-search.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Integrations, Social media
- **Stats:** 25 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $4.99 / 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 Track Search 🎵

Extract detailed track information from Spotify using search keywords. This Actor helps you gather comprehensive music data including track details, artist information, album metadata, and more.

### Features 🌟

- Search Spotify tracks using keywords
- Get detailed track information including:
  - Track title and ID
  - Artist details
  - Album information
  - Release dates
  - Duration
  - Preview URLs
  - Spotify URIs and external links

### Use Cases 💡

- Music data analysis and research
- Content discovery and curation
- Playlist generation
- Music industry insights
- Artist research
- Marketing analysis

### Output 📊

The Actor outputs JSON format data containing:

- Track title and artists
- Album details and release date
- Track duration and number
- Spotify URLs for both track and album
- Preview URL (when available)
- Unique identifiers (Track ID, Album ID, URI)

### Input Parameters ⚙️

| Parameter | Type | Description |
|-----------|------|-------------|
| searchQuery | String | The search term to find tracks on Spotify |

### Cost & Usage 💰

- Memory: 256 MB
- Compute Units: Minimal usage
- Typical runtime: ~1-2 seconds per search query

#### Input Example

A full explanation of an input example in JSON.

```
{
    "searchQuery": "wind"
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```json
[
    {
        "title": "Winds of Change (feat. myndstream)",
        "artists": [
            "Timbaland",
            "Malte Marten",
            "myndstream"
        ],
        "albumArtists": [
            "Timbaland",
            "Malte Marten"
        ],
        "trackId": "3bIDLdalTypKnBGYK7wsrG",
        "albumReleaseDate": "2024-12-05",
        "albumId": "1oL6jSjfCVu2ugtzFK7dYp",
        "totalAlbumTracks": 10,
        "durationMs": 183773,
        "uri": "spotify:track:3bIDLdalTypKnBGYK7wsrG",
        "albumUrl": "https://open.spotify.com/album/1oL6jSjfCVu2ugtzFK7dYp",
        "trackUrl": "https://open.spotify.com/track/3bIDLdalTypKnBGYK7wsrG",
        "previewUrl": "https://p.scdn.co/mp3-preview/8c846cfdee134ce9ab79d1333448f3653df592cd?cid=acc6302297e040aeb6e4ac1fbdfd62c3"
    },
    {
        "title": "Wind It Up",
        "artists": [
            "Gwen Stefani"
        ],
        "albumArtists": [
            "Gwen Stefani"
        ],
        "trackId": "1GeECVH4Msg1zLm8DExkbH",
        "albumReleaseDate": "2006-01-01",
        "albumId": "7xnZ539lh8x6de9jzlpCJp",
        "totalAlbumTracks": 12,
        "durationMs": 189586,
        "uri": "spotify:track:1GeECVH4Msg1zLm8DExkbH",
        "albumUrl": "https://open.spotify.com/album/7xnZ539lh8x6de9jzlpCJp",
        "trackUrl": "https://open.spotify.com/track/1GeECVH4Msg1zLm8DExkbH",
        "previewUrl": null
    },
    ...
]
```

# Actor input Schema

## `searchQuery` (type: `string`):

Enter keyword(s) to search for tracks on Spotify

## Actor input object example

```json
{
  "searchQuery": "wind"
}
```

# 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 = {
    "searchQuery": "wind"
};

// Run the Actor and wait for it to finish
const run = await client.actor("easyapi/spotify-track-search").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 = { "searchQuery": "wind" }

# Run the Actor and wait for it to finish
run = client.actor("easyapi/spotify-track-search").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 '{
  "searchQuery": "wind"
}' |
apify call easyapi/spotify-track-search --silent --output-dataset

```

## MCP server setup

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

```

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/LQ4RXb62OZFDunITo/builds/T1g5nhVDQmh8tNU9t/openapi.json
