The method call for /artists/[artist id]/albums returns only Albums, EPs, Singles and Compilations attributed to that artist.
I want to get the albums the artist appears on but are not attributed to that artist, e.g. various artists compilations where the artist has one track, or albums where the artist is a guest artist.
How do I get these "appears on"-albums for an artist? Preferrably without making more than one HTTP request.
There is not a direct way to set list every album the artist appears on in our public API. If you use artist/tracks, you will receive a list of tracks the artist appears on including soundtracks, compilations, etc., however, the full album list doesn't include every appearance.
Related
In their docs for getting top tracks on an artist they mention this:
The 10 maximum tracks are the ones displayed by the Spotify app. If you want to fetch more artist’s top tracks, an alternative way is to use Echo Nest song/search to accomplish this. It will accept a Spotify artist id for input and give you Spotify id’s in the output.
I'm pretty sure the Echo Nest Api no longer exists, so I am wondering if there is still a way to get songs of an artist other than just 10 of them?
Alternatively I was thinking of using Last.fm's Api to do it if Spotify no longer supports that functionality, if anyone has any other suggestions of how one could work around this that would be great! Thanks in advance.
I think you won't be able to achieve it in single API call in Spotify. However there's an alternative:
Request all albums of an artist (have a look here):
https://api.spotify.com/v1/artists/{id}/albums
And then request the tracks of each album (have a look here):
https://api.spotify.com/v1/albums/{id}/tracks
To avoid one request for each album, you can get multiple albums at once and when an album is requested, the tracks of such album will be returned in a paging object. You can pass the desired albums identifiers separated by , in the id query parameter to the following endpoint (have a look here):
https://api.spotify.com/v1/albums
A solution that was more sufficient for me here was:
https://api.spotify.com/v1/search?type=track&q=artist:ArtistName
this returns the top songs by this artist, with pagination so definitely more than 10 results.
The only caveat is that this includes songs that the artist might be featured on, but I think this is useful really as if it's a popular song your user might be looking for it.
I've been playing around with Echonest, but can't seem to figure out how to get the album of a song (given I have the artist name and the song). I'd also like to find the genre and the album cover. Or are these things I'd have to use foreign ID spaces for (Rosetta Stone)?
Honestly, it'd be nice if I could punch in the artist name and title and get a summary of information about the song.
check out this:
http://developer.echonest.com/docs/v4/song.html#search
you should provide your title and artist name to the search api possibly with an external id like id:7digital or id:spotify since echonest does not give you album information directly. I guess most of the cases you can find foreign release id for spotify album and get the release information about it from spotify. Instead, you can skip echonest api and directly make your searches in spotify API.
I am using the ALAssets library to build a custom image picker controller (much like in the photos app). Specifically I'm using enumerateGroupsWithTypes to populate a list of albums so I can put them in a table. I'm noticing when using this method, it populates the list in reverse order as the photos app so the albums are displayed reversed. For example:
The photos app displays the albums this way:
My app displays the albums this way:
Obvious solution is for me to just add the albums to the front of my array instead of the back, however I wanted to know if this is the usual behavior or if this is a bug? "Test Row" and "Test Row 2" I created using the new option in ios5 that lets you create your own album in the photos app, but I wonder if you add albums through other ways (like through iPhoto which I'm unsure how to do), are they ordered correctly? Has anyone come across this?
It does not appear to be possible to change the order by which AssetsLibrary framework returns to the caller ALAssetsGroups.
I am working with FBGraphAPI in my project. I managed to get the list of albums. I tried to get picutre (cover_photo) and photos in albums. But somehow i stuck in it.
Which inbuilt method i need to use to get cover_photo and photos in the album? And how to use it?
To get the cover_photo, you need to use
https://graph.facebook.com/<id>/picture?type=album&access_token=<token>
where id is the cover_photo from your album returned in the album list.
and token is your current session token
Note. It needs to be https and you need to specify the token. This is what makes it different than, for example, rendering a user's photo.
By photos in album, not sure if you mean the list of photos or the actual photo itself?
The basic process is to use the id of the album returned and then call
https://graph.facebook.com/<id>/photos
This will return a list of photos in the album.
Within this list will be 'source' which contains the url of the photo.
Also a dictionary of different photo resolutions.
Given a link to a facebook photo like this:
http://www.facebook.com/photo.php?pid=123&id=456
how can I get the internal facebook id for the photo? The "pid" in the link is not the "pid" in FQL in the "photo" table from what I've seen in my experimentation. The best I can think of is to read back all the user's photos using the userid (id=456) and look for a matching link URL but that is slow and clumsy. Is there a more direct approach?
Edit: this is the best I've been able to come up with, it works but it pulls a lot of data back if the user has many photos. It executes reasonably fast (1 second or so) so it's OK but I'd still like to know if there is a more direct approach:
SELECT link,object_id,aid FROM photo WHERE aid in (SELECT aid FROM album WHERE owner=456);
then search the results for a matching link with the "pid=123" substring
It turns out I also need the object id for the album and its size, so then I do a second query with the matching aid found from the first step:
SELECT object_id,size FROM album WHERE aid='<aidFromStep1>' AND owner=456;
not sure if it is what you want but if C# is the call then i have done this through following code
dynamic friends = app.Get("me/photos", parameters);
foreach (dynamic photoInfo in friends.data)
{
MessageBox.Show("Photo id is "+ photoInfo.id);
}