Skip to content

rinukkusu/spotify-dart

This branch is up to date with master.

Folders and files

NameName
Last commit message
Last commit date
Feb 20, 2024
Feb 20, 2021
Feb 20, 2024
Aug 19, 2024
Aug 20, 2024
Jan 30, 2020
Oct 14, 2017
Jul 1, 2024
Aug 12, 2017
Apr 9, 2023
Feb 20, 2024
Apr 28, 2024
Jul 1, 2024

Repository files navigation

spotify-dart Pub Dart CI

A dart library for interfacing with the Spotify API.

Usage

Simple Example

final credentials = SpotifyApiCredentials(clientId, clientSecret);
final spotify = SpotifyApi(credentials);
final artist = await spotify.artists.get('0OdUWJ0sBjDrqHygGUXeCF');

Authorization

For detailed information regarding authorization, client credentials flow and more, see the wiki.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Development

Generating JSON Serializers

Run dart run build_runner build to generate JSON serializers via json_serializable. Run dart run build_runner watch to continuously rebuild serializers in the background when files are updated.

Running tests

Run dart test to run all of the tests in test/spotify_test.dart.

Running example code

Run dart example/example to run the example code. You'll need to modify example/example.dart to use your Spotify client ID and secret.

If you would like to run the example that accesses your user data (such as currently playing song etc.), run pub run example/example_auth.dart. There, you are requested to enter your redirect url (see the comment above redirectUri). After that, you are requested to call a given url (or paste it into your browser). That url will do a redirect in your browser. You should copy and paste this redirected url into your console to see the currently playing song and your available devices.