Apple API: Search songs
Searches the Apple Music song catalog by title and artist words, returning matching tracks in relevance order with prices and previews when available.
Unofficial. Not affiliated with or endorsed by Apple.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Query, required
query Song title and/or artist words, such as Espresso Sabrina Carpenter.
Espresso Sabrina Carpenter
- 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 matches to return, such as 20 (up to 200).
20 (default)
Whole number from 1 to 200.
Input as JSON
{ "query": "Espresso Sabrina Carpenter"}Output
{ "songs": [ { "album": "Espresso EP", "genre": "Pop", "title": "Espresso (On Vacation Version)", "artist": "Sabrina Carpenter", "length": "2:55", "currency": "USD", "explicit": "no", "track_id": 1746801012, "itunes_price": 1.29, "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/e9/4d/02/e94d0230-11ee-ef94-d2cf-a5d547bd73f4/mzaf_554140808559155562.plus.aac.p.m4a" , "release_date": "2024-05-17", "apple_music_link": "https://music.apple.com/us/album/espresso-on-vacation-version/1746800651?i=1746801012&uo=4" , "length_milliseconds": 175459 }, { "album": "Short n' Sweet", "genre": "Pop", "title": "Espresso", "artist": "Sabrina Carpenter", "length": "2:55", "currency": "USD", "explicit": "no", "track_id": 1752214923, "itunes_price": 1.29, "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/99/da/ff/99daffce-cdde-59c6-5ae0-7f922ce411a8/mzaf_5621292401829922816.plus.aac.p.m4a" , "release_date": "2024-06-14", "apple_music_link": "https://music.apple.com/us/album/espresso/1752214909?i=1752214923&uo=4" , "length_milliseconds": 175459 }, { "album": "Espresso - Single", "genre": "Pop", "title": "Espresso", "artist": "Sabrina Carpenter", "length": "2:55", "currency": "USD", "explicit": "no", "track_id": 1744253558, "itunes_price": 1.29, "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/48/14/5f/48145fa9-a5b6-32a0-45e8-05af48e52b9c/mzaf_6315924685303002328.plus.aac.p.m4a" , "release_date": "2024-06-14", "apple_music_link": "https://music.apple.com/us/album/espresso/1744253545?i=1744253558&uo=4" , "length_milliseconds": 175459 } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"music.apple.com/search_songs","input":{"query":"Espresso Sabrina Carpenter"}}' # 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": "music.apple.com/search_songs" , "input": { "query": "Espresso Sabrina Carpenter" }})# 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": "music.apple.com/search_songs" , "input": { "query": "Espresso Sabrina Carpenter" } }), 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 music.apple.com/search_songs# with {"query":"Espresso Sabrina Carpenter"}"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": { "query": { "type": "string", "minLength": 1, "description": "Song title and/or artist words, such as Espresso Sabrina Carpenter." }, "country": { "type": "string", "default": "United States", "description": "Country name or two-letter code, such as United States or GB." }, "max_results": { "type": "integer", "default": 20, "maximum": 200, "minimum": 1, "description": "Maximum number of matches to return, such as 20 (up to 200)." } }}Output schema
{ "type": "object", "required": [ "songs" ], "properties": { "songs": { "type": "array", "items": { "type": "object", "required": [ "title", "artist", "album", "release_date", "length", "genre", "explicit", "itunes_price", "currency", "preview_link", "apple_music_link", "track_id", "length_milliseconds" ], "properties": { "album": { "type": [ "string", "null" ] }, "genre": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "length": { "type": [ "string", "null" ] }, "currency": { "type": [ "string", "null" ] }, "explicit": { "enum": [ "yes", "no", null ], "type": [ "string", "null" ] }, "track_id": { "type": [ "integer", "null" ] }, "itunes_price": { "type": [ "number", "null" ] }, "preview_link": { "type": [ "string", "null" ] }, "release_date": { "type": [ "string", "null" ], "format": "date" }, "apple_music_link": { "type": [ "string", "null" ] }, "length_milliseconds": { "type": [ "integer", "null" ] } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
music.apple.com/search_songs- Returns
- title, artist, album, release date, length, genre, explicit flag, price, preview and Apple Music links
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 music.apple.com/search_songs with the inputs above.
Ask your agent
- Find songs by Sabrina Carpenter with prices and preview links on Apple Music
- I need the top 10 tracks matching 'Espresso' in the UK store, with album and release date
- Look up tracks titled Blinding Lights by The Weeknd and show explicit flags
- Which songs match the words 'midnight rain Taylor' in Canada, max 5 results?
- Search Apple Music for Bad Guy by Billie Eilish and give me genre and song length
See more
All Apple methodsFinds 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_podcastsFinds 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_appsFinds an Apple Music album by title and optional artist, or by album link, and returns its matched release, purchase details and tracks in order.
music.apple.com/get_albumLists the current top songs, albums, or music videos on Apple Music for a country, in chart order. Countries without an Apple Music chart return no results.
music.apple.com/list_top_chartsGets an Apple Music artist profile by name or artist link. The profile includes the latest release, top songs and albums.
music.apple.com/get_artistGets an Apple Podcasts show's details and its newest available episodes, by show name or Apple Podcasts link.
podcasts.apple.com/get_podcastGets an iPhone or iPad app's public App Store listing by name or link. You can narrow it by developer and country. In-app purchases are included when the page lists them.
apps.apple.com/get_appGets customer reviews for an iPhone or iPad app, found by name or App Store link, from the selected country's App Store.
apps.apple.com/get_app_reviews