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

Get Currently Playing Track

Get Currently Playing Track

Hi, I have recently started using the spotify developer api. I have experimented with https://developer.spotify.com/console/get-users-currently-playing-track/

To use the endpoint I generated a temporary token using the "Get Token" button to test out the endpoint. After creating an app in the dashboard section and obtaining the token I would test the endpoint again only to get this error:

{
  "error": {
    "status": 404,
    "message": "Invalid username"
  }
}

How do I specify the user to get currently playing track from? I tried things like ?user="username" but It still gave the same error

Reply
6 Replies

Sorry for my late response. I'm currently the only one who's answering questions on this board.

I haven't seen that error before. The Get Currently Playing Track endpoint doesn't need a username.

Note: You have to implement the Authorization Code Flow first to get access tokens. The access token from the console are for testing purposes in that console only.

How can I get the currently playing with the token of an application?

I don't want to use the console token, I want to use the token from my application to get the currently playing track

Like I said in my Note: You have to implement the Authorization Code Flow to get access tokens for your app.

What programming language are you currently using? Maybe there is a Web API Wrapper in that language that can make things a lot easier.

I am using python

Then I recommend you to use the python module spotipy. You can find its documentation here.

Suggested posts