LastFm API
Overview
Last.fm is a music discovery and social listening platform with over 15 years of scrobbling data. The API gives access to artist biographies, similar artists, top tracks, album info, and personal listening histories. It is one of the most comprehensive music metadata APIs available and free to use with an API key.
Beginner Tip
Start with the artist.getInfo method to explore the API—add method=artist.getInfo, artist=Radiohead, api_key=YOUR_API_KEY, and format=json as query parameters. The format=json parameter is required or the API returns XML by default.
Available Data
Example Response
{
"name": "Bohemian Rhapsody",
"artist": "Queen",
"album": "A Night at the Opera",
"duration_ms": 354000,
"popularity": 92,
"preview_url": "https://p.scdn.co/mp3-preview/..."
} Field Reference
artist.name The canonical artist name as stored on Last.fm. artist.listeners Total number of unique listeners on Last.fm (returned as a string). artist.playcount Total number of scrobbles (plays) recorded for this artist across all users. artist.bio.summary Short HTML-formatted biography of the artist. artist.similar.artist List of similar artist objects with name and image. artist.tags.tag Array of genre/style tags applied to the artist by the Last.fm community. Implementation Example
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://www.last.fm/api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Alternatives to LastFm
Technical alternatives for different use cases.
Listening statistics and similar artist recommendations
Official catalog data and audio playback
Music discovery based on listening habits
Community-maintained open music database
Accurate metadata and music identification
User listening statistics and social features
Richer audio features and official streaming integration
Building music players with audio analysis
Cross-platform listening history aggregation
Similar APIs
View All →AI Mastering
⭐ Beginner's PickAI Mastering is an API that automatically applies professional audio mastering to your music files using AI algorithms.
Freesound
⭐ Beginner's PickFreesound is a collaborative database of Creative Commons licensed audio samples and field recordings.
KSoft.Si Lyrics
⭐ Beginner's PickKSoft.Si Lyrics API provides instant lyrics lookup for songs by title and artist name.
Musixmatch
Musixmatch provides access to one of the largest lyrics databases in the world, covering millions of songs.
Napster
Napster provides programmatic access to music via REST API.