[GH-ISSUE #743] Response fields missing from /tracks #449

Closed
opened 2026-02-27 23:22:41 +03:00 by kerem · 5 comments
Owner

Originally created by @MatejBevec on GitHub (Nov 12, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/743

Hi, I have a question about the response from spotipy.tracks().

It seems like the Spotify API was recently updated and now, according to the documentation, the call to https://api.spotify.com/v1/tracks should return artists' genres and some other info:

image

However, when using spotipy.tracks(track_ids) , these fields are missing:

 'artists': [
    {
      'external_urls': {
        'spotify': 'https://open.spotify.com/artist/1bgyxtWjZwA5PQlDsvs9b8'
      },
      'href': 'https://api.spotify.com/v1/artists/1bgyxtWjZwA5PQlDsvs9b8',
      'id': '1bgyxtWjZwA5PQlDsvs9b8',
      'name': 'Sarah Vaughan',
      'type': 'artist',
      'uri': 'spotify:artist:1bgyxtWjZwA5PQlDsvs9b8'
    }
  ],

What may be the explanation for this?

Originally created by @MatejBevec on GitHub (Nov 12, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/743 Hi, I have a question about the response from `spotipy.tracks()`. It seems like the Spotify API was recently updated and now, according to the documentation, the call to `https://api.spotify.com/v1/tracks` should return *artists' genres* and some other info: ![image](https://user-images.githubusercontent.com/40042371/141449369-6ef9a0bf-2cfd-415b-9073-2d406370fc53.png) However, when using `spotipy.tracks(track_ids)` , these fields are missing: ``` 'artists': [ { 'external_urls': { 'spotify': 'https://open.spotify.com/artist/1bgyxtWjZwA5PQlDsvs9b8' }, 'href': 'https://api.spotify.com/v1/artists/1bgyxtWjZwA5PQlDsvs9b8', 'id': '1bgyxtWjZwA5PQlDsvs9b8', 'name': 'Sarah Vaughan', 'type': 'artist', 'uri': 'spotify:artist:1bgyxtWjZwA5PQlDsvs9b8' } ], ``` What may be the explanation for this?
kerem 2026-02-27 23:22:41 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dieser-niko commented on GitHub (Nov 15, 2022):

Hm. Seems to be a bug on Spotify's part. The library doesn't change the response from Spotify, it just parses the JSON. As a workaround just use sp.artists(artists).

By the way, you can use the Spotify Console to test API calls.

<!-- gh-comment-id:1315259219 --> @dieser-niko commented on GitHub (Nov 15, 2022): Hm. Seems to be a bug on Spotify's part. The library doesn't change the response from Spotify, it just parses the JSON. As a workaround just use `sp.artists(artists)`. By the way, you can use the [Spotify Console](https://developer.spotify.com/console/get-several-tracks/) to test API calls.
Author
Owner

@stephanebruckert commented on GitHub (Nov 15, 2022):

Spotify doesn't always have the genres for an artist, so it's not returning anything. Nothing wrong here, closing.

<!-- gh-comment-id:1315411493 --> @stephanebruckert commented on GitHub (Nov 15, 2022): Spotify doesn't always have the `genres` for an artist, so it's not returning anything. Nothing wrong here, closing.
Author
Owner

@dieser-niko commented on GitHub (Nov 15, 2022):

That's not entirely true. Yes, sometimes the artist itself doesn't add genres, but let's take Ed Sheeran as an example. If you use sp.artist("6eUKZXaKkcviH0Ku9w2n3V"), two genres will be displayed. But if you use sp.track("3rmo8F54jFF8OgYsqTxm5d") (one of his tracks), then no genres are displayed.

<!-- gh-comment-id:1315486534 --> @dieser-niko commented on GitHub (Nov 15, 2022): That's not entirely true. Yes, sometimes the artist itself doesn't add genres, but let's take Ed Sheeran as an example. If you use `sp.artist("6eUKZXaKkcviH0Ku9w2n3V")`, two genres will be displayed. But if you use `sp.track("3rmo8F54jFF8OgYsqTxm5d")` (one of his tracks), then no genres are displayed.
Author
Owner

@stephanebruckert commented on GitHub (Nov 15, 2022):

A track can have a different genre than the one specified for its artist?

<!-- gh-comment-id:1315538880 --> @stephanebruckert commented on GitHub (Nov 15, 2022): A track can have a different genre than the one specified for its artist?
Author
Owner

@dieser-niko commented on GitHub (Nov 15, 2022):

Not sure about that. But reading the description, I would assume that the attribute is not meant for the genre of titles, especially since it is categorized under artist and not under tracks.

<!-- gh-comment-id:1315748802 --> @dieser-niko commented on GitHub (Nov 15, 2022): Not sure about that. But reading the description, I would assume that the attribute is not meant for the genre of titles, especially since it is categorized under artist and not under tracks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#449
No description provided.