Can I use the Spotify recommendation intelligence in an app? - api

On the Spotify dashboard an user has a great experience through the recommended artist and songs. I would like to use this intelligence in an app we plan to develop for a big Dutch based podium. So the app can give a list of concerts playing at the poppodium which the user might be interested in.
Can I get this recommended artist data, based on the user's history, through the Spotify API?

The Spotify API now provides recommendations:
https://developer.spotify.com/web-api/get-recommendations/
Recommendations are generated based on the available information for a
given seed entity and matched against similar artists and tracks. If
there is sufficient information about the provided seeds, a list of
tracks will be returned together with pool size details.
For artists and tracks that are very new or obscure there might not be
enough data to generate a list of tracks.
There are a bunch of parameters that can be configured for fine-tuning the recommendation: key, genre, loudness, energy, instrumentalness, popularity, speechiness, danceability, key ...

You can use Spotify's Web API endpoints to fetch these data:
The Get a User’s Top Artists and Tracks endpoint will give you artists and tracks based on user's listening history. You can also use the Get Current User’s Recently Played Tracks, which will give you up to 50 recently played tracks.
Use the artists and tracks you just get and use them as seeds for the Get Recommendations Based on Seeds endpoint. This endpoint will only return tracks. If you want to get artists based on other artists there is the Get an Artist’s Related Artists endpoint that you can use.
As you see, combining multiple endpoints will get you covered. Just make sure you read the Web API Authorization Guide before. You are going to need the user to authenticate in order to get user's data.
Note: When the question was first posted (July 2013), Spotify's Web API didn't exist. The question referred to a now defunct Spotify Apps API which didn't provide a way to generate recommendations based on listening history.

Related

How can I extract player information from Riot/ubisoft/steam/epic games accounts?

I want to make an app for gamers that uses statistics from the games they play. I want to link Riot/ubisoft/steam/epic games/ account to my app and use the user's game data (with permission of-course). Is there a way to access that information? I was not able to find much on my own. Steam has web apis that might be able to get that information but I don't understand how much information I can get from there as well.
You need to use one of their internal APIs. Ubisoft uses its own demux API. There are several examples on GitHub on how to do that. In my case ,I am grabbing data from tracker.gg and Ubisoft. Here's a repo for my API Server .
https://github.com/alexanderthegreat96/dth-division2-api

Single youtube API to get total number of videos and and total number of subscribers on my channel

I tried Analytics and Reporting APIs separately. And there are questions and answers which deals with them separately. But I want to know is there any single one shot API which gives both? The total number of videos means all the videos irrespective of the playlists. I'm doing this with ReactJS for my own portfolio website.
I did some more research on this. I couldn't find a full fledged api with documentation but you can use this:
https://www.googleapis.com/youtube/v3/channels?part=statistics&id=your-channel-id&key=your-api-key
Make sure you've that api enabled. I'm using Youtube Analytics.

Soundcloud API playlist returns no tracks in certain cases

When trying to get the track details for a playlist using the /playlists endpoint, for certain playlists there are no tracks returned in the data.
Sample of returned data
"license":"all-rights-reserved",
"tracks":[],
"playlist_type":null,
"id":199987807,
So far all the playlists behaving this way contain a single track, but NOT all playlists with one track return no tracks.
Examples of no tracks returned:
http://api.soundcloud.com/playlists/199987807?client_id=YOUR_CLIENT_ID
http://api.soundcloud.com/playlists/199987052?client_id=YOUR_CLIENT_ID
SoundCloud API keys have different access levels. SoundCloud can restrict API access for certain artists and playlists based on the API key used to make the request.
As you can see, a standard developer API key cannot see the tracks from those playlists.
There is a way around this, although it breaks SoundCloud's terms of service.
Using a different API key, such as the key youtube-dl uses to get the MP3 link for specific tracks (which is presumably a Soundcloud master key), gives you access to this information.
Again, using someone else's API key violates SoundCloud's terms of service, and there is no guarantee this key will continue working. This is just a workaround to the current restriction you're seeing.
Related discussion in two other questions: Get HTTP MP3 stream from every song and SoundCloud API returning 0 tracks despite user having tracks.

Retrieve spotify album covers of currently played songs

Hej,
I'd like to retrieve the cover artworks of my current listenings and put it in a way like this:
[http://codepen.io/motorlatitude/pen/hipIl][1]
I found a couple of solution on how to get the album covers in general, but not for my recent listenings only.
Thanks! :)
The Spotify Web API has an endpoint for returning the cover artwork of a given album, see the images property in the information return in Get Album.
However, Spotify doesn't expose recent listenings, so you'll need to get that information somehow. Some people use Last.FM API, that can give you this information if you scrobble to Last.fm from Spotify or any music player.

Forgotify vs track play count in Spotify API

There's lots of buzz about Forgotify (http://forgotify.com) - a tool, that crawls Spotify against unplayed tracks.
Non-technical press articles say that they use Spotify API to crawl the songs and index only those with zero play count.
However, according to Spotify API documentation, such value is not available for single tracks:
https://developer.spotify.com/docs/apps/api/1.0/api-models-track.html
Similar question about possibility to retrieve track play count has also been answered here on StackOverflow (Get play count of a track from Spotify API) with similar results - that it's not possible.
I'm looking for a clue how Forgotify achieved what they claim they did. Any ideas? :)
The metadata api and libspotify provide the popularity score for songs. Perhaps they searched for tracks with popularity of zero. I don't know that zero popularity implies zero plays though.
They also could have implemented a remote control of the desktop client with some screen scraping. Or reverse engineered whatever internal communication the desktop does (though I suspect Spotify would have put a stop to that).