---
related_nodes: ["spotify_add_to_queue", "spotify_get_playlists", "spotify_playback_control"]
---

# Spotify Search

## Overview

Searches Spotify for tracks, albums, artists, and/or playlists.
Returns grouped results in one `output` object with arrays for each resource type.

Query can come from input (`input.query`) or node configuration.
Input query takes precedence.

## When to Use

- Find tracks before queueing or playback
- Resolve user text prompts into Spotify URIs
- Discover playlists/artists for recommendation workflows

## Configuration

**connection** (required)
- Spotify connection from workspace Settings → Connections

**query** (optional)
- Search text; overridden by input `query`

**search_types** (required, default: `["track"]`)
- Any combination of `track`, `album`, `artist`, `playlist`

**limit** (required, default: `10`)
- Results per selected type
- Valid range: `1..50`

**retry** (optional, default: Off)
- Sends a request again after a failure that passes; see [Retries](http_get.md#retries). Searching is a read, sent again freely.

## Inputs

**input** (required)
- Any value; used for workflow control flow

**query** (optional)
- Runtime search query override
- Node fails if both input/config query are empty

## Outputs

**output**
```json
{
  "tracks": [{ "id": "...", "name": "...", "uri": "spotify:track:..." }],
  "albums": [{ "id": "...", "name": "...", "uri": "spotify:album:..." }],
  "artists": [{ "id": "...", "name": "...", "uri": "spotify:artist:..." }],
  "playlists": [{ "id": "...", "name": "...", "uri": "spotify:playlist:..." }]
}
```

Each array is present; non-requested/empty types are returned as `[]`.

## Example

```json
{
  "connection": "spotify-main",
  "query": "lofi focus",
  "search_types": ["track", "playlist"],
  "limit": 5
}
```

## Tips

- Keep `limit` low for faster workflows when you only need top results.
- Prefer exact URI handoff (`result.uri`) to downstream playback/queue nodes.
- If users provide free text, sanitize and trim before sending to this node.
