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

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).

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 the photo ID of the Facebook Cover Photo album?

How can I get the facebooks' user cover photo via the PHP SDK?
Thanks in advance.
B.W.
I have tried to loop through the Graph API, but it didn't work because the album was in the second page, and wasn't displayed.
There's no way to get this without looping through the album list - you could specify a higher limit in the request for the initial list of albums if you really need to do this without paginating through the albums

How to get cover photo of album and photos of the album using FBGraph Api

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.

Using the Facebook Graph API how can find the most liked photo in an album on one of my pages?

Using the Facebook Graph API how can find the most liked photo in an album on one of my pages?
I have access to the page insights if that can be used.
There are 200 photos in each album so I don't want to do an api request for each photo.
Subsequently you may also find the most commented on.
Here is the code you request:
http://fivespot.me/fblikes.php
$likes = $facebook->api('/'.$picId.'/likes');
However if you are looking to just find out the most liked there is an app already compiled that will do this for you:
http://apps.facebook.com/imanpic/
The Graph API doesnt support querying for an arbitrary set of photos with some criteria. BUT - you can access the Likes object for each Album, which returns a data set representing all the Liked Photos in that Album. You could then just walk that data set and count the number of times you see the same photo Like.
Thus - you just need to issue a Graph API call for Likes sub-object of an Album.
See "Likes" under "Connections" at:
http://developers.facebook.com/docs/reference/api/album/

Use graph.facebook.com to get URL's and Names of Photos

I need to get the URL's and names of the Photos contained in a Facebook Photo Album.
I know this is possible through graph.facebook.com but I don't know where to find the ID of an Album.
As an example you can use this Album: http://www.facebook.com/media/set/?set=a.210725979538.130908.69116329538
Which one of the Numbers is the Album ID? And How do I get the Photo URL's with name??
Thank you in advance.
Just get the /albums relationship. For your example:
http://developers.facebook.com/tools/explorer/?method=GET&path=thebeatles%2Falbums
Then use 10150213069439539/photos to get the photos of the first album (or any other album you want, just change the id based on what you got from /albums).
I suggest you to read the whole Graph API Core Concepts page and trying its examples.
And also read the album and photo documentation.