Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
spotify-audio-api
Advanced tools
Spotify Web API wrapper to return audio metadata. This wrapper uses the client credentials auth flow, so only non-user related endpoints can be called.
$ yarn add spotify-audio-api
Instantiate the class with your client ID and client secret provided from the Spotify developer dashboard:
const clientId = 'fsd9f89shfsf2j'
const clientSecret = 'qf9asfsdgh9osgh9sa2'
const spotify = new SpotifyAPI(clientId, clientSecret)
This wrapper provides an axios instance with the Spotify API url as the base url.
You can retrieve an auth token with the getToken()
method. This method fetches an auth token and sets it as the Authorization
header in the axios instance.
spotify.getToken()
spotify.instance.get(`/artists/3TVXtAsR1Inumwj472S9r4`).then((response) => console.log(response.data))
getToken()
Makes a POST
request to the Spotify API and sets the returned token in an axios instance.
getAlbum(albumId, callback)
Params
albumId
: spotify ID of an albumcallback
: function to handle the returned datagetAlbumTracks(albumId, callback)
Get info on an album's tracks.
Params
albumId
: spotify ID of an albumcallback
: function to handle the returned datagetArtist(artistId, callback)
Params
artistId
: spotify ID of an artistcallback
: function to handle the returned datagetAlbumsForArtist(artistId, callback)
Params
artistId
: spotify ID of an artistcallback
: function to handle the returned datagetRelatedArtists(artistId, callback)
Get artists related to an artist.
Params
artistId
: spotify ID of an artistcallback
: function to handle the returned datagetTrack(trackId, callback)
Params
trackId
: spotify ID of a trackcallback
: function to handle the returned datagetTrackFeatures(trackId, callback)
Get audio features for a single track/
Params
trackId
: spotify ID of a trackcallback
: function to handle the returned dataGet audio analysis for a single track.
Params
trackId
: spotify ID of a trackcallback
: function to handle the returned datasearchArtists(query, callback)
Params
query
: Search query stringcallback
: function to handle the returned datasearchTracks(query, callback)
Params
query
: Search query stringcallback
: function to handle the returned datasearchAlbums(query, callback)
Params
query
: Search query stringcallback
: function to handle the returned databuilt with skeletor 💀
FAQs
Spotify API wrapper to return audio metadata
The npm package spotify-audio-api receives a total of 5 weekly downloads. As such, spotify-audio-api popularity was classified as not popular.
We found that spotify-audio-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.