Announcements

Help Wizard

Step 1

NEXT STEP

API 403: Studen Premium: Premium required

Solved!

API 403: Studen Premium: Premium required

Plan

Student Premium

 

My Question or Issue

I am currently working on a student project with the Spotify API. On a simple play request (https://api.spotify.com/v1/me/player/play) I am getting this error response:

 

 

{
  "error": {
    "status": 403,
    "message": "Player command failed: Premium required",
    "reason": "PREMIUM_REQUIRED"
  }
}

 

 

 Is it because I am using a student premium account?

 

Reply

Accepted Solutions
Marked as solution

Hi @floriankapaun, welcome to the forum.

 

The client credentials OAuth flow won't work for this particular endpoint. In order to use the /v1/me/player/play endpoint, try getting an access token through one of the user authentication OAuth flows, like the authorization code flow. You can find out more about the different flows here: https://developer.spotify.com/documentation/general/guides/authorization-guide/

View solution in original post

16 Replies

Hey @floriankapaun, thanks for coming to the Spotify Community!

 

Awesome to hear you’re using Spotify for your project! You should be able to use Spotify Premium
for Students with the API, just like you’d use ‘regular’ Spotify Premium.

 

Could you make sure you’re using the access-token for the right account? Could you make sure that the account you’re logging into is on Spotify Premium (for Students) on spotify.com/account? 

 

Keep me in loop!

 

Have a good one,

Hubo

HuboSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Hi, I have the same problem, I have only one spotify premium account with its
respective app on https://developer.spotify.com/dashboard/applications,
I can play any track at https://developer.spotify.com/console/
but using the api (spotify-web- api-node) I get Player command failed:
Premium required PREMIUM_REQUIRED

Hey @Hubo, thanks for your replay.

 

I appreciate your help and checked the things you asked for. I am using the right account and access-token. If I'm sending an request to https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj for example with my access-token, everything works as expected.

 

Best regards,

 

Florian

Hey @floriankapaun, thanks for keeping me in loop!

 

Hmm, let's try something else. Could you make sure you're requesting the: 'user-modify-playback-state'-scope element? Also, does this happen with all tracks or just this one?? Let me know how you get on!

 

Have a good one,

Hubo

HuboSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Hey @Hubo, thanks for your suggestion.

 

Unfortunately that doesn't work either.

 

Let me show you step by step what I did, so we can make sure I didn't make any careless mistakes.

 

1. Request access-token

POST https://accounts.spotify.com/api/token

"grant_type": "client_credentials"
"client_id": "<my-client-id>"
"client_secret": "<my-client-secret>"
"scope": "user-modify-playback-state"

This returns

{
  "access_token": "<my-access-token>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "user-modify-playback-state"
}

2. Start/Resume a User's Playback

PUT https://api.spotify.com/v1/me/player/play

Authentication: Bearer "<my-access-token>"

And that returns

{
  "error": {
    "status": 403,
    "message": "Player command failed: Premium required",
    "reason": "PREMIUM_REQUIRED"
  }
}

 

Marked as solution

Hi @floriankapaun, welcome to the forum.

 

The client credentials OAuth flow won't work for this particular endpoint. In order to use the /v1/me/player/play endpoint, try getting an access token through one of the user authentication OAuth flows, like the authorization code flow. You can find out more about the different flows here: https://developer.spotify.com/documentation/general/guides/authorization-guide/

Thanks @spotifyjosh!
That was the answer to my problem. With an OAuth flow like you suggested everything is working as expected. 🙂

Does the spotify API works only for premium users??

Hey,**bleep** the Start/Resume Playback necessarily requires a Spotify premium account?

Hello, I am trying to fetch audioURL from Spotify web api for my flutter music app. It return proper url for some songs but returns null as audioURL value for some of the songs. Can you give suggestion to address my issue

I am currently implementing an authorization flow with PKCE, and I have encountered an issue. When making an API request to the endpoint https://api.spotify.com/v1/me/player/play, I receive a 403: "PREMIUM_REQUIRED" error. It's important to note that I am using a free Spotify account that does not have any paid membership.
This is how i am making the request in js.

const accessToken = await getAccessToken();

		// Request body
		const body = {
			context_uri: `spotify:playlist:${playlistId}`,
			offset: 0,
			position_ms: 0,
		};
		
		// Request options
		const requestOptions = {
			method: "PUT",
			headers: {
				Accept: "application/json",
				Authorization: "Bearer " + accessToken,
				"Content-Type": "application/json",
			},
			body: JSON.stringify(body),
		};

		try {
			// Make the PUT request 
			const response = await fetch(
				"https://api.spotify.com/v1/me/player/play",
				requestOptions
			);
			if (response.ok) {
				// Request was successful
				console.log("Playback started successfully.");
			} else {
				// Handle errors here
				console.error("Error:", response.status, response.statusText);
			}
		} catch (error) {
			console.error("Error:", error);
		}

This is the error i am getting.

{
  "error" : {
    "status" : 403,
    "message" : "Player command failed: Premium required",
    "reason" : "PREMIUM_REQUIRED"
  }
}


My question is, do I require a premium account to make API requests to this particular endpoint? Interestingly, I am receiving a 200 response when using the 'Get Playback State' endpoint.

Hi ,

I have been using implicit grant method that does require user authentication and yet I am facing the same problem (403 : Player command failed: Premium required). I even went ahead and purchased the premium and it still didn't work. Would really really appreciate a response since I am in the final stages of completing my client App. (P.S: I am newbie to coding). 

Can you get for example your top tracks with an access token using the same flow, when you add the user-top-read scope? This to check if the flow is working properly.

I have premium and get an access_token. Trying to reach 

https://api.spotify.com/v1/me/player/play

 gets 403 premium error. 

I use the spotify-player( a tui for spotify), I have the same question.

Update:- The 403 error was resolved after purchasing premium (I purchased
regular plan. Not student discount).

Suggested posts