Data collections
You will find there the caracteristics of each data collection.
There are two different types of data collections :
- The collections 'artist', 'album', 'song' ; they accept queries and return structured information. To query these collections, you must add your API key.
- The data collection 'file'; this collection returns audio files and does not require your API Key.
The output fields returned for each query done on the artist data collection are :
- name : The artist name (string)
- albumnum : The number of albums on LazyTune (integer)
- songnum : The number of songs on LazyTune (integer)
- id : The artist id (LazyTune ArtistID)
- permalink : A permanent link to this artist
The following fields can be optionnaly added :
| search | String | Type 1 | mbid, pict | Searches for an artist name |
| name | String | Type 1 | mbid, pict | Looks for an artist, that exactly matches the given string and returns a single record. |
| mbid | MusicBrainz ArtistID | Type 1 | pict | Looks for an artist that is identified by the given MusicBrainz ArtistID and returns a single record. |
| id | LazyTune ArtistID | Type 1 | mbid, pict | Looks for an artist that is identified by the given LazyTune ArtistID and returns a single record. |
For instance, if you want to find every artist that contains the name "pete" and get the results in
XML, you will use :
http://api.lazytune.com/1.0/artist/search/pete.xml?key=APIKEY
Or, if you want to get the artist whose MusicBrainz ID is "65314b12-0e08-43fa-ba33-baaa7b874c15", and get the result in
JSON, you will use :
http://api.lazytune.com/1.0/artist/mbid/65314b12-0e08-43fa-ba33-baaa7b874c15.json?key=APIKEY
The output fields returned for each query done on the album data collection are :
- name : The album name (string)
- songnum : The number of songs on LazyTune (numeric)
- id : The album id (LazyTune AlbumID)
- permalink : A permanent link to this album
-
artist
The following fields can be optionnaly added :
| search | String | Type 1 | mbid, pict, asin | Searches for an album name |
| name | String | Type 1 | mbid, pict, asin | Looks for an album, that exactly matches the given string and returns a single record. |
| artist | LazyTune ArtistID | Type 1 | mbid, pict, asin | Returns all the albums of the given artist identified by its LazyTune ArtistID. |
| mbid | MusicBrainz ReleaseID | Type 1 | pict, asin | Looks for an album that is identified by the given MusicBrainz ReleaseID and returns a single record. |
| asin | ASIN | Type 1 | mbid, pict | Looks for an album that is identified by the given Amazon Standard Identification Number (ASIN) and returns a single record. |
| id | LazyTune AlbumID | Type 1 | mbid, pict, asin | Looks for an album that is identified by the given LazyTune AlbumID and returns a single record. |
For instance, if you want to find every album released by the artist whose
LazyTune ArtistID is "8qGVGo" and get the results in
XML, you will use :
http://api.lazytune.com/1.0/album/artist/8qGVGo.xml?key=APIKEY
Or, if you want to get the albums that contains the word "black", and get the result in Serialized PHP, you will use :
http://api.lazytune.com/1.0/album/search/black.php?key=APIKEY
The output fields returned for each query done on the song data collection are :
- title : The song title (string)
- duration : The track duration in seconds (numeric)
- tracknum : The track number in the album (numeric)
- permalink : A permanent link to this album
- file : A link to an audio file associated with this song
- id : The song id (LazyTune SongID)
-
artist
-
album
The following fields can be optionnaly added :
- mbid : MusicBrainz TrackID
- maxbr : The maximum bitrate of its associated files (numeric, in kbps)
- filenum : The number of associated files of any format (numeric)
- ytnum : The number of associated YouTube files (numeric)
- uptime : The uptime mean of the associated files (float, in percent)
| search | String | Type 1 | mbid, maxbr, filenum, uptime | Searches for a track name using title, artist and album strings. |
| title | String | Type 1 | mbid, maxbr, filenum, uptime | Looks for a track using album title exclusively. |
| artist | LazyTune ArtistID | Type 1 | mbid, maxbr, filenum, uptime | Returns all the songs of the given artist identified by its LazyTune ArtistID. |
| album | LazyTune AlbumID | Type 1 | mbid, maxbr, filenum, uptime | Returns all the songs of the given album identified by its LazyTune AlbumID. |
| mbid | MusicBrainz TrackID | Type 1 | maxbr, filenum, uptime | Looks for a track that is identified by the given MusicBrainz TrackID and returns a single record. |
| id | LazyTune SongID | Type 1 | mbid, maxbr, filenum, uptime | Looks for a song that is identified by the given LazyTune SongID and returns a single record. |
For instance, if you want to find every song of the album whose AlbumID is "8qGVGo" and get the results in
XML, you will use :
http://api.lazytune.com/1.0/song/album/8qGVGo.xml?key=APIKEY
Or, if you want to get the songs that contains the word "yesterday", and get the result in
YAML, you will use :
http://api.lazytune.com/1.0/song/search/yesterday.yaml?key=APIKEY
This data collection differs from the other collections in two big points :
- You don't have to add your API key to the queries
- You will no get structured information but a HTTP redirection to a file of one of our supported file formats, an XML error might be returned if an error occurs.
The power of the LazyTune Search Engine comes from the
ability to associate several files to the same song, so that if a file is no more available, you can access another associated file, or if a song has no more associated files, you may access it later if the LazyTune Engine associates a new file.
We also do daily availability checks, to allow the
best Quality Of Service.
Indeed, each query done on the file data collection, redirects to the right file using a
HTTP code 302, so that you can directly use this URL in a client-side application that supports HTTP redirections (a flash player for example).
Here are the supported formats :
The options help you to choose the file that will suit your needs, you can choose the file with the lowest bitrate if you don't want to waste too much bandwidth using the option
lowbr, or choose the file with the best frequency using the option
hifreq for example. If you want to get the file with the best uptime you can use the option
uptime.
By default, the file with the
highest uptime is returned.
For instance, if you want to get redirected to a mp3 file associated to the song whose
LazyTune SongID is "8qGVGo", just use :
http://api.lazytune.com/1.0/file/song/8qGVGo.mp3
Or, if you want to get a file from the same song but with the lowest bitrate :
http://api.lazytune.com/1.0/song/song/8qGVGo.mp3?options=lowbr
You may also want to get redirected to a YouTube API video associated to the song whose
LazyTune SongID is "qzSTN6", just use :
http://api.lazytune.com/1.0/file/song/qzSTN6.yt
If you want to use advanced
YouTube player parameters you can pass your own arguments through our API.
For example if you would like to have a customized YouTube player you can use :
http://api.lazytune.com/1.0/file/song/qzSTN6.yt?options=api&color1=0x2b405b&color2=0x6b8ab6
Or if you plan to use the
YouTube JavaScript API you will build an url like :
http://api.lazytune.com/1.0/file/song/qzSTN6.yt?options=api&enablejsapi=1
You will find
here a complete description of the YouTube API.