getArtists method

Future<LibraryGetArtistsResponse?> getArtists({
  1. required String user,
  2. int limit = 50,
  3. int? page,
})

A paginated list of all the artists in a user's library, with play counts and tag counts.

https://www.last.fm/api/show/library.getArtists

Implementation

Future<LibraryGetArtistsResponse?> getArtists({
  required String user,
  int limit = 50,
  int? page,
}) async {
  final parameters = {'user': user, 'limit': limit, 'page': page};

  final request = Request(
    api: _api,
    method: 'library.getArtists',
    parameters: parameters,
  );

  final response = await request.send(mode: RequestMode.GET);

  final artists = response['artists'];

  return artists == null ? null : LibraryGetArtistsResponse.fromJson(artists);
}