Announcements

Help Wizard

Step 1

NEXT STEP

Being returned empty array from user's top artists

Being returned empty array from user's top artists

Plan

Premium

Country

Canada

Operating System

Windows 10

 

My Question or Issue

After getting an access token back from my refresh token, I use it to fetch the top artists of the account associated with the access token. However, the users top artists keep returning an empty array of items.

 

This is what my code for the request looks like:

 

```

const limit = '10';
const time_range = 'medium_term'// short_term=4weeks, medium_term=6months, long_term=several years
  
const response = await axios.get(`https://api.spotify.com/v1/me/top/artists?limit=${limit}&time_range=${time_range}`, {
    headers: {
      'Authorization': 'Bearer ' + accessToken,
      'Content-Type': 'application/json'
    }
  });
```
Reply
2 Replies

Hi,
The same with me. I receive top tracks only (using the Spotify console).
My account is new - Is there a delay to get top artists? How long shall this one take?

Thank you in advance
Cheers
V.

Solution: this one is possibly caused by an algorithm on Spotify's backed. One man has to simply wait to get items from the service. I also play edmore songs and maybe also significantly more songs from the given artists.
Check Spotify user profile for "Top artists..." there must be one or more displayed.

Suggested posts