22
33# Spotify for Java (Still under development)
44
5- Spotify api wrapper for java.
5+ Spotify api wrapper for java. < a href = " https://gruncan.github.io/spotify4Java/ " > JavaDocs</ a >
66
77Written for enjoyment and a way to learn java concepts that I have rarely/never used.
88Demonstrated usage of OAuth 2.0 and java reflections, generics, networking, and concurrency.
@@ -42,17 +42,16 @@ and executing it with your spotifyClient `executeRequest`
4242Example:
4343
4444``` java
45- public static void main(String []args){
46- SpotifyClient spotifyClient = new SpotifyClientBuilder (" CLIENT_ID" , " CLIENT_SECRET" , " REDIRECT_URL" )
47- .getBuiltClient();
45+ public static void main(String [] args){
46+ SpotifyClient spotifyClient = new SpotifyClientBuilder (" CLIENT_ID" , " CLIENT_SECRET" , " REDIRECT_URL" ). getBuiltClient();
4847 TrackGet trackGet = new TrackGet (" Track_id" );
49- SpotifyResponse spotifyReponse = spotifyClient. executeRequest(trackGet);
50- Track track = spotifyResponse . getSerialisedObject ();
51- System . out. println(track );
48+ SpotifyResponse response = spotifyClient. executeRequest(trackGet);
49+ JSONObject jsonObject = response . getJsonObject ();
50+ System . out. println(jsonObject . toString() );
5251}
5352```
5453
55- Returns a ` SpotifyResponse ` encapsulating the RequestReponse from the spotify api and allowing the JSON to be serialized into a Java Object associated with the request.
54+ Returns a ` SpotifyResponse ` that encapsulates the json response from the spotify api
5655
5756All Json classes were taken from https://github.com/tdunning/open-json with only minor edits.
5857
@@ -61,108 +60,112 @@ All Json classes were taken from https://github.com/tdunning/open-json with only
6160<details open >
6261<summary ><strong ><u >Album:</u ></strong ></summary >
6362
64- - ~~ AlbumGet ([ api.spotify.com/v1/albums/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-album ) )~~
65- - ~~ SeveralAlbumsGet ([ api.spotify.com/v1/albums] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple-albums ) )~~
66- - ~~ AlbumTracksGet ([ api.spotify.com/v1/albums/{id}/tracks] ( https://developer.spoify.com/documentation/web-api/reference/#/operations/get-an-albums-tracks ) )~~
67- - ~~ AlbumsSavedMeGet ([ api.spotify.com/v1/me/albums] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-users-saved-albums ) )~~
68- - ~~ AlbumsCheckSavedGet ([ api.spotify.com/v1/me/albums/contains] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/check-users-saved-albums ) )~~
63+ - AlbumGet ([ api.spotify.com/v1/albums/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-album ) )
64+ - AlbumTracksGet ([ api.spotify.com/v1/albums/{id}/tracks] ( https://developer.spoify.com/documentation/web-api/reference/#/operations/get-an-albums-tracks ) )
65+ - SeveralAlbumsGet ([ api.spotify.com/v1/albums] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple-albums ) )
6966
7067</details >
7168<br >
7269<details open >
7370<summary ><strong ><u >Artists:</u ></strong ></summary >
7471
75- - ~~ ArtistGet ([ api.spotify.com/v1/artists/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artist ) )~~
76- - ~~ SeveralArtistsGet ([ api.spotify.com/v1/artists] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple -artists ) ) ~~
77- - ~~ ArtistsAlbumsGet ([ api.spotify.com/v1/artists/{id}/albums ] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-albums ) ) ~~
78- - ~~ ArtistTopTracksGet ([ api.spotify.com/v1/artists/{id}/top-tracks] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-top-tracks ) )~~
79- - ~~ ArtistRelatedArtistsGet ([ api.spotify.com/v1/artists/related-artists ] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an -artists-related-artists ) ) ~~
72+ - ArtistGet ([ api.spotify.com/v1/artists/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artist ) )
73+ - ArtistsAlbumsGet ([ api.spotify.com/v1/artists/{id}/albums ] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an -artists-albums ) )
74+ - ArtistsRelatedArtistsGet ([ api.spotify.com/v1/artists/related-artists ] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-related-artists ) )
75+ - ArtistTopTracksGet ([ api.spotify.com/v1/artists/{id}/top-tracks] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-top-tracks ) )
76+ - SeveralArtistsGet ([ api.spotify.com/v1/artists] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple -artists ) )
8077
8178</details >
8279<br >
83- <details >
84- <summary ><strong ><u >Shows</u ></strong ></summary >
85- </details >
86- <br >
87- <details >
88- <summary ><strong ><u >Episodes</u ></strong ></summary >
89- </details >
90- <br >
91- <details >
92- <summary ><strong ><u >Audiobooks</u ></strong ></summary >
80+ <details open >
81+ <summary ><strong ><u >Audiobooks:</u ></strong ></summary >
82+
83+ - AudiobookGet ([ api.spotify.com/v1/audiobooks/{id}] ( https://developer.spotify.com/documentation/web-api/reference/get-an-audiobook ) )
84+ - SeveralAudioBooksGet ([ api.spotify.com/v1/audiobooks/] ( https://developer.spotify.com/documentation/web-api/reference/get-multiple-audiobooks ) )
85+ - AudiobookChaptersGet ([ api.spotify.com/v1/audiobooks/{id}/chapters] ( https://developer.spotify.com/documentation/web-api/reference/get-audiobook-chapters ) )
86+
9387</details >
9488<br >
95- <details >
96- <summary ><strong ><u >Chapters</u ></strong ></summary >
89+ <details open >
90+ <summary ><strong ><u >Categories:</u ></strong ></summary >
91+
92+ - CategoriesGet ([ api.spotify.com/v1/browse/categories/{category_id}] ( https://developer.spotify.com/documentation/web-api/reference/get-a-category ) )
93+ - SeveralCategoriesGet ([ api.spotify.com/v1/browse/categories] ( https://developer.spotify.com/documentation/web-api/reference/get-categories ) )
94+
9795</details >
9896<br >
9997<details open >
100- <summary ><strong ><u >Tracks </u ></strong ></summary >
98+ <summary ><strong ><u >Chapters: </u ></strong ></summary >
10199
102- - TrackGet ([ api.spotify.com/tracks/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-track ) )
103- - SeveralTracksGet ([ api.spotify.com/tracks] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-tracks ) )
104- - ~~ TrackSavedMeGet ([ api.spotify.com/me/tracks] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-users-saved-tracks ) )~~
105- - ~~ TrackUserSavedGet ([ api.spotify.com/me/tracks/contains] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/check-users-saved-tracks ) )~~
106- - SeveralTrackAudioFeaturesGet ([ api.spotify.com/audio-features] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-audio-features ) )
107- - TrackAudioFeaturesGet ([ api.spotify.com/audio-features/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features ) )
108- - TrackAudioAnalysis ([ api.spotify.com/audio-analysis/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-analysis ) )
109- - TrackRecommendationGet ([ api.spotify.com/recommendations] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recommendations ) )
100+ - ChapterGet ([ api.spotify.com/v1/chapters/{id}] ( https://developer.spotify.com/documentation/web-api/reference/get-a-chapter ) )
101+ - SeveralChaptersGet ([ api.spotify.com/v1/chapters] ( https://developer.spotify.com/documentation/web-api/reference/get-several-chapters ) )
110102
111103</details >
112104<br >
113105<details open >
114- <summary ><strong ><u >Search </u ></strong ></summary >
106+ <summary ><strong ><u >Episodes: </u ></strong ></summary >
115107
116- - SearchGet ([ api.spotify.com/search] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/search ) )
108+ - EpisodeGet ([ api.spotify.com/v1/episodes/{id}] ( https://developer.spotify.com/documentation/web-api/reference/get-an-episode ) )
109+ - SeveralEpisodesGet ([ api.spotify.com/v1/episodes] ( https://developer.spotify.com/documentation/web-api/reference/get-multiple-episodes ) )
117110
118111</details >
119112<br >
120113<details open >
121- <summary ><strong ><u >User </u ></strong ></summary >
114+ <summary ><strong ><u >Genres: </u ></strong ></summary >
122115
123- - ~~ CurrentUserProfileGet ([ api.spotify.com/me] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-current-users-profile ) )~~
124- - ~~ UserTopItemsGet ([ api.spotify.com/me/top/{type}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-users-top-artists-and-tracks ) )~~
125- - ~~ UserProfileGet ([ api.spotify.com/users/{user_id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-users-profile ) )~~
126- - ~~ FollowedArtistsGet ([ api.spotify.com/me/following] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-followed ) )~~
127- - ~~ UserCheckFollowsArtistUserGet ([ api.spotify.com/me/following/contains] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/check-current-user-follows ) )~~
128- - ~~ UserCheckFollowPlaylistGet ([ api.spotify.com/playlists/{playlist_id}/followers/contains] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/check-if-user-follows-playlist ) )~~
116+ - GenreAvailableGet ([ api.spotify.com/v1/recommendations/available-genre-seeds] ( https://developer.spotify.com/documentation/web-api/reference/get-recommendation-genres ) )
129117
130118</details >
131119<br >
132- <details >
133- <summary ><strong ><u >Playlists</u ></strong ></summary >
120+ <details open >
121+ <summary ><strong ><u >Markets:</u ></strong ></summary >
122+
123+ - MarketsAvailableGet ([ api.spotify.com/v1/markets] ( https://developer.spotify.com/documentation/web-api/reference/get-available-markets ) )
124+
134125</details >
135126<br >
127+ <details open >
128+ <summary ><strong ><u >Playlists:</u ></strong ></summary >
136129
130+ - PlaylistGet ([ api.spotify.com/v1/playlists/{playlist_id}] ( https://developer.spotify.com/documentation/web-api/reference/get-playlist ) )
131+ - CategoriesPlaylistsGet ([ api.spotify.com/v1/browse/categories/{category_id}/playlists] ( https://developer.spotify.com/documentation/web-api/reference/get-a-categories-playlists ) )
132+ - FeaturedPlaylistGet ([ api.spotify.com/v1/browse/featured-playlists] ( https://developer.spotify.com/documentation/web-api/reference/get-featured-playlists ) )
133+ - PlaylistImageGet ([ api.spotify.com/v1/playlists/{playlist_id}/images] ( https://developer.spotify.com/documentation/web-api/reference/get-playlist-cover ) )
134+ - PlaylistTracksGet [ api.spotify.com/v1/playlists/{playlist_id}/tracks] ( https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks ) )
137135
138-
139- <details >
140- <summary ><strong ><u >Categories</u ></strong ></summary >
141136</details >
142137<br >
138+ <details open >
139+ <summary ><strong ><u >Search:</u ></strong ></summary >
140+
141+ - SearchGet ([ api.spotify.com/v1/search] ( https://developer.spotify.com/documentation/web-api/reference/search ) )
143142
144- <details >
145- <summary ><strong ><u >Genres</u ></strong ></summary >
146143</details >
147144<br >
145+ <details open >
146+ <summary ><strong ><u >Shows:</u ></strong ></summary >
147+
148+ - ShowGet ([ api.spotify.com/v1/shows/{id}] ( https://developer.spotify.com/documentation/web-api/reference/get-a-show ) )
149+ - SeveralShowsGet ([ api.spotify.com/v1/shows] ( https://developer.spotify.com/documentation/web-api/reference/get-multiple-shows ) )
150+ - ShowEpisodesGet ([ api.spotify.com/v1/shows/{id}/episodes] ( https://developer.spotify.com/documentation/web-api/reference/get-a-shows-episodes ) )
148151
149152
150- <details >
151- <summary ><strong ><u >Player</u ></strong ></summary >
152153</details >
153154<br >
155+ <details open >
156+ <summary ><strong ><u >Tracks:</u ></strong ></summary >
154157
158+ - SeveralTrackAudioFeaturesGet ([ api.spotify.com/audio-features] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-audio-features ) )
159+ - SeveralTracksGet ([ api.spotify.com/tracks] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-tracks ) )
160+ - TrackAudioAnalysisGet ([ api.spotify.com/audio-analysis/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-analysis ) )
161+ - TrackAudioFeaturesGet ([ api.spotify.com/audio-features/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features ) )
162+ - TrackGet ([ api.spotify.com/tracks/{id}] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-track ) )
163+ - TrackRecommendationGet ([ api.spotify.com/recommendations] ( https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recommendations ) )
155164
156- <details >
157- <summary ><strong ><u >Markets</u ></strong ></summary >
158165</details >
159- <br >
160- (<s >scorethrough</s > items were previously implemented but removed in the refactor will be back soon)
161166
162167### <u >Future Plans</u >
163168- Implement the remainder of api request
164- - Completely finish writing the spotify objects
165- - Rewrite how requests classes are written (annotations)
166169- Bring back Spring support for handling user authentication
167170- Add more branches of api requests not just web api
168171- Optimise multiple call different threads
0 commit comments