Overview
TheAsyncSearchService provides powerful search capabilities across Spotify’s entire catalog. Search for tracks, albums, artists, playlists, shows, episodes, and audiobooks with flexible query syntax and filtering options.
This service is available in both async (
AsyncSearchService) and sync (SearchService) variants.Search
Search for items across multiple resource types in the Spotify catalog.Search query with keywords and optional filters.Query syntax:
- Simple keyword:
"remaster track:Doxy artist:Miles Davis" - Field filters:
album:arrival artist:abba - Year filters:
year:2015-2020oryear:2020 - Genre:
genre:"indie rock" - Tag filters:
tag:hipster,tag:new - Boolean operators:
roadhouse AND blues - Negation:
roadhouse NOT blues - Wildcards:
bus*(matches “bus”, “business”, “busy”)
List of resource types to search for.Valid types:
"album"- Albums"artist"- Artists"playlist"- Playlists"track"- Tracks"show"- Podcasts/Shows"episode"- Podcast episodes"audiobook"- Audiobooks
["track", "artist", "album"]An ISO 3166-1 alpha-2 country code. If provided, only content available in that market is returned.Example:
"US", "GB", "CA"Maximum number of results to return per type. Default: 5. Range: 0-50.
Index of the first result to return. Default: 0. Use with
limit for pagination.Whether to include externally hosted audio content.Valid value:
"audio"Returns
Search results grouped by resource type. Each requested type has a corresponding field:
tracks-Page[Track]if “track” was in typesalbums-Page[SimplifiedAlbum]if “album” was in typesartists-Page[Artist]if “artist” was in typesplaylists-Page[SimplifiedPlaylist]if “playlist” was in typesshows-Page[SimplifiedShow]if “show” was in typesepisodes-Page[SimplifiedEpisode]if “episode” was in typesaudiobooks-Page[SimplifiedAudiobook]if “audiobook” was in types
Examples
Search Query Syntax
The search query (q parameter) supports powerful filtering and operators:
Field Filters
Filter by specific fields:Year Filters
Filter by release year:Genre Filter
Tag Filters
Boolean Operators
Wildcards
Complex Queries
Combine multiple filters:Search Types Reference
Valid search type values:
| Type | Description |
|---|---|
"album" | Search for albums |
"artist" | Search for artists |
"playlist" | Search for playlists |
"track" | Search for tracks |
"show" | Search for podcasts/shows |
"episode" | Search for podcast episodes |
"audiobook" | Search for audiobooks |
Error Handling
The search method validates inputs and raisesValueError for:
Search results are paginated with a maximum limit of 50 per type. Use the
offset parameter to retrieve additional results.