Monday, March 3, 2014

The 5 insides of Spotify open API

 
    There are so many streaming music services in the planet, we can even hear the new one in a month. Old music brand like Pandora, iTunes, Grooveshark, Jango. The new ones are like Spotify, Beats music. We can't count the specific number of streaming music services, but we can observe the insides of being a music service that can success penetrate everyone's life.

    I take an example of Spotify cause Spotify does well on open API to spread the users base, to let third party make apps for Spotify, achieve the win-win situation.
Let's try to take a look of 5 insides of Spotify open API.

1. Spotify widget, button of playing songs.

a. Right click of the song, select "Copy Spotify URI" 

b. paste the URI the you got in the code below.

<iframe src="https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>

Then, you'll get this, finished!


2. Spotify widget, button of follow artist.

a. right click of the artist, select "Copy Spotify URI".

b. paste the Spotify URI the you got in the code below.

<iframe src="https://embed.spotify.com/follow/1/?uri=spotify:artist:1vCWHaC5f2uS3yhpwWbIA6&size=detail&theme=light" width="300" height="56" scrolling="no" frameborder="0" style="border:none; overflow:hidden;" allowtransparency="true"></iframe>

Again, you finished another, great uhh.



1 and 2 are for everyone who doesn't even know the coding skill, just post the html on the website, then it works. But, the next stuff I want to introduce is for developer.

3. Libspotify SDK

    Build your own mobile app through Libspotify SDK. Download it, unpack it, add the library into header file (API.h), there are 3 examples code in the file.
Choose the platform that you want to develop in: https://developer.spotify.com/technologies/libspotify/

4. Metadata API - lookup

    Service base URL: http://ws.spotify.com/lookup/1/

Parameters: uri (A Spotify URI, required), extras (A comma to separate the detail level expected in the response)


It has 3 kinds of response, Basic response, album, albumdetail.

5. Metadata API - Search

    Service base URL: http://ws.spotify.com/search/1/album
Parameters: q (search string encoded in UTF-8; required), page (the page of the result set to return; defaults to 1)

There are 100 results of data in a page. So you can check the results by pages.
You can search 3 kinds of information such as artist, album, track.

    Now, you don't need to build a fresh, new music service but can achieve the goal that deliver, share, discover music through open api provided by streaming music giant, Spotify.
    What I realize is all here, enjoy it. make your own app, web application soon. Never wait until breathe stops.

No comments:

Post a Comment