DeezerApiService is a Retrofit interface that provides access to the Deezer public API for searching and retrieving music metadata.
This service uses the public Deezer API (api.deezer.com) and does not require authentication for basic operations like search and metadata retrieval.
app/src/main/java/com/crowstar/deeztrackermobile/features/deezer/DeezerApiService.kt
Search Methods
searchTracks()
Search for tracks by query string.Search query string
Pagination offset (default: 0)
Number of results to return (default: 25)
Search response containing list of tracks and pagination info
searchAlbums()
Search for albums by query string.Search query string
Pagination offset
Number of results to return
Search response containing list of albums
searchArtists()
Search for artists by query string.Search query string
Pagination offset
Number of results to return
Search response containing list of artists
searchPlaylists()
Search for playlists by query string.Search query string
Pagination offset
Number of results to return
Search response containing list of playlists
Artist Methods
getArtist()
Get detailed information about a specific artist.Deezer artist ID
Artist details including name, picture, and fan count
getArtistAlbums()
Get albums by a specific artist.Deezer artist ID
Pagination offset
Number of results to return
List of albums by the artist
getArtistTopTracks()
Get the top tracks for an artist.Deezer artist ID
Number of top tracks to return
List of the artist’s most popular tracks
Album Methods
getAlbum()
Get detailed information about a specific album.Deezer album ID
Album details including title, artist, release date, and cover art
getAlbumTracks()
Get all tracks in an album.Deezer album ID
Pagination offset
Number of results to return
List of tracks in the album
Playlist Methods
getPlaylist()
Get detailed information about a specific playlist.Deezer playlist ID
Playlist details including title, creator, and track count
getPlaylistTracks()
Get all tracks in a playlist.Deezer playlist ID
Pagination offset
Number of results to return
List of tracks in the playlist
Pagination Methods
For advanced use cases, the service provides URL-based pagination methods:searchTracksByUrl(@Url url: String)- Load next/previous page of track search resultssearchAlbumsByUrl(@Url url: String)- Load next/previous page of album search resultssearchArtistsByUrl(@Url url: String)- Load next/previous page of artist search resultssearchPlaylistsByUrl(@Url url: String)- Load next/previous page of playlist search resultsgetAlbumTracksByUrl(@Url url: String)- Load next/previous page of album tracksgetArtistAlbumsByUrl(@Url url: String)- Load next/previous page of artist albumsgetPlaylistTracksByUrl(@Url url: String)- Load next/previous page of playlist tracks
next URL from pagination responses.
Implementation
The service is typically accessed throughDeezerRepository, which provides:
features/deezer/DeezerRepository.kt
Response Types
All search responses include pagination information:List of results (tracks, albums, artists, or playlists)
Total number of results available
URL for the next page of results (null if last page)
URL for the previous page of results (null if first page)
See Also
Data Models
Track, Album, and Playlist data structures
Search & Discovery
How search is implemented in the app