Spotify API: Search music
Searches Spotify for songs, artists, albums, playlists or podcasts by keywords and returns them in Spotify's result order. Songs and albums include a release date when Spotify gives a full date.
Unofficial. Not affiliated with or endorsed by Spotify.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Type optional
type Kind of result, such as songs.
playlists
One of
songs,artists,albums,playlists,podcasts. Defaultsongs.- Query, required
query Words to search for, such as Adele Hello.
lofi study
- Country optional
country Country name or two-letter code, such as United States or GB.
United States (default)
- Max Results optional
max_results Maximum number of results, such as 10.
12
Whole number from 1 to 50. Default
10.
Input as JSON
{ "type": "playlists", "query": "lofi study", "max_results": 12}Output
{ "results": [ { "name": "chill lofi study beats", "type": "playlist", "album": null, "owner": "Spotify", "length": null, "artists": null, "publisher": null, "image_link": "https://i.scdn.co/image/ab67706f000000021498ddc160581579f9b55979" , "spotify_id": "37i9dQZF1DX8Uebhn9wzrS", "release_date": null, "spotify_link": "https://open.spotify.com/playlist/37i9dQZF1DX8Uebhn9wzrS" }, { "name": "Lofi Study 2026", "type": "playlist", "album": null, "owner": "Lofi Girl", "length": null, "artists": null, "publisher": null, "image_link": "https://image-cdn-fa.spotifycdn.com/image/ab67706c0000d72ce8fcb214bcd7d054018d9fe4" , "spotify_id": "6zCID88oNjNv9zx6puDHKj", "release_date": null, "spotify_link": "https://open.spotify.com/playlist/6zCID88oNjNv9zx6puDHKj" }, { "name": "lofi autumn beats 🍁🍂", "type": "playlist", "album": null, "owner": "Spotify", "length": null, "artists": null, "publisher": null, "image_link": "https://i.scdn.co/image/ab67706f00000002409a98a40d38e6c16f39d796" , "spotify_id": "37i9dQZF1DX9O8HCSWScgZ", "release_date": null, "spotify_link": "https://open.spotify.com/playlist/37i9dQZF1DX9O8HCSWScgZ" } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"spotify.com/search_music","input":{"type":"playlists","query":"lofi study","max_results":12}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "spotify.com/search_music" , "input": { "type": "playlists", "query": "lofi study", "max_results": 12 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "spotify.com/search_music" , "input": { "type": "playlists", "query": "lofi study", "max_results": 12 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run spotify.com/search_music# with {"type":"playlists","query":"lofi study","max_results":12}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "query" ], "properties": { "type": { "enum": [ "songs", "artists", "albums", "playlists", "podcasts" ], "type": "string", "default": "songs", "description": "Kind of result, such as songs." }, "query": { "type": "string", "minLength": 1, "description": "Words to search for, such as Adele Hello." }, "country": { "type": "string", "default": "United States", "description": "Country name or two-letter code, such as United States or GB." }, "max_results": { "type": "integer", "default": 10, "maximum": 50, "minimum": 1, "description": "Maximum number of results, such as 10." } }}Output schema
{ "type": "object", "required": [ "results" ], "properties": { "results": { "type": "array", "items": { "type": "object", "required": [ "name", "type", "spotify_link", "spotify_id" ], "properties": { "name": { "type": "string" }, "type": { "enum": [ "song", "artist", "album", "playlist", "podcast" ], "type": "string" }, "album": { "type": [ "string", "null" ] }, "owner": { "type": [ "string", "null" ] }, "length": { "type": [ "string", "null" ] }, "artists": { "type": [ "string", "null" ] }, "publisher": { "type": [ "string", "null" ] }, "image_link": { "type": [ "string", "null" ] }, "spotify_id": { "type": "string" }, "release_date": { "type": [ "string", "null" ] }, "spotify_link": { "type": "string" } } }, "description": "Matches in Spotify search order." } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
spotify.com/search_music- Returns
- name, type, artists, owner, publisher, album, release date, length, image link, Spotify link, Spotify ID
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method spotify.com/search_music with the inputs above.
Ask your agent
- Find songs matching the words Adele Hello, limit to 10 results, country United States
- Show me 25 albums with the keyword jazz piano, country GB
- Look up artists named Radiohead and return up to 5 results
- Search for podcasts about true crime on spotify.com, max 15 results
- Get playlists tagged chill lofi beats for the country Germany, 20 results
See more
All Spotify methodsFinds a Spotify song by title (optionally narrowed by artist), track link, URI or track ID and returns its public play count and details. Without an artist, the most-played exact title match wins. Previews and ISRC may be unavailable for some tracks.
open.spotify.com/get_songGets a Spotify album by name (optionally with the artist), album link or album ID, with its details and ordered track list including play counts.
open.spotify.com/get_albumGets a Spotify artist's public profile from their name, artist link or ID: listeners, followers, world rank, top cities, popular tracks, latest release and release counts.
open.spotify.com/get_artistLists Spotify's top or trending podcasts for a country in chart order, with rank, movement, publisher, artwork and Spotify link. Category charts exist only for some countries.
open.spotify.com/list_top_podcastsSearches the Apple Music song catalog by title and artist words, returning matching tracks in relevance order with prices and previews when available.
music.apple.com/search_songsFinds Apple Podcasts shows by name or topic in a country, ordered by search relevance, with ratings when the show page provides them.
podcasts.apple.com/search_podcastsReturns the latest published Spotify daily Top 200 chart from Kworb for a country or worldwide, with rankings and stream counts.
kworb.net/get_spotify_daily_chartFinds iPhone and iPad apps by keyword in a chosen country's App Store, with ratings, prices, categories and App Store links.
apps.apple.com/search_apps