Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

`Start/Resume Playback` API returns error 403: PREMIUM_REQUIRED

Solved!

`Start/Resume Playback` API returns error 403: PREMIUM_REQUIRED

Plan

Free

Country

India 

 

Device

(Dell Inspiron)

Operating System

(Windows 11)

 

My Question or Issue

I am currently implementing an authorization flow with PKCE, and I have encountered an issue. When making an API request to the `Start/Resume Playback` endpoint- https://api.spotify.com/v1/me/player/play, I receive an error- 403: "PREMIUM_REQUIRED". 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 plain js.

 

 

 

 

 

const accessToken = await getAccessToken();

// Request body
const requestBody = {
	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(requestBody),
};

// Make the PUT request
const response = await fetch(
	"https://api.spotify.com/v1/me/player/play",
	requestOptions
);

console.log("Response:", response.status, response.statusText);

 

 

 

 

 

Here, playlistId is a valid playlist ID which I am using for this request. Access token valid too.
But i am getting this response. 

 

 

 

 

 

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

 

 

 

 

 

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

Reply

Accepted Solutions
Marked as solution

The error says: PREMIUM_REQUIRED, so, yes, a premium account is required to make API requests to this particular endpoint.

XimzendSpotify 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.

View solution in original post

4 Replies
Marked as solution

The error says: PREMIUM_REQUIRED, so, yes, a premium account is required to make API requests to this particular endpoint.

XimzendSpotify 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.

Is there any documentation for all the APIs that need a premium account? I dont see it on the Web API Reference Page.

It is mentioned in this article and at this page that (most) Player endpoints require a Spotify Premium subscription.

XimzendSpotify 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.

but the apis are not working for users wh obought premium too.
see the latest reply by user : divy to this post : https://community.spotify.com/t5/Spotify-for-Developers/API-403-Studen-Premium-Premium-required/m-p/... 

Suggested posts