GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cthacker-udel/Java-Spotify-API: Unofficial Java-based Wrapper for Spotify Rest API using only Retrofit, GSON, Selenium and WebDriver Manager (to generate access tokens)!

BranchesTags
Open more actions menu

Latest commit

 

History

282 Commits
282 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.gradle
.gradle
 
 
.idea
.idea
 
 
build
build
 
 
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Public Rest API for Spotify - Cameron Thacker (4/1/2021)

Version dependencies Retrofit Gson Selenium WebdriverManager

GitHub stars

General API Information

All information contained within this repository is referenced from the Spotify Web API Reference website

  • The base http client code is contained within the class called : Spotify Client

  • The Rest API methods that interact with the Retrofit interface are located at the class called : Spotify Rest API

  • The Interfaces corresponding to section in the Web API Reference are located in the Model folder located here : Model

  • Majority of requests are made via Retrofit interface, only 1 request is made via Selenium, and that is generating the access tokens! The tests listed under this folder have been tested for functionality, if any functions do not function properly, please raise an issue! Raise an issue here

All additions and recommendations are welcome!

  • Please check the Project Tab for Updates on current objectives

Usage

  • How to use the Java-Spotify-API wrapper
    • Create an instance of SpotifyClient by calling the constructors listed in this file
    • When you create an instance of SpotifyClient using the constructors listed above, you can utilize the methods listed in SpotifyRestAPI listed in this file

Examples

SpotifyClient

  • SpotifyClient client = new SpotifyClient();

    • creates an instance of SpotifyClient with empty API key and Secret Key
  • SpotifyClient client = new SpotifyClient("apikey","secretkey");

    • creates an instance of SpotifyClient with API key "apikey" and Secret Key "secretkey" recommended usage
  • SpotifyClient client = new SpotifyClient("apikey","secretkey","accessToken");

    • creates an instance of SpotifyClient with API key "apikey" and Secret Key "secretkey" as well as access token "accessToken"

SpotifyRestAPI

  • For reference on Implementation of SpotifyClient in coordination with SpotifyRestAPI, check the Test package (specifically the getRequests package)

Oauth Methods

Step 1 : Create an instance of SpotifyClient, follow the steps under the SpotifyClient Section

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:

  • setEmailOrUsername(String usernameoremail);

    • sets your email or username for acquiring access token
  • setPassword(String password)

    • sets your password for logging into spotify to acquire token
  • setRedirectUri(String redirectUri);

    • sets your redirect uri for acquiring the token

Step 3 : Acquire the access token by calling the method client.requestAuthCodeFlowCode(SpotifyClient client);


Album API Methods

Step 1 : Access Album Instance by the method getAlbum() available with your SpotifyClient instance

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.


Artist API Methods

Step 1 : Access Artist Instance by the method getArtists() available with your SpotifyClient instance

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.


Browse API Methods

Step 1

  • Access browse seed instance by utilizing the method .getSeed() with your SpotifyClient instance
    • 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)

Step 2

  • 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

About

Unofficial Java-based Wrapper for Spotify Rest API using only Retrofit, GSON, Selenium and WebDriver Manager (to generate access tokens)!

Topics

javajava-8java-spotify-apirepositoryretrofit-interfaceseleniumselenium-webdriverspotifyspotify-apispotify-clonespotify-connectspotify-downloaderspotify-libraryspotify-playlistspotify-pluginspotify-sdkspotify-web-apiwebdriverwebdrivermanagerwrapper

Resources

Readme
Activity

Stars

9 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.