{"id":25097654,"url":"https://github.com/cthacker-udel/java-spotify-api","last_synced_at":"2025-04-19T09:50:46.738Z","repository":{"id":38185912,"uuid":"353649351","full_name":"cthacker-udel/Java-Spotify-API","owner":"cthacker-udel","description":"Unofficial Java-based Wrapper for Spotify Rest API using only Retrofit, GSON, Selenium and WebDriver Manager (to generate access tokens)!","archived":false,"fork":false,"pushed_at":"2023-02-17T21:58:03.000Z","size":4445,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T07:04:42.997Z","etag":null,"topics":["java","java-8","java-spotify-api","repository","retrofit-interface","selenium","selenium-webdriver","spotify","spotify-api","spotify-clone","spotify-connect","spotify-downloader","spotify-library","spotify-playlist","spotify-plugin","spotify-sdk","spotify-web-api","webdriver","webdrivermanager","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cthacker-udel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-01T09:42:27.000Z","updated_at":"2024-04-18T17:36:34.000Z","dependencies_parsed_at":"2025-02-07T17:44:01.693Z","dependency_job_id":null,"html_url":"https://github.com/cthacker-udel/Java-Spotify-API","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthacker-udel%2FJava-Spotify-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthacker-udel%2FJava-Spotify-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthacker-udel%2FJava-Spotify-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthacker-udel%2FJava-Spotify-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cthacker-udel","download_url":"https://codeload.github.com/cthacker-udel/Java-Spotify-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249667336,"owners_count":21308216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-8","java-spotify-api","repository","retrofit-interface","selenium","selenium-webdriver","spotify","spotify-api","spotify-clone","spotify-connect","spotify-downloader","spotify-library","spotify-playlist","spotify-plugin","spotify-sdk","spotify-web-api","webdriver","webdrivermanager","wrapper"],"created_at":"2025-02-07T17:33:52.350Z","updated_at":"2025-04-19T09:50:46.701Z","avatar_url":"https://github.com/cthacker-udel.png","language":"Java","readme":"# Public Rest API for Spotify - Cameron Thacker (4/1/2021)\n\n![Version](https://img.shields.io/badge/version-2.0.0-blue)\n![dependencies](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen)\n![Retrofit](https://img.shields.io/badge/retrofit-2.7.2-green)\n![Gson](https://img.shields.io/badge/gson-2.9.0-green)\n![Selenium](https://img.shields.io/badge/selenium-4.0.0-green)\n![WebdriverManager](https://img.shields.io/badge/WebdriverManager-3.7.1-green)\n\n![GitHub stars](https://img.shields.io/github/stars/cthacker-udel/Java-Spotify-API?style=social\u0026label=Star)\n## General API Information\n\n**All information contained within this repository is referenced from the [Spotify Web API Reference website](https://developer.spotify.com/documentation/web-api/reference/)**\n\n* The base http client code is contained within the class called : [Spotify Client](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyClient.java)\n\n* The Rest API methods that interact with the [Retrofit](https://square.github.io/retrofit/) interface are located at the class called : [Spotify Rest API](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyRestAPI.java)\n\n* The Interfaces corresponding to section in the Web API Reference are located in the Model folder located here : [Model](https://github.com/cthacker-udel/Java-Spotify-API/tree/master/src/main/java/Model)\n\n* Majority of requests are made via [Retrofit](https://square.github.io/retrofit/) interface, only 1 request is made via [Selenium](https://www.selenium.dev/documentation/en/), and that is generating the access tokens! The tests listed under [this](https://github.com/cthacker-udel/Java-Spotify-API/tree/master/src/test/java) folder have been tested for functionality, if any functions do not function properly, please raise an issue! Raise an issue [here](https://github.com/cthacker-udel/Java-Spotify-API/issues/new)\n\n**All additions and recommendations are welcome!**\n\n* Please check the Project Tab for Updates on current objectives\n\n\n## Usage\n\n* How to use the Java-Spotify-API wrapper \n  * Create an instance of `SpotifyClient` by calling the constructors listed in this [file](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyClient.java)\n  * When you create an instance of `SpotifyClient` using the constructors listed above, you can utilize the methods listed in `SpotifyRestAPI` listed in this [file](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyRestAPI.java)\n\n\n## Examples\n\n\n### [SpotifyClient](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyClient.java)\n\n* `SpotifyClient client = new SpotifyClient();` \n  * creates an instance of SpotifyClient with empty API key and Secret Key\n\n* `SpotifyClient client = new SpotifyClient(\"apikey\",\"secretkey\");` \n  * creates an instance of SpotifyClient with API key `\"apikey\"` and Secret Key `\"secretkey\"` **recommended usage**\n\n* `SpotifyClient client = new SpotifyClient(\"apikey\",\"secretkey\",\"accessToken\");` \n  * creates an instance of SpotifyClient with API key `\"apikey\"` and Secret Key `\"secretkey\"` as well as access token `\"accessToken\"`\n\n---\n\n### [SpotifyRestAPI](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/main/java/Client/SpotifyRestAPI.java)\n\n * For reference on Implementation of SpotifyClient in coordination with SpotifyRestAPI, check the [Test package](https://github.com/cthacker-udel/Java-Spotify-API/tree/master/src/test/java) (**specifically the [getRequests](https://github.com/cthacker-udel/Java-Spotify-API/tree/master/src/test/java/getRequests) package**)\n\n---\n\n### [Oauth Methods](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/test/java/Client/SpotifyRestAPITest.java)\n\n\n**Step 1** : Create an instance of SpotifyClient, follow the steps under the SpotifyClient Section\n\n**Step 2** : Add username or email,password,and this redirect uri: `http://localhost:8888/callback/` and add these values by acquiring an instance of the Spotify Login by using the method `client.getLogin();`, and using the appropriate methods outlined:\n\n* `setEmailOrUsername(String usernameoremail);` \n  * sets your email or username for acquiring access token\n\n* `setPassword(String password)`\n  * sets your password for logging into spotify to acquire token\n\n* `setRedirectUri(String redirectUri);`\n  * sets your redirect uri for acquiring the token\n\n**Step 3** : Acquire the access token by calling the method `client.requestAuthCodeFlowCode(SpotifyClient client);`\n\n---\n\n### [Album API Methods](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/test/java/getRequests/AlbumTest.java)\n\n\n**Step 1** : Access Album Instance by the method `getAlbum()` available with your SpotifyClient instance\n\n**Step 2** : Access the methods in the album instance, such as *addAlbumId*, and the setter and getters for individual query options for each request, all parameters are supplied in the tests file, under each type of request.\n\n--- \n\n### [Artist API Methods](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/test/java/getRequests/ArtistTest.java)\n\n**Step 1** : Access Artist Instance by the method `getArtists()` available with your SpotifyClient instance\n\n**Step 2** : Access the methods in the artist interface, such as *addArtistId*, and the setter and getters for individual query parameters, all query parameters are supplied in the tests file, under each type of request.\n\n---\n\n### [Browse API Methods](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/test/java/getRequests/BrowseTest.java)\n\n**Step 1**\n  * Access browse seed instance by utilizing the method `.getSeed()` with your SpotifyClient instance\n    * Once the seed instance has been created, add Artist, Track IDs by utilizing the method `.addSeedArtist(\"ID\")` and `.addSeedTrack(\"ID\")`, and also adding the genre name (as a String) with the method `.addSeedGenre(String genreName)`\n\n**Step 2**\n  * Once the seed has been given values for either artist, track, or genre, observe which instances need to be utilized for individual method calls by referencing this file : [BrowseTest.java](https://github.com/cthacker-udel/Java-Spotify-API/blob/master/src/test/java/getRequests/BrowseTest.java)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthacker-udel%2Fjava-spotify-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcthacker-udel%2Fjava-spotify-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthacker-udel%2Fjava-spotify-api/lists"}