Skip to content
pubscout

spotify

0.16.1, released 7 months ago by an unverified publisher

A Dart library for interfacing with the Spotify Web API.

WASM-readyUnverified publisher
$ flutter pub add spotify
Source repository

What it does

Provides comprehensive access to Spotify's Web API including artists, tracks, albums, playlists, podcasts, user profiles, and playback control. Supports multiple authorization flows like Client Credentials and Authorization Code Grant with PKCE.

AI-written summary of version 0.16.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to fetch music metadata, artist details, or playlist information from Spotify.
  • You are building a Dart or Flutter client that needs to control Spotify playback or access user library data.

Skip it when

  • You need to embed an official Spotify audio player directly into your app UI.
  • You require an official or fully feature-complete and guaranteed up-to-date wrapper for every experimental Spotify API endpoint.

Strengths

  • Comprehensive coverage of Spotify's Web API core content and user endpoints.
  • Built-in support for multiple auth flows, including PKCE for public clients.
  • Efficient handling of large result sets using pages and cursor pages.

Weaknesses

  • Library is noted by its author as incomplete.
  • Some Spotify-deprecated endpoints are still included and may cease to function depending on Spotify's API roadmap.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
4

Register a developer application on Spotify to obtain a client ID and client secret, or use PKCE configuration.

import 'package:spotify/spotify.dart';

void main() async {
  final credentials = SpotifyApiCredentials(clientId, clientSecret);
  final spotify = SpotifyApi(credentials);

  final artist = await spotify.artists.get('0OdUWJ0sBjDrqHygGUXeCF');
  print(artist.name);
}

Alternatives

Packages that do the same job and could replace spotify.

Works with

Packages commonly used together with spotify: ones it builds on, ones built on it, and its own family.