Verbinden Sie sich mit Ihrem Facebook-Profil

jamendo.get2 : Home | Crash course | Useful queries | Formats | Parameters | Fields | Orders | Joins

Available formats

Name Description Sample output
json http://www.json.org/ [{"id":33,"name":"Simple Exercice"},{"id":46,"name":"Compilation classique"}] (query)
jsonpretty Whitespaced JSON Same as above with whitespace (query)
jsoncallback same with a callback jsonCallback(42,[{"id":33,"name":"Simple Exercice"},{"id":46,"name":"Compilation classique"}]); (query)
plain Plain text 33 Simple Exercice (query)
xml XML file <?xml version="1.0" encoding="UTF-8"?><data><album><name>Simple Exercice</name><id>33</id></album></data> (query)
rawxml XML substring <data><album><name>Simple Exercice</name><id>33</id></album></data> (query)
redirect HTTP redirect query
m3u M3U playlist query
xspf XSPF playlist ( http://xspf.org/ ) query
xls Excel file N/A

Format details and parameters

json

This is the recommended format. It is both efficient and well-supported in most programming languages.

You can find details and libraries here: http://json.org/

The returned value is always a list, even if there is only one item.

jsonpretty

Same as json but with a nicely formatted output so that you can test your queries easily.

Please use this formatter only for debugging purposes.

jsoncallback

Similar to JSONP : return data as JSON wrapped in a function call.

It is useful if you want to include a jamendo.get2 call as javascript include, or as an argument to eval().

There are two parameters : jsoncallbackfunction and jsoncallbackid. You can use the later to re-order query results on the client side after several AJAX calls.

Without jsoncallbackid : http://api.jamendo.com/get2/id+name/album/jsoncallback/?id=33+46&jsoncallbackfunction=jsonCallback

With jsoncallbackid : http://api.jamendo.com/get2/id+name/album/jsoncallback/?id=33+46&jsoncallbackfunction=MyClass.jsonCallback&jsoncallbackid=42

plain

This format is suited to very simple queries. Rows are separated by a \n linebreak. In each row, fields are separated by a \t tab.

Complex data structures and values containing linebreaks or tabs will break this format, please use JSON in these cases.

xml

This format is a simple and standard-complient format to retrieve any data. It's easy to parse with a lot of softwares and programming languages.

rawxml

Same as above, but without the XML header. Also, mime-type is text/plain. Can be used for debug or for inclusion in another XML file.

redirect

This is a special format that will redirect you to the first URL returned by the query.

For instance, it is useful for album covers. If you want to display the cover of the album with id=116, you can get its URL in plaintext with:

http://api.jamendo.com/get2/image/album/plain/?id=116&imagesize=200

But in most cases, you will just send a redirecting URL to the client :

http://api.jamendo.com/get2/image/album/redirect/?id=116&imagesize=200

m3u

This format is suitable for outputing a playlist that clients can directly open with their desktop audio player.

xls

MS Excel spreadsheet. For data export purposes only, very basic support of the format.

xspf

While not widely adopted yet, this is a promising and extensible playlist format that contains more data than a simple M3U playlist.

http://xspf.org/