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.
Related
I am planning to use the Spotify API to fetch some data, feeding track name and artist as search keywords. However, the track name and artist data I have some parsing errors, and I was wondering if there are any methods in Spotify API that auto-corrects the keywords.
For example, Google will fetch me documents about Radiohead even if I search for 'Radiohea','Radihead', and so. Also, the Last.fm API provides a method named 'track.getCorrection', which does jobs similar to those I explained above.
Here is the explanation of the method from the official Last.fm API website:
'Use the last.fm corrections data to check whether the supplied track has a correction to a canonical track.'
Does anyone know if such method exists in Spotify API?
No, there's no auto-correction engine. The closest Spotify gets to having a search engine is the search endpoint:
You can search, for instance, like this:
query = 'radio head'
and then
query_results = sp.search(q=query, type='playlist')
would return
...u'playlist'...{u'name': u'Air/Zero 7/Thievery Corp/Radio Head/Massive Attack/Morcheeba',...
but that requires that the playlist user spelled it wrong too. That is as far as a typo can get you, I'm afraid.
A workaround is fetching the artist using the last.fm API, use its auto-correction tool and then feed this result into Spotify API, either using artist, track or search endpoints.
I highly recommend you using more than one API for your app, as each one has its own limitations.
With SoundCloud's recent update showing RSS Downloads as a separate statistic, I am not able to find a way to get this stat via the API.
Looking at the HTTP API Reference for Tracks, I can see options for:
comment_count
download_count
playback_count
favoritings_count
Is there an option to get the RSS download count? Has the documentation just not been updated? If this isn't currently an option, will it be added?
On May 8th 2015, I checked the API via the developer console on Soundcloud and did not see any way to view the RSS download count, unfortunately.
Looks like the stat-reporting direction at SoundCloud has changed, and RSS plays will be part of the overall play number and broken-out in other ways.
https://www.soundcloudcommunity.com/soundcloud/topics/new-rss-stats-need-to-be-reflect-in-total-plays
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.
I want to know which playlists contain a certain video. The opposite is easy: find which video's are in a playlist, but I don't want that.
I can already have YT do this via the following route, but that's stupid and slow:
get channelId from video data (videos?id=...)
get playlists from channelId (playlists?channelId=...)
loop through all playlists and find all their videos (playlistItems?playlistId=...)
Like I said: stupid and slow. These steps are possible, because I only want playlists authored by the video's author. (Otherwise I'd have to download all of YT.)
What I'm looking for, sort of, is a request: playlists?videoId=..., but of course that doesn't exist.
Is there a better way than my 3 steps?
PS. I've created the script to use my 3 steps, but it's A LOT of requests. That and the playlists don't seem to have usable playlist ID's... I need the ID that the browser uses to show the playlist GUI style.
As of now, the Youtube API does not support a call like this, and in my opinion never will. This is probably an intentional decision by Youtube to hide the playlists, even the YT Analytics API doesn't show how many lists use your video.
It seems the way you do it is the only workaround - in case you only need the playlists for one specific user.
I asked in this question how to see how many views a Youtube playlist has. Unfortunately, it has been removed from the UI. Can I retrieve Youtube playlist views through the Youtube API?
For now, I think, there is no way to get round it in API requests. According to YouTube's Playlist Documentation, it does not provide a statistics parameter which is responsible for providing various stats about videos. I was also looking for a similar use case and I came across this question. Maybe someone else can find a (hackable-)way along the way.