jamendo.get2 : Home | Crash course | Useful queries | Formats | Parameters | Fields | Orders | Joins
jamendo.get2 performs the equivalent of a SQL "SELECT" query on our database. You can loosely translate this SQL query :
SELECT name,url FROM albums WHERE id=116 ("Give me the name and the url of the album which id is 116")as a call to jamendo.get2 :
As you can see, the location of a jamendo.get2 query is :
http://api.jamendo.com/get2/ [list of fields] / [unit] / [return format] /?[urlencoded parameters]
That's it, you know enough to start experimenting yourself with these references :
Formats | Parameters | Fields | Orders | Joins | Useful queries
Let's continue this crash course anyway!
We can reuse your first query and change the fields to "image" :
Now you have the URL of the cover of the album 116. The default size of images is 100x100, you can change it with the imagesize parameter :
(Check the Parameter Reference for more parameters)
Now, JSON is fine but we can return the URL directly as plaintext if we change the format to plain :
Even better, we can be redirected via HTTP to the image URL with the redirect format :
The internal name of this api is "Musiclist2". It highlights the fact that this API always returns lists of items.
As a consequence, you can fetch the cover URLs of several albums at once:
Please note that if you query only one field, each list item won't be a key/value hash table but a simple string value :
By default, jamendo.get2 won't return more than 20 items.
You can change it with n=42 or n=all.
Be careful, jamendo.get2 calls are memory-limited, so most of the time, n=all is a bad idea because your query will fail randomly. Please check our DatabaseDumps if you want to fetch all our database at once, or use pagination.
The pn parameter provides pagination, starting from 1 :
By default, jamendo.get2 results are unordered.
There are a lot of order options available from our Order Reference.
You can get the 10 most popular albums this month with the order=ratingmonth_desc parameter :
Thank you for following this crash course, you should now be able to dig into the possibilities of this API quite easily. Feel free to contact us if we left some things unclear!