{"id":532,"date":"2008-11-12T22:20:08","date_gmt":"2008-11-12T22:20:08","guid":{"rendered":"http:\/\/west-penwith.org.uk\/blog\/?p=532"},"modified":"2014-04-11T18:27:58","modified_gmt":"2014-04-11T17:27:58","slug":"lastfm-api","status":"publish","type":"post","link":"https:\/\/west-penwith.org.uk\/blog\/archives\/532","title":{"rendered":"Last.fm API"},"content":{"rendered":"<p>Having tried some calls to the <a href=\"http:\/\/www.last.fm\/api\">Last.fm API<\/a>, I am wondering if some of the calls are flawed or if there is something wrong with my account.<\/p>\n<p>You access the data using the address <code>http:\/\/ws.audioscrobbler.com\/2.0\/?<\/code> and supplying certain parameters separated by <code>&amp;<\/code>.<\/p>\n<p>Two are required with all calls&#8230;<br \/>\n<code>method=&lt;the data table you want&gt;<\/code><br \/>\n<code>api_key=&lt;a hex key which you sign up for&gt;<\/code><br \/>\nand other parameters for the data table requested.<\/p>\n<p>I am looking at the method <code>user.getTopAlbums<\/code> which requires&#8230;<br \/>\n<code>user=&lt;username&gt;<\/code><br \/>\n<code>period=&lt;overall|3month|6month|12month&gt;<\/code><\/p>\n<p>This seems to work fine for <code>period=overall<\/code> returning a list of albums in descending order of number of tracks played but if I use, say, <code>period=3month<\/code> then I get a very short list of albums with a playcount of just 1. The same happens for the other periods and also <code>user.getTopArtists<\/code>.<\/p>\n<p>I have only been signed up for a few weeks so I would have expected to get the same list&mdash;or is it that it doesn&#8217;t like so little data? Update: looking at the results carefully, I think it has got stuck at the first tracks I listened to on the system when I was trying it out. Could it be some sort of cache stuck somewhere? It can&#8217;t be on my system as it does the same from wherever I look.<\/p>\n<p>What I would really like is <code>user.getRecentAlbums<\/code> but that one doesn&#8217;t exist. If I use <code>user.getRecentTracks<\/code> then, because we play whole albums at a time, the list gets flooded with tracks from the same album. You can probably see the effect towards the bottom of the sidebar, unless I have found a way to fix it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having tried some calls to the Last.fm API, I am wondering if some of the calls are flawed or if there is something wrong with my account. You access the data using the address http:\/\/ws.audioscrobbler.com\/2.0\/? and supplying certain parameters separated by &amp;. Two are required with all calls&#8230; method=&lt;the data table you want&gt; api_key=&lt;a hex [&hellip;]<\/p>\n","protected":false},"author":239,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,5],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-hi-fi","category-technical"],"_links":{"self":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/users\/239"}],"replies":[{"embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":3,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":1757,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions\/1757"}],"wp:attachment":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}