Artist's Information

The Get Artist endpoint is used to get information about an artist using the artist’s Spotify ID. The base URL of this endpoint is https://api.spotify.com/v1/artists/{id}. The path parameter {id} is replaced with the artist’s ID whose information we want. Let’s assume that we want to get details of an artist with Spotify ID sample_id. Our URL in this case will be https://api.spotify.com/v1/artists/sample_id.

Request parameters

The Get Artist endpoint has no query parameters.

Get information about an artist

The code below shows how to use this endpoint to retrieve details of an artist.

Press + to interact
url = ('https://api.spotify.com/v1/artists/0TnOYISbd1XYRBk9myaseg')
#0TnOYISbd1XYRBk9myaseg is the ID of Pitbull
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{CLIENT_CREDENTIALS_ACCESS_TOKEN}}'
}
response = requests.request("GET", url, headers=headers)
print(json.dumps(response.json(), indent=4))

We can change the Spotify ID of the artist in line 1 to get information about a different artist. Try some of the suggested artist IDs from the table below.

Artist's Name

Spotify ID

Keith Haring

3HyxTmsgPkff0qbmLxiaJz

Eminem

7dGJo4pcD2V6oG8kP0tJRR

Beyonce

6vWDO969PvNqNYHIOW5v0m

Imagine Dragons

53XhwfbYqKCa1cC15pYq2q

Johny Cash

6kACVPfCOnqzgfEF5ryl0x

Note: We can use the Search for Item endpoint to get the Spotify ID of an artist.

Response fields

The table below contains the important information we get from this endpoint.

Response field

Type

Description

spotify

String

This is the Spotify URL of the artist.

followers

Object

This object contains objects which provide information about the followers of the artist. It contains two elements: href which will always be NULL and total which shows the number of followers.

genres

String array

This array contains the genres the artist has performed in.

href

String

This is a link to the endpoint which provides full details of the artist.

id

String

This is the Spotify ID of the artist.

images

Array of objects

This contains the information for the artist's images. Each object in this array contains three elements which give us the URL, height, and width of the image respectively.

name

String

This is the name of the artist.

popularity

Integer

This is the artist's popularity rating based on the rating of the artist's tracks. This ranges between 0 and 100, with 100 being the most popular.

Multiple artists' details

Imagine running the above endpoint for each artist ID to get the details of multiple artists. It’s not very scalable. However, the Spotify API itself provides the solution. We can use the Get Several Artists endpoint that fetches details of multiple artists, using their Spotify IDs with only one API call. The base URI of this endpoint is https://api.spotify.com/v1/artists.

Request parameters

This endpoint requires only one query parameter, which is described in the table below:

Parameter

Category

Type

Description

ids

Required

String

These are comma-separated Spotify IDs of the artists we want to get details of.

Fetch information about several artists

The code below demonstrates how to use the Spotify IDs of multiple artists to get their information with only one API call. In the code below, we retrieve the details of three artists using their Spotify IDs.

Press + to interact
url = ('https://api.spotify.com/v1/artists?'
'ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6')
#2CIMQHirSU0MQqyYHq0eOx is the ID of deadmau5
#57dN52uHvrHOxijzpIgu3E is the ID of Ratatat
#1vCWHaC5f2uS3yhpwWbIA6 is the ID of Avicii
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{CLIENT_CREDENTIALS_ACCESS_TOKEN}}'
}
response = requests.request("GET", url, headers=headers)
print(json.dumps(response.json(), indent=4))

We receive the same information for three artists that we got when we fetched the details for a single artist.