Last.fm is disabling API Keys for non-paid accounts December 1st.Learn More
Get Artist Metadata from Providers (Advanced)
POST
/api/metadata/search/artists
const url = 'https://example.com/api/metadata/search/artists';const options = { method: 'POST', headers: { cookie: 'ms.session_token=<ms.session_token>', 'Content-Type': 'application/json' }, body: '{"artists":[{"name":"example","metadata":[{"name":"musicbrainz","id":"example","idType":"recording"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/metadata/search/artists \ --header 'Content-Type: application/json' \ --cookie ms.session_token=<ms.session_token> \ --data '{ "artists": [ { "name": "example", "metadata": [ { "name": "musicbrainz", "id": "example", "idType": "recording" } ] } ] }'Gets artist results from all metadata providers using Credits with metadata. Send the header Accept: application/x-ndjson to get results as newline-delimited JSON, one line per provider as soon as it finishes: {"type":"result","service":"...","data":[...]} or {"type":"error","service":"...","error":{...}}, followed by a final {"type":"done"} line.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
artists
required
A list of artist Credits
Array<object>
object
name
required
string
metadata
Array
One of:
MusicBrainz ID
object
name
required
string
id
required
string
idType
string
Music Service ID
object
name
required
string
id
required
string
idType
string
Responses
Section titled “Responses”Success
The request failed validation
Media typeapplication/json
The request’s body, query or params didn’t match the route’s schema
object
error
required
string
details
required
What was wrong, one entry per problem
Array<object>
object
message
required
string
path
Where the problem is, e.g. [“amount”] or [“items”, 0, “id”]
Array
Example
{ "error": "Validation failed"}