API

The musicplayr.com API can be accessed at url: http://api.musicplayr.com.

To start using the API you need to register your application.
You will get APP_ID and authentication key (APP_AUTH_KEY) which will be used to verify clients application.

We use Digest Access Authentication method.

The API could be used to get:

1. user’s profile

http://api.musicplayr.com/profile/USER_NAME.FORMAT

where:

USER_NAME - name of the user which profile we want to obtain (required)
FORMAT - returned data format, we currently accept (required):
json - specifies that the response format should be JSON
js - specifies that the response format should be JSONP
xml - specifies that the response format should be XML
php - specifies that the API should return serialized php data
printr - same as php but in human-readable form

sample request (using curl):

curl —digest -u APP_ID:APP_AUTH_KEY ‘http://api.musicplayr.com/profile/luetti.json’

response:

{“subdomainname”:”luetti”,”image”:”http:\/\/images.musicplayr.com\/0011096\/_image”,
“ulocation”:”Berlin”,”bioinfo”:”No one can take away the dances,
you’ve danced… I \u2665 \u266b \u25b6”}


2. track list

http://api.musicplayr.com/tracks/USER_NAME.FORMAT?limit=VALUE&offset=VALUE&order=newest

sample request (using curl):

curl —digest -u APP_ID:APP_AUTH_KEY ‘http://api.musicplayr.com/tracks/xyz.printr?limit=2&offset=2&order=oldest’

where:
limit - amount of tracks returned (not required, default=50, max=200)
offset - tracks returned starts from offset (not required, default=0)
order - if order=newest - track list will start from last added tracks (default),
if order=oldest - from oldest ones

response:

Array
(
[0] => Array
(
[title] => COOL
[url] => http://www.youtube.com/watch?v=SeqE3LPitLY
[added_date] => 2011-09-11 11:21:38.789652
[duration] => 198
[linker_domain] => xyz
[like_count] => 0
[private_only] => no
)

[1] => Array
(
[title] => Joy Orbison NTS radio mix
[url] => http://media.soundcloud.com/stream/FXClfZShMKcE?stream_token=Uufmw
[added_date] => 2011-09-11 11:30:38.874426
[duration] => 7202
[linker_domain] => abc
[like_count] => 1
[private_only] => no
)
)


3. get timeline

Returns tracks from public playlist linked by user within given time frame

http://api.musicplayr.com/gettimeline/USER_NAME/STARTDATE/ENDDATE.FORMAT

where:
STARTDATE - starting date (format YYYY-MM-DD) - required
ENDDATE - ending date (format YYYY-MM-DD) - required


sample request (using curl):

curl —digest -u APP_ID:APP_AUTH_KEY ‘http://api.musicplayr.com/gettimeline/luetti/2011-12-01/2011-12-31.printr’

response:

Array
(
[0] => Array
(
[title] => Florian Meindl - The positive thinker (FLASH 049)
[url] => http://media.soundcloud.com/stream/znEWTRQhWyNt?stream_token=F7zrE
[added_date] => 2011-12-31 15:25:15.80993
[duration] => 439
[linker_domain] => anonymous
[like_count] => 6
[private_only] => no
)

[1] => Array
(
[title] => Florian Meindl feat. Ricardo Phillips - Desert Times (Marco Dassi Rmx) FLASH Recordings
[url] => http://media.soundcloud.com/stream/rwT9z75JXeiO?stream_token=j6rrm
[added_date] => 2011-12-31 15:17:57.132641
[duration] => 393
[linker_domain] => florianmeindl
[like_count] => 11
[private_only] => no
)

TiP.

Please increase ENDDATE by one to get current day timeline.