How to get only playable songs in US? - facebook

I'm working on a spotify app with facebook api.
I have the following query.
me/music.listens?limit=5&util=1 week ago
or
[friend id]/music.listens?limit=5&util=1 week ago
when i get tracks from the above api, I get songs that're not playable in US. Is there a parameter or a way to get songs that are playable in US only?

No, you can retrieve a list of what the user listened to in any of the music apps, but unless you have some other agreement with the providers of the music (e.g. spotify, rdio) there's no way to know if some other user can listen to the same songs.
edit: based on iKenndac's answer, it seems there's a Spotify API to determine playability by region, but you can't get the info from Facebook's API

You can use the Spotify Web APIs to look up territory availability.

Related

Is it possible to use Apple Music's MusicKit SDK to play user's own station?

I'm trying to allow user's to play user's own station in my app. But after some research, I couldn't figure out whether it's achievable.
As shown below, I want this particular station which Apple Music generated for the user. Does anyone know if Apple make this API public?
You can use the recommendation API, which provides the user's personal station.
https://api.music.apple.com/v1/me/recommendations
More about it here - https://developer.apple.com/documentation/applemusicapi/get_default_recommendations

facebook score api deprecated

It just happened today; I am just trying to use facebook for game score leaderboard. sadly
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes/
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes/#games-4-4
It says:
Games API
Updated:
Changed Instant Games context.getPlayersAsync() to only include players who have played a game in the specified context (e.g. a Messenger thread or Facebook Group).
Deprecated:
A number of Games APIs around scores and achievements. We are also removing the invitable friends API for Facebook web games, which allows an app to invite people who haven't played the game before. App requests for existing players of a game will continue to function normally.
Is there an alternative way to post and obtain a user's game score?
The goal would be to replace this with Leader Boards.
You can store information about the score itself.
For example, you could store the new Avg score as the value and then how many games were played to get that average. This means that you can then update the Average correctly when you get an update. You can also create leaderboard from the API, giving you the ability to create a leaderboard per match.
To explain better I would have to have some kind of context for your game that you have and I attach below a very simple link to theleaderboard example put together by Facebook.
https://developers.facebook.com/docs/games/instant-games/guides/using-leaderboards/
Your focus would be on the other data about the score. That is what you want to look at. You will want to look into storing an array or JSON formatted information there.

Get list of Offline/Saved Videos through YouTube API

I need some help to get list of videos which is downloaded(or taken offline) by a user.
Does YouTube Rest API provide us any API to get list of saved video?
AFAIK, you will not be able to list offline videos from other users, even your own offline videos. This stack exchange post discussed the reason.
Those "offline" videos can only be played using official YouTube App,
and those videos simply can not be played using any other Video/Media
player application.
YouTube (means Google) controls the access to the offline file.
The permission is controlled on their server to access those
downloaded files and Since they are part of specific device, you
cannot access/view those using Google Account, from another device.
But if you want to list videos in youtube api, you can refer to this documentation.

Searching spotify user's music library for particular genre

I am developing third party app on spotify platform. In that, user have to select spotify user's music library playlist (top 100 songs by Spotify user). So, I am trying to search spotify library for particular genre.
I am using SPSearch with Query genre:pop. But for some generics like "rock" it return nil.
I am using latest build of cocoalibspotify. Please can somebody tell how to get Spotify user track list or playlist for particular genre?
The full advanced search documentation can be found here.
Note that this will search the entire Spotify catalog, not just the user's own library. There's currently no built-in way to only search the user's library at this time.

Is any way to get information about what video my friends are watching now on facebook?

We're developing an application which needs to get videos which my friends are watching now. Is there any way to do it?
There's an API for accessing built-in actions but it's not available at present - you can start developing against the APIs at https://developers.facebook.com/docs/beta/ now - but your app won't be able to obtain the necessary permissions except for the test users