Finding the album of a song - echonest

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.

Related

How To Get All Songs of An Artist on Spoitfy?

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.

How can I get songs by album name or album spotify id?

As you may know EchoNest does not have album information. But, can I get songs by album name or album spotify id?.
Does anybody have a workarround for this?
If you have the Spotify ID for the Album, why don't you use the Spotify API to get the Spotify ID for each of the tracks (https://developer.spotify.com/web-api/get-album/) - this gives an array of simplified track info as part of the response.
Then use the EchoNest track/profile api (http://developer.echonest.com/docs/v4/track.html#profile) to get the information for each track?
Update: Spotify is deprecating the echonest api (http://developer.echonest.com/) - but they're folding a good amount of the functionality into their own API. In this case you can call https://developer.spotify.com/web-api/get-several-audio-features/ to get the audio info for up to 100 tracks at a time, this should reduce to 2 calls per album (one to get the track list and one to get the audio features).

BeatsMusic API: How do I get albums an artist appears on?

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.

Get the name of the album from a tagged photo using Graph API

I am able to grab album name and photos uploaded by the user using the graph api.
When I use "https://graph.facebook.com/me/photos?access_token=".$access_token", I get all the tagged photos of the user. Is there a way to get the name of the album of a photo, which has not been uploaded by the user but by his friend?
Thanks
I don't think you can get that directly, but using the "link" attribute you can quickly suss it out, as seen in this example:
"link": "http://www.facebook.com/photo.php?fbid=10150154222339657&set=a.358879884656.199726.249427954656&type=1"
That set parameter and fbid tell you much more about the photo.
You can view more details about the photo by going to the page for it. It will tell you the position in the album, though it still won't have the album:
http://graph.facebook.com/10150154222339657
You can however determine the album id from the set parameter, the album id is the between the a. and the second ., so in this example the album id is 358879884656
So, the album info would be available at:
http://graph.facebook.com/358879884656

Convert facebook photo url link to photo's graph api object id

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);
}