Skip to content
aurbano edited this page Sep 24, 2014 · 5 revisions

The API is accesible from your browser through http://api.djs-music.com as a RESTful API.

All calls return JSON objects. It is designed to work with Backbone, although other MVC frameworks should work fine too.

Latest version: v0.1.1 - Build Status

Endpoints:

Music

This endpoint retrieves music objects. It returns a list of track objects and simplified album and artist objects as follows:

track : {
    bitrate : int,
    description: String,
    downloads: int,
    duration: int (in seconds),
    id: int,
    name: String,
    plays: int (Play count),
    rating: int (0-5),
    released: String (d M YYYY),
    size: float (in Mb),
    tags: Array(String),
    url: String (full url to mp3 file)
},
artist: {
    id: int,
    name: String,
    photo: String (full url to photo)
},
album: {
    id: int,
    name: String,
    photo: String (full url to photo)
}

It accepts the following GET parameters:

  • user: User ID, returns only tracks from that artist.
  • album: Album ID, returns only tracks from that album.
  • title: Returns tracks that contain that parameter in their title.
  • items: Set the number of items to be returned. It must be between 10 and 50.
  • page : For pagination, defaults at 0. page>0 returns the next items*page
  • orderby : Sets the order of the returned items. Possible values are: best, latest, downloads.

These parameters can be combined in any desired way.


Specific tracks

If you specify the ID as in /music/$ID you will get only one track object corresponding to that ID, along with simplified album and artist objects. The only difference with the /music endpoint is that the artist object includes a track count (tracks). There are no GET parameters on this endpoint.


Users

Warning: Not implemented. This endpoint returns lists of users...


Specific users

If you specify the ID as in /users/$ID you get only one artist object containing:

artist: {
    city: String,
    country: String,
    description: String,
    downloads: int (Total number),
    plays: int (Total number),
    id: int,
    name: String,
    photo: String (full url),
    web: String
}

There are no GET parameters for this request.


Albums

This endpoint returns a list of album objects and simplified artist objects as follows:

album: {
    description: String,
    downloads: int (total downloads),
    id: int,
    name: String,
    photo: String (full url),
    plays: int (total play count),
    tracks: int
},
artist: {
    id: int,
    name: String,
    photo: String (full url)
}

It accepts the following GET parameters:

  • user: User ID, returns only albums from that artist.
  • album: Album ID, returns only albums from that album.
  • name: Returns albums that contain that parameter in their name.
  • items: Set the number of items to be returned. It must be between 10 and 50.
  • page : For pagination, defaults at 0. page>0 returns the next items*page
  • orderby : Sets the order of the returned items. Possible values are: latest, plays, downloads.

These parameters can be combined in any desired way.


Specific albums

If you specify the ID as in /albums/$ID you will get only one album object corresponding to that ID, along with a simplified artist object. There are no GET parameters on this endpoint.

API Endpoints

Clone this wiki locally