Usage

Contents

    In order to use the API, an access token is required. See in Authentication section how to get one.
    IMPORTANT: access token that are available using Client credential flow do NOT allow to access user data !

    Player statistics

    curl https://api.spotify.com/v1/me/player -H "Authorization: Bearer $SPOOTIFY_ACCESS_TOKEN"

    {
      "device" : {
    	"id" : "....",
    	"is_active" : true,
    	"is_private_session" : false,
    	"is_restricted" : false,
    	"name" : "egandrille",
    	"type" : "Computer",
    	"volume_percent" : 79
      },
      "shuffle_state" : false,
      "repeat_state" : "off",
      "item" : {
    	"name" : "Le bilan",
    	"popularity" : 60,
    	"uri" : "spotify:track:4hElE1DmCfpoFVjczvfB5U"
      },
      "is_playing" : true,
      ...
      ...
      ...
    }
    

    PLAYER CONTROL

    User's Saved Tracks

    Get current playing track
    curl -s https://api.spotify.com/v1/me/player -H "Authorization: Bearer $SPOOTIFY_ACCESS_TOKEN" | jq '.item.id'

    Check if a song is a prefered one
    ID=.....
    curl https://api.spotify.com/v1/me/tracks/contains?ids=$ID -H "Authorization: Bearer $SPOOTIFY_ACCESS_TOKEN"

    Set as prefered one
    curl https://api.spotify.com/v1/me/tracks?ids=$ID -X PUT -H "Authorization: Bearer $SPOOTIFY_ACCESS_TOKEN"

    Proudly Powered by Zim 0.75.2.

    Template by Etienne Gandrille, based on ZeroFiveEight and using JQuery Toc Plugin.