On what basis music apps categories the trending songs? - spotify

I am designing a music web app.
In that, I want to display the trending songs
Are there any criteria to display the trending songs as Spotify or Gaana does?

Are you using the Spotify Web API? What language are your coding in? You should add more info/code samples so people aren't guessing.
There isn't an API endpoint to specifically 'get the top tracks on Spotify'.
But...you could use the ID of their Top 50 playlist and pull in the tracks from that: https://open.spotify.com/playlist/37i9dQZEVXbMDoHDwVN2tF
The Id is 37i9dQZEVXbMDoHDwVN2tF so,
GET https://api.spotify.com/v1/playlists/37i9dQZEVXbMDoHDwVN2tF
source: https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist/

Related

Getting Spotify-generated artist playlists using Web API

When Siri is asked "play music by ARTIST_NAME on Spotify" she starts playing music from a playlist that is generated by Spotify, with no displayed name, and the description "ARTIST_NAME songs picked just for you". I cannot find a way to find this playlist. Its name, according to the https://api.spotify.com/v1/me/player endpoint, is ARTIST_NAME, and its owner is Spotify. How can I find this playlist for a given artist using the Web API?
Ultimately, I am trying to work around the fact that if there is no available device (i.e. Spotify is idle or closed) an artist cannot be played by setting a context-uri in the https://api.spotify.com/v1/me/player/play endpoint. To work around this issue in the case of playing a playlist that the user of my program searches for, I have simply opened the URL of the first track in the album or playlist. This doesn't work in the case of artists, since the list of top tracks by an artists gives the tracks' URLs in the context of the respective tracks's album.
If there is no way to access this Siri exclusive playlist, I would appreciate feedback suggesting alternate routes. It is not sufficient to simply create a playlist, since they would be static and have to be recreated for each request.
Thank you.

Can I get how many "likes" by a specific user using Instagram API?

I am developing an app that tracks the users day and id like to tell the user how many hours he/she spends on Instagram and how many pictures has he / she liked on her profile? Is this possible to get from the Instagram API?
You can use this API:
https://api.instagram.com/v1/users/self/media/liked?access_token=ACCESS-TOKEN
This will return list of media liked by a user, you can keep track of media_id's and count how many liked every day, going forward.
Not sure how you plan to get data of how many hours spent on Instagram, there is no API

Is it possible to generate a playlist from two users liked music or playlists, through Spotify or Apple Music?

I am trying to generate a playlist from two users different playlists. I know you can get a public playlist from a Spotify users id, hopefully their most played,but i am not sure if you can combine it with another user's playlist?
Sure. First read both of the users Spotify playlists. You'll have to use the iTunes Search API to find the respective track on iTunes and it's product ID. You can then use the music API's added in 9.3+ to make a playlist and add the product ID's for the songs in the two playlists.

How to grab user track info through spotify api

I recently just got through the beginning tutorial for creating a web app with the spotify api. https://developer.spotify.com/web-api/tutorial/. The tutorial was great for showing how to authenticate a user with oauth and log in a user.
The problem I am having is with the endpoint. I can't seem to figure out how to change the endpoint so that instead of displaying a users profile, I can see a list of a users track, better yet starred or top 10 tracks.
for a 10,000 view perspective of what I want to build is a app that would allow users to easily log in through their spotify account, take their stared or top tracks and push them to a radio that I am building with an raspberry pi.
I am new to working with the spotify api and working with api's in general so whatever advice would be awesome.
At the moment, there is no way to get the "starred"-playlist. (At least it's not documented)
I don't know what you mean with "Top 10 User tracks", since this doesn't exist as far as I know
To get a list of the account's current playlists, change the URL to:
https://api.spotify.com/v1/users/{user_id}/playlists
With this URL, you will get a list of simple-playlist-objects wrapped inside a paging-object. Now you can select one of the playlists (or loop through them) and fetch its track this way
NOTE:
If you also want to fetch private playlists, make sure you use the scope playlist_read_private

Spotify vs Last FM, display last played track

I was looking for a way to display my last played Spotify track on my website. I succeeded using the Last.FM API. Spotify doesn't have an open API and the music part of Facebook seems to be locked down too. So I now scrobble everything to last.fm and use their API to get the last played song. This works fine, but I thought it would be fun to display a "play now" button to play the track on spotify.
To do that, I need the Spotify ID for the particular song, which the last.fm api doesn't seem to return.
So... two questions:
1) is there a way to get the same info from Spotify itself?
2) if not, is there a good way to get the matching spotify song using the Last.FM details?
1) No. Spotify doesn't have a play history API. However, you can use Facebook's listens endpoint if the user is publishing listens to Facebook.
2) Not directly, as far as I'm aware. However, a quick Google turns up this project. Failing that, you can use the Spotify Web Search API to search for a track matching the metadata. The Advanced Search Syntax may come in handy here.

Resources