[GH-ISSUE #588] Finding an album object's record label #354

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

Originally created by @denn9s on GitHub (Oct 17, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/588

Hi everyone, I've been trying to access the record label of an album object, but I can only access these bits of info:

album_type
artists
available_markets
external_urls
href
id
images
name
release_date
release_date_precision
total_tracks
type
uri

I figured there would be a 'label' key for that, but I can't seem to access it through spotipy.

Originally created by @denn9s on GitHub (Oct 17, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/588 Hi everyone, I've been trying to access the record label of an album object, but I can only access these bits of info: album_type artists available_markets external_urls href id images name release_date release_date_precision total_tracks type uri I figured there would be a 'label' key for that, but I can't seem to access it through spotipy.
kerem 2026-02-27 23:22:09 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@stephanebruckert commented on GitHub (Oct 17, 2020):

what album ID are you using? I think not all albums have a label. Can you try with 0sNOF9WDwhWunNAHPD3Baj?

<!-- gh-comment-id:710882239 --> @stephanebruckert commented on GitHub (Oct 17, 2020): what album ID are you using? I think not all albums have a label. Can you try with `0sNOF9WDwhWunNAHPD3Baj`?
Author
Owner

@denn9s commented on GitHub (Oct 17, 2020):

Hmmm, I'm currently trying it for 7e7t0MCrNDcJZsPwUKjmOc and I see the label as Victor Victor Worldwide in the developer console on Spotify's website, but don't see label in the spotipy object keys.

<!-- gh-comment-id:711089744 --> @denn9s commented on GitHub (Oct 17, 2020): Hmmm, I'm currently trying it for `7e7t0MCrNDcJZsPwUKjmOc` and I see the label as `Victor Victor Worldwide` in the developer console on Spotify's website, but don't see `label` in the spotipy object keys.
Author
Owner

@stephanebruckert commented on GitHub (Oct 17, 2020):

what method are you using? (code) it works for me with album()

<!-- gh-comment-id:711090023 --> @stephanebruckert commented on GitHub (Oct 17, 2020): what method are you using? (code) it works for me with `album()`
Author
Owner

@denn9s commented on GitHub (Oct 18, 2020):

(I understand it's a bit shoddy, just messing around with the API for now) but I'm accessing a playlist through its uri and I'm just testing it with the first track's album. Am I accessing it correctly?

client_credentials_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret)
sp = spotipy.Spotify(client_credentials_manager = client_credentials_manager)
playlist_id = 'spotify:playlist:37i9dQZF1DX0XUsuxWHRQd'

results = sp.playlist(playlist_id)
tracks = results['tracks']['items']
for track in tracks:
	track = track['track']
	track_name = track['name']
	track_artist = track['artists']
	track_album = track['album'] # using this as the album object I need to get label from
	track_id = track['id']
	break
<!-- gh-comment-id:711097882 --> @denn9s commented on GitHub (Oct 18, 2020): (I understand it's a bit shoddy, just messing around with the API for now) but I'm accessing a playlist through its `uri` and I'm just testing it with the first track's album. Am I accessing it correctly? ``` client_credentials_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret) sp = spotipy.Spotify(client_credentials_manager = client_credentials_manager) playlist_id = 'spotify:playlist:37i9dQZF1DX0XUsuxWHRQd' results = sp.playlist(playlist_id) tracks = results['tracks']['items'] for track in tracks: track = track['track'] track_name = track['name'] track_artist = track['artists'] track_album = track['album'] # using this as the album object I need to get label from track_id = track['id'] break ```
Author
Owner

@stephanebruckert commented on GitHub (Oct 18, 2020):

I see the label as Victor Victor Worldwide in the developer console on Spotify's website

that's because you are looking at the get-album endpoint https://developer.spotify.com/documentation/web-api/reference/albums/get-album/

whereas you are using a python method for the get-playlist endpoint:

https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist/

To get the label, you will need to do another query just for the album: sp.album(album_id)

<!-- gh-comment-id:711098837 --> @stephanebruckert commented on GitHub (Oct 18, 2020): > I see the label as Victor Victor Worldwide in the developer console on Spotify's website that's because you are looking at the get-album endpoint https://developer.spotify.com/documentation/web-api/reference/albums/get-album/ whereas you are using a python method for the get-playlist endpoint: https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist/ To get the label, you will need to do another query just for the album: `sp.album(album_id)`
Author
Owner

@denn9s commented on GitHub (Oct 18, 2020):

Ah, I see where I got it mixed up. I just made a query for the album itself and it worked as intended. Thank you so much for the help, I really appreciate it! 👍

<!-- gh-comment-id:711429295 --> @denn9s commented on GitHub (Oct 18, 2020): Ah, I see where I got it mixed up. I just made a query for the album itself and it worked as intended. Thank you so much for the help, I really appreciate it! 👍
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#354
No description provided.