Skip to content
A meteor package for Spotify's web API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/1 Update config.js Feb 3, 2016
.gitignore more updates Jun 4, 2015
LICENSE Initial commit Jun 4, 2015


A meteor wrapper for Spotify's web API via the wonderful spotify-web-api-node.

Check out an example (examples/1 folder) here:


  • meteor add xinranxiao:spotify-web-api


  1. Setup your clientId + clientSecret, either via the service-configuration package or directly through the api.
// This example is via `service-configuration`
  { "service": "spotify" },
    $set: {
      "clientId": "<your clientId>",
      "secret": "<your secret>"
  { upsert: true }
  1. Get an oauth access_token, either through xinranxiao:accounts-spotify, or directly through this API (refer here. ) for how).

  2. Make a new instance of the API and use it! Currently only available on the server.

var spotifyApi = new SpotifyWebApi();

// credentials are optional
var spotifyApi = new SpotifyWebApi({
  clientId : 'fcecfc72172e4cd267473117a17cbd4d',
  clientSecret : 'a6338157c9bb5ac9c71924cb2940e1a7',
  redirectUri : ''
// Get Elvis' albums `synchronously` on the server.
var response = spotifyApi.getArtistAlbums('43ZHCT0cAZBISjO8DG9PnE');

// Or use a classic callback approach. 
// Note that the OPTIONS parameter is always required for this format!
spotifyApi.getArtistAlbums('43ZHCT0cAZBISjO8DG9PnE', {}, function(err, result) {
  1. Your access_token will expire at some point.
// Just refresh the token and manually deal with the response.
// response contains the new access_token and the new expire_in
var response = spotifyApi.refreshAccessToken();

// Refresh the access token, update the current instance with the token, 
// and update the user's credentials as well.
spotifyApi.refreshAndUpdateAccessToken(); // All done here.

Currently, this package automatically sets the clientId and clientSecret if you have service-configuration configured. It also sets accessToken and refreshToken if you have a user connected with Spotify via xinranxiao:accounts-spotify (this won't work if you have your code inside a publication).


If you have any problems with or suggestions for this package, please create a new issue.

You can’t perform that action at this time.