Overview
TheArtistService (sync) and AsyncArtistService (async) provide methods for retrieving Spotify artist information, discography, and top tracks.
Both sync and async versions are available. Import
ArtistService for sync operations or AsyncArtistService for async operations.Methods
get
Retrieve detailed information about a single artist by their Spotify ID.The Spotify ID of the artist.
Artist - The complete artist object with metadata including genres, popularity, and images.
Raises: ValueError if id is empty.
get_several
Retrieve multiple artists in a single request.List of Spotify artist IDs. Maximum of 50 IDs per request enforced by Spotify API.
list[Artist] - List of artist objects.
Raises: ValueError if ids is empty.
get_albums
Retrieve an artist’s albums with filtering and pagination options.The Spotify ID of the artist.
Filter album types to include. Valid values:
"album", "single", "appears_on", "compilation". If omitted, all types are returned.An ISO 3166-1 alpha-2 country code for content availability.
Maximum number of albums to return. Valid range: 1-50. Server-side default is 20.
Index of the first album to return (for pagination). Server-side default is 0.
Page[SimplifiedAlbum] - Paginated response containing simplified album objects.
Raises:
ValueErrorifidis empty orinclude_groupscontains invalid values.
The
include_groups parameter accepts these values:"album"- Studio albums"single"- Singles and EPs"appears_on"- Albums the artist appears on"compilation"- Compilation albums
get_top_tracks
Retrieve an artist’s top tracks for a given market.The Spotify ID of the artist.
An ISO 3166-1 alpha-2 country code for the requested content.
list[Track] - List of the artist’s top tracks (typically up to 10 tracks).
Raises: ValueError if id is empty.
Type Definitions
IncludeGroup
Related Models
Artist- Full artist object with complete metadataSimplifiedAlbum- Album object with essential informationTrack- Full track object with album and artist detailsPage[T]- Paginated response wrapper
See Also
- Albums Service - Work with album data
- Authentication - Required scopes and auth flows