I'm using the deezer API and I wonder if there is a way to find user's favorite genre ?
The only solution I found is to search for every user's favorite album (https://api.deezer.com/album/105374). But this requires a lots of request !
I wonder if it's possible to get several album details in one time ? (e.g. https://api.deezer.com/album/105374,1053743). Or maybe something else ?
Thank you !
Unfortunately, there is no way to get that information directly. What you can do is to get the top tracks/albums with http://developers.deezer.com/api/user/charts, and look for the genre.
There is no possibility too to get several albums in the same request.
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 am going to be using the Facebook SDK, however I was wondering if there was a way that I could use this SDK to pull a listing of all pictures I share with a certain person. For instance, if it is Friend X's birthday today, I would like to pull a list of all images that me and Friend X are tagged in together.
Any advice would be helpful!
you could perform the following request
GET me/photos?type=tagged&fields=id,tags
this will return all your tagged photos , and a json array of people who are tagged in it , you could parse the json response and iterate over the tagged people to determine whether the friend you specify is tagged or not .
Navigate in your browser to the following URL to get an idea of what I'm talking about
https://graph.facebook.com/me/photos?type=tagged&fields=id,tags&access_token={Your Access Token}
How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.
I am trying to build an app and my requirement is to get ratings given to all the movies of a user.
I was able to find this tutorial which describes how to get likes but not ratings.
https://developers.facebook.com/blog/post/2011/03/18/how-to--use-the-graph-api-to-pull-the-movies-friends-like/
Furthermore, I was able to find out this documentation
https://developers.facebook.com/docs/reference/opengraph/action-type/video.rates/
But I am not sure if it can be done for user's friends and how to do it.
Can someone help me out ?
You could try below path,
me/friends?fields=video.rates
I want to let my users search(not browse) their friend on my fb app. What is the best way?
I have surveyed this issue for hours. I got two ways:
use Graph API:
https://graph.facebook.com/me/friends?access_token=...
by this way, I can get the friends of user as json, and by parsing the json, I can get the one who is the user's target.
However, there are two issues.
First, user need to input the exact name of his/her friend. For example, my app can't find "Steve Jobs" with "Steve" by parsing json.
Second, if the user has a lot of friends, the cost of parsing json may be terrible.
2.
use the searching api:
https://graph.facebook.com/search?q=mark&type=user
by this way, user can get "Steve Jobs" with "steve". However, it is obvious that users may find someone who is not their friend.
I think neither of these ways are ideal enough. Any suggestion?
Thank you sincerely!
How about this: Request dialogs
https://developers.facebook.com/docs/reference/dialogs/requests/
--
For Search Partially, may use indexOf function to check whether this string is match