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

How to make is possible for anyone to fetch my spotify data without auth flows

How to make is possible for anyone to fetch my spotify data without auth flows

My goal is to display the song I'm currently listening to using the player endpoint on the api. The issue is that I would need to use one of the authorization flows to get this data, which shouldn't be necessary for anyone visiting the website (because only my profile needs to be accessed). How can I make it possible for anybody to fetch my data without having to login using my credentials?

Reply
2 Replies

  1. make an auth flows that let you log in
  2. safe the tokens on your server (changeable)
  3. let your server-side script use the tokens
  4. let your app refresh the tokens when they are expired

Note: in development mode, the rate-limit might be lower.

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.

That's easy. Just go through the authorization process yourself once, then store the access token and refresh token on your backend sever. The access token can be refreshed with the refresh token programmatically without any user interaction every hour by your backend. Your backend should then contain an endpoint which uses the access token to make a request to the Spotify web API endpoint for current playback. Your frontend can then use this endpoint to display the data.

Suggested posts