Artist's Information
Search for information about an artist using the artist's Spotify ID.
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.
url = ('https://api.spotify.com/v1/artists/0TnOYISbd1XYRBk9myaseg')#0TnOYISbd1XYRBk9myaseg is the ID of Pitbullheaders = {'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 |
|
Eminem |
|
Beyonce |
|
Imagine Dragons |
|
Johny Cash |
|
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 |
| String | This is the Spotify URL of the artist. |
| Object | This object contains objects which provide information about the followers of the artist. It contains two elements: |
| String array | This array contains the genres the artist has performed in. |
| String | This is a link to the endpoint which provides full details of the artist. |
| String | This is the Spotify ID of the artist. |
| 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. |
| String | This is the name of the artist. |
| Integer | This is the artist's popularity rating based on the rating of the artist's tracks. This ranges between |
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 |
| 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.
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 Aviciiheaders = {'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.