[GH-ISSUE #360] How do I find Singles and EPs by an artist? #209

Closed
opened 2026-02-27 23:21:23 +03:00 by kerem · 7 comments
Owner

Originally created by @manavkulshrestha on GitHub (Mar 11, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/360

I've found how to get all albums given an artist, but couldn't find how to get the singles and eps anywhere on the documentation.

Originally created by @manavkulshrestha on GitHub (Mar 11, 2019). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/360 I've found how to get all albums given an artist, but couldn't find how to get the singles and eps anywhere on the documentation.
kerem closed this issue 2026-02-27 23:21:24 +03:00
Author
Owner

@CDeLeon94 commented on GitHub (Apr 2, 2019):

Here is a link to the info on the documentation:

artist_albums(artist_id, album_type=None, country=None, limit=20, offset=0)
Get Spotify catalog information about an artist’s albums

Parameters:

  • artist_id - the artist ID, URI or URL
  • album_type - ‘album’, ‘single’, ‘appears_on’, ‘compilation
  • country - limit the response to one particular country.
  • limit - the number of albums to return
  • offset - the index of the first album to return

You'd have to check how EP's are listed, but my guess is they'd be under singles.

<!-- gh-comment-id:479143727 --> @CDeLeon94 commented on GitHub (Apr 2, 2019): Here is a link to the info on the [documentation](https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.artist_albums): > **artist_albums**(artist_id, **album_type=None**, country=None, limit=20, offset=0) > Get Spotify catalog information about an artist’s albums > > Parameters: > > - artist_id - the artist ID, URI or URL > - **album_type** - ‘**album**’, ‘**single**’, ‘**appears_on**’, ‘**compilation**’ > - country - limit the response to one particular country. > - limit - the number of albums to return > - offset - the index of the first album to return You'd have to check how EP's are listed, but my guess is they'd be under singles.
Author
Owner

@stephanebruckert commented on GitHub (Jan 1, 2020):

Filtering by album_type is the way to go

<!-- gh-comment-id:570077312 --> @stephanebruckert commented on GitHub (Jan 1, 2020): Filtering by `album_type` is the way to go
Author
Owner

@ezekini commented on GitHub (Feb 3, 2020):

Is there a way to ask for more than one option in the same request? I tried with a list like album_type=['album', 'single'] but didn't work.

<!-- gh-comment-id:581648678 --> @ezekini commented on GitHub (Feb 3, 2020): Is there a way to ask for more than one option in the same request? I tried with a list like `album_type=['album', 'single']` but didn't work.
Author
Owner

@stephanebruckert commented on GitHub (Feb 3, 2020):

@ekinig https://developer.spotify.com/documentation/web-api/reference/search/search/ shows you can separate types with a comma: album,single

<!-- gh-comment-id:581650121 --> @stephanebruckert commented on GitHub (Feb 3, 2020): @ekinig https://developer.spotify.com/documentation/web-api/reference/search/search/ shows you can separate types with a comma: `album,single`
Author
Owner

@ezekini commented on GitHub (Feb 3, 2020):

Yes, I saw that also in the get-artists-albums API page, but unless I am doing something wrong, in spotipy it's not working

sp.artist_albums('spotify:artist:3NKVm2Jedcf6ibJr6pMUVx',
                     limit=50, album_type=['album', 'single'])

returns two items, both of type album , but that artist has many singles.

<!-- gh-comment-id:581657295 --> @ezekini commented on GitHub (Feb 3, 2020): Yes, I saw that also in the [get-artists-albums API page](https://developer.spotify.com/documentation/web-api/reference/artists/get-artists-albums/), but unless I am doing something wrong, in spotipy it's not working ``` sp.artist_albums('spotify:artist:3NKVm2Jedcf6ibJr6pMUVx', limit=50, album_type=['album', 'single']) ``` returns two items, both of type _album_ , but that artist has many singles.
Author
Owner

@stephanebruckert commented on GitHub (Feb 3, 2020):

Did you try with a single string?

sp.artist_albums('spotify:artist:3NKVm2Jedcf6ibJr6pMUVx',
                 limit=50, album_type='album,single')
<!-- gh-comment-id:581659409 --> @stephanebruckert commented on GitHub (Feb 3, 2020): Did you try with a single string? sp.artist_albums('spotify:artist:3NKVm2Jedcf6ibJr6pMUVx', limit=50, album_type='album,single')
Author
Owner

@ezekini commented on GitHub (Feb 3, 2020):

It worked 😶. That is definitely not a python list, but I guess the API is not just for python. Thank you

<!-- gh-comment-id:581660428 --> @ezekini commented on GitHub (Feb 3, 2020): It worked 😶. That is definitely not a python list, but I guess the API is not just for python. Thank you
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#209
No description provided.