Announcements

Help Wizard

Step 1

NEXT STEP

Artist Genres not being returned from /tracks route

Artist Genres not being returned from /tracks route

Hey all!

 

I'm making requests to the GET /tracks, and whereas the documentation here states that genres will be returned within the artists field, I'm seeing that's not the case in my responses. Is this no longer supported within the API?

 

Reply
12 Replies

Hey rdoshi, please how were you able to solve this issue

I'm having the same problem. Do you have any clue if this is a recent problem or if the API has always been like this?

Same issue. My integration works perfectly, except no genres are returned when 'genres' is supplied as a field under artist and album. And there is no empty array returned for genres either which would be expected as indicated by the docs. It seems like a bug in either the docs or api. Any updates from spotify? Happy to collaborate to help repro.

( this is via the /playlists/{playlistid} end point, haven't tested /tracks explicitly)

Same...

I am blocked by the same issue.  Any update on this?

The Get ArtistGet Several Artists, and Get Top [Artists] still return genres.

Now using Get Artist isn't returning genre data either!

Not all artists are assigned to genres yet. There is a certain threshold before they get genres.

I'm still get undefined for artist genres even for someone like Taylor Swift.

Using the spotify api ts sdk for clarification

@sidisawesome16, I think there is a bug in your code, or there was a temporary malfunction of the Spotify server.
The following code works for me (as a non TypeScript/JavaScript/NodeJS programmer):

 

import { SpotifyApi } from '@spotify/web-api-ts-sdk';

const sdk = SpotifyApi.withClientCredentials("Your_Client_ID", "Your_Client_Secret");

// Replace the artistId with the ID of the artist you want to retrieve genres for.
const artistId = '0OdUWJ0sBjDrqHygGUXeCF';

sdk.artists.get(artistId).then(
  function(data) {
    console.log('Artist genres', data.genres);
  },
  function(err) {
    console.error(err);
  }
);

 

(I used npx tsc example.ts and node script.js to run the script.)

@**bleep** spotify api docs says that genre should be returned with the artist field on a saved track. However, they do not actually return this in the api.

 

What you are doing here is asking for an artist directly. This does return the artist but it is not the same as what @sidisawesome16 and me also are trying to do. The way your doing it basically requires another request.

Suggested posts