enhanced-spotify-api
v1.1.9
Published
Object-oriented library to work with Spotify's API. Includes wrapper for regular endpoints and additional functionality and grouping of requests.
Downloads
77
Maintainers
Readme
Overview
enhanced-spotify-api is an Object-Oriented API Wrapper aimed to make Spotify's API development fun and painless.
Spend more of your time coding something cool, and less time scouring over documentation.
Table of Contents
Official Website / Documentation
Features
Object oriented wrapper with classes for tracks, artists, playlists, and more
- Member functions for all relevant endpoints
- Automatic retrieval of data when needed
- Minimizing requests made
Providing all the original functionality of spotify-web-api-node.
- Added missing endpoints for shows and episodes (Just released 3/2020)
- Fixed known bugs
Add and Override methods
- Customize to your hearts content
- I don't know what you need it for, so do your thing my dude.
Quick Start
Via command line
$ npm i enhanced-spotify-api
Import either the entire library
var EnhancedSpotifyAPI = require('enhanced-spotify-api');
EnhancedSpotifyAPI.setAccessToken( myAccessToken );
Or deconstruct what you need
var { Track } = require('enhanced-spotify-api');
Track.setAccessToken( myAccessToken );
All classes have the same authorization methods.
Applying a Spotify access token to one class will authorize the entire library and will not need to be called again.
Instantiate and play!
var playlistID = '6Ibg2aBUp5NP0lAujEGa6p';
var playlist = new Playlist( playlistID );
var tracks = playlist.getTracks();
tracks.play();
var size = playlist.size();
See the official website for more information.
Example
var { Track } = require('enhanced-spotify-api');
Track.setAccessToken( myAccessToken );
var trackID = '3HKpZgez8S4TS2F0sWLvAR';
var track = new Track( trackID );
console.log('My favorite song is', ( await track.getFullObject() ).name);
track.play();
var artists = track.getArtists();
var artist = artists.get(0);
var topTracks = artist.getTopTracks();
Available Classes
Instance and static methods for all endpoints relevent to each item
- Track
- Artist
- Album
- Playlist
- Show
- Episode
- User
- Playback
- Tracks
- Artists
- Albums
- Playlists
- Shows
- Episodes
- Categories