A Java wrapper for Spotify's Web API.
This library is available on Maven Central and requires at least Java 17.
<dependency>
<groupId>de.sonallux.spotify</groupId>
<artifactId>spotify-web-api-java</artifactId>
<version>4.3.0</version>
</dependency>
compile 'de.sonallux.spotify:spotify-web-api-java:4.3.0'
var authProvider = new SimpleApiAuthorizationProvider("<your access token>");
var spotifyApi = SpotifyWebApi.builder().authorization(authProvider).build();
var artist = spotifyApi.getArtistsApi().getArtist("<artist id>").build().execute();
System.out.println(artist.getName());
Spotify's web API supports different authorization flows. All flows require that your application is registered on the Spotify Developer Dashboard. You can find more details on how to register your app here. After successful registration you can use one of the following authorization flows with the spotify-web-api-java
:
Code example: AuthorizationCodeExample.java
Code example: AuthorizationCodePKCEExample.java
Code example: ImplicitGrantExample.java
Code example: ClientCredentialsExample.java
- Update the version number with
./mvnw versions:set -DnewVersion="<version>" -DgenerateBackupPoms=false
- Update version in
CHANGELOG.md
andREADME.md
- Commit and push changes to GitHub
- Wait till CI is green
- Tag the commit created in step 3 and push it. A GitHub actions workflow will automatically deploy the artifacts to Maven Central.
- Create a release on GitHub mentioning the changes from
CHANGELOG.md