Expose your currently playing track on Spotify, alongside Spotify profile, recently played tracks and top items, to a public API. You can then use the API to grab the information without having to authenticate any further. This minimizes the pain-in-the-ass to work with Spotify Authorization and thus all you need is your Spotify User ID. (Not open source)
https://spotify-status.snehasish.xyz
Spotify Status API is now hosted on Vercel. The base URL is given above.
The API needs you to authorize/login once using your Spotify Account. We will handle the rest of authentication for you!
The complete step-by-step process is given below.
Go to https://spotify-status.snehasish.xyz/login and login to the API using your Spotify Account. We handle the rest of authentication, like: periodically refreshing your access token after it has expired and stuff.
It asks for the following permissions:
- Your email address (always kept private)
- Subscription type, country and explicit content filter (always kept private)
- Display name, username, profile picture, followers and public playlists (only display name, username, profile picture is shared)
- Recently played tracks and artists (shared in the
/users/:id/recents
endpoint) - Currently playing track (shared in the
/users/:id/status
endpoint) - Top artists and tracks (shared in the
/users/:id/top/:type
endpoint)
We do not ask for any private permissions. You can check the permissions in the authorization page itself.
You will be automatically redirected to your Spotify User Profile information endpoint, immediately after the authorization/login has been successful. Grab your Spotify User ID from there. We will use the ID to access other endpoints from now on.
Once you have grabbed your Spotify account user ID, you just need to send the required GET
requests to our endpoints.
E N D P O I N T S
- Profile Information
GET /users/[USER_ID]
Params:
[USER_ID]
: Your Spotify Account User ID. ^Response: https://developer.spotify.com/documentation/web-api/reference/get-current-users-profile Note:
country
,explicit_content
,product
are not shared.
- Currently Playing Track
GET /users/[USER_ID]/status
Params:
[USER_ID]
: Your Spotify Account User ID. ^Response: https://developer.spotify.com/documentation/web-api/reference/get-the-users-currently-playing-track
- Recently Played Tracks
GET /users/[USER_ID]/recents
Params:
[USER_ID]
: Your Spotify Account User ID. ^Query:
[Removed]
Response: https://developer.spotify.com/documentation/web-api/reference/get-recently-played
- Top Tracks/Artists
GET /users/[USER_ID]/top/[TYPE]
Params:
[USER_ID]
: Your Spotify Account User ID. ^[TYPE]
: Must be any one of the two values:
artists
: Get top artiststracks
: Get top tracksQuery:
time_range
: (string) Over what time frame the affinities are computed. Valid values: long_term (calculated from several years of data and including all new data as it becomes available), medium_term (approximately last 6 months), short_term (approximately last 4 weeks).limit
: (integer) The maximum number of items to return.offset
: (integer) The index of the first item to return. Default: 0 (the first item). Use with limit to get the next set of items.Response: https://developer.spotify.com/documentation/web-api/reference/get-users-top-artists-and-tracks
That's it lol. GGEZ!