Spotify API: Get song
Finds 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.
Unofficial. Not affiliated with or endorsed by Spotify.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Song, required
song Song title, Spotify track link, or track ID, for example Blinding Lights or https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b.
spotify:track:0VjIjW4GlUZAMYd2vXMi3b
- Artist optional
artist Artist name to identify the song, for example The Weeknd. Omit to use the most-played matching track.
(default)
Input as JSON
{ "song": "spotify:track:0VjIjW4GlUZAMYd2vXMi3b"}Output
{ "album": "After Hours", "title": "Blinding Lights", "length": "3:20", "artists": [ "The Weeknd" ], "explicit": "no", "isrc_code": "USUG11904206", "length_ms": 200040, "play_count": 5610198940, "preview_link": "https://p.scdn.co/mp3-preview/51c08d92815cce4ac2de94a7335a430b81234624" , "release_date": "2020-03-20", "spotify_link": "https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b" , "track_number": 9, "cover_image_link": "https://i.scdn.co/image/ab67616d0000b2738863bc11d2aa12b54f5aeb36" , "spotify_track_id": "0VjIjW4GlUZAMYd2vXMi3b"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"open.spotify.com/get_song","input":{"song":"spotify:track:0VjIjW4GlUZAMYd2vXMi3b"}}' # 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": "open.spotify.com/get_song" , "input": { "song": "spotify:track:0VjIjW4GlUZAMYd2vXMi3b" }})# 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": "open.spotify.com/get_song" , "input": { "song": "spotify:track:0VjIjW4GlUZAMYd2vXMi3b" } }), 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 open.spotify.com/get_song# with {"song":"spotify:track:0VjIjW4GlUZAMYd2vXMi3b"}"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": [ "song" ], "properties": { "song": { "type": "string", "description": "Song title, Spotify track link, or track ID, for example Blinding Lights or https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b." }, "artist": { "type": "string", "default": "", "description": "Artist name to identify the song, for example The Weeknd. Omit to use the most-played matching track." } }}Output schema
{ "type": "object", "required": [ "title", "artists", "album", "release_date", "length", "play_count", "explicit", "track_number", "preview_link", "cover_image_link", "spotify_link", "spotify_track_id", "isrc_code", "length_ms" ], "properties": { "album": { "type": [ "string", "null" ], "description": "Album name." }, "title": { "type": "string", "description": "Song title." }, "length": { "type": [ "string", "null" ], "description": "Track length (m:ss)." }, "artists": { "type": "array", "items": { "type": "string" }, "description": "Performing artists." }, "explicit": { "type": "string", "description": "Whether the track is marked explicit: yes or no." }, "isrc_code": { "type": [ "string", "null" ], "description": "International Standard Recording Code." }, "length_ms": { "type": [ "integer", "null" ], "description": "Track length in milliseconds." }, "play_count": { "type": [ "integer", "null" ], "description": "Spotify track play count." }, "preview_link": { "type": [ "string", "null" ], "description": "30-second preview link, if provided." }, "release_date": { "type": [ "string", "null" ], "description": "Album release date (YYYY-MM-DD)." }, "spotify_link": { "type": "string", "description": "Spotify track page link." }, "track_number": { "type": [ "integer", "null" ], "description": "Track number on the album." }, "cover_image_link": { "type": [ "string", "null" ], "description": "Cover image link." }, "spotify_track_id": { "type": "string", "description": "Spotify track ID." } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
open.spotify.com/get_song- Returns
- title, artists, album, release date, length, play count, explicit flag, track number, preview link, cover image, Spotify link, track ID, ISRC, length in ms
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 open.spotify.com/get_song with the inputs above.
Ask your agent
- How many streams does Espresso by Sabrina Carpenter have on Spotify right now?
- Pull up the details for this track: https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp — I need the ISRC, album name, and release date.
- What's the play count and duration of Bohemian Rhapsody by Queen?
- Look up the song 'As It Was' and tell me whether it's marked explicit, which track number it is on the album, and grab the cover art link.
- Find track ID 7qiZfU4dY1lWllzX7mPBI3 on Spotify and give me its title, artists, length in milliseconds, and a preview clip URL if there is one.
See more
All Spotify methodsGets 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_artistGets 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_albumSearches 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.
spotify.com/search_musicLists 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_podcastsGets a Deezer song's tempo, ISRC, loudness gain and recording details from its title, track link or track ID. An artist name helps pick the right recording.
deezer.com/get_song_detailsFinds the best-matching studio recording on MusicBrainz for a song title and artist. Returns its ISRCs, first release date and up to 25 of its earliest releases.
musicbrainz.org/get_song_identifiersGets a public SoundCloud track and its stats from a title and optional artist, or from a track link. Search picks the artist's matching upload with the most plays; unavailable fields are null.
soundcloud.com/get_trackSearches 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_songs