Get Your Spotify Refresh Token With This Simple Web App

Alec Chen
3 min readMar 24, 2021

I made a simple site for developers to easily get their own refresh and access tokens for Spotify’s API. Check it out here (updated October 2022).

Screenshot of the site as of publishing this article (March 2021).

Motive Behind This Spotify API Authorization Wrapper

I was adding this page to my personal website that calls the Spotify API to show a brief listening history for my account.

Screenshot of the personal webpage as of publishing this article

However, to retrieve this information from the Spotify API, it requires you to log in. I didn’t want any sort of overhead for others to just see my recent songs, so I ended up setting up the authorization in this example authorization repo and going through all this trouble to just get a refresh token, which allows you to get access tokens without logging in every time. I wished there could’ve been a simple website that I could’ve easily just put in my credentials and scopes and gotten back my refresh token. So that’s what I built.

Feel free to stop reading here to go give my repo a star. This article is just to get this out there so developers looking for it might find it on Google. I figured Medium has pretty high domain authority, so this might help with that. The rest of this article is just keywords for SEO.

Spotify API Authorization Flows

Authorization code flow authorization code flow authorization code flow. Refresh token access token no login already known credentials single request. Authorization code flow authorization code flow authorization code flow. Refresh token access token no login already known credentials single request. Authorization code flow authorization code flow authorization code flow. Refresh token access token no login already known credentials single request.

Spotify API Client Credentials Scopes

Spotify API client credentials, client id, client secret, scopes. Spotify API client credentials, client id, client secret, scopes. Spotify API client credentials, client id, client secret, scopes. Ugc-image-upload user-read-recently-played user-top-read user-read-playback-position user-read-playback-state user-modify-playback-state user-read-currently-playing app-remote-control streaming playlist-modify-public playlist-modify-private playlist-read-private playlist-read-collaborative user-follow-modify user-follow-read user-library-modify user-library-read user-read-email user-read-private.

Spotify API client credentials, client id, client secret, scopes. Spotify API client credentials, client id, client secret, scopes. Spotify API client credentials, client id, client secret, scopes. Ugc-image-upload user-read-recently-played user-top-read user-read-playback-position user-read-playback-state user-modify-playback-state user-read-currently-playing app-remote-control streaming playlist-modify-public playlist-modify-private playlist-read-private playlist-read-collaborative user-follow-modify user-follow-read user-library-modify user-library-read user-read-email user-read-private.

Conclusion

Hope you enjoyed this article. And if this web app or the code in my repo helped you out in any way, please star my repo so I can get developer status points. Thank you and have a beautiful day.

--

--