API Announcement

  • 6
  • Announcement
  • Updated 1 month ago
We’ve made changes to our API in order to limit abuse and improve the service for everyone, in line with our API Terms of Use

While we allow API users to have access to a lot of data through the API, it has always been against our API Terms of Use for third parties to use audio, audiovisual, images or artwork. In some instances, some data may have been indirectly accessible through a small number of API calls, and so as part of the recent API clean-up, we have corrected that anomaly.

If your application is affected, please refer to our API Terms of Use to ensure your compliance.
Photo of LAST.HQ

LAST.HQ, Your Music Universe

  • 40 Posts
  • 3 Reply Likes

Posted 4 months ago

  • 6
Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
I've kind of decided that this community, needs a replacement. My JavaScript is decent, but I would need a PHP guy who could build a base api service.  This severely upset, me. I don't like being upset.
Photo of KatyLB

KatyLB, Moderator

  • 450 Posts
  • 374 Reply Likes
Speaking in a purely personal capacity and not as a moderator:

If you were to create a replacement service your two main challenges would be bandwidth (you'd have to host and serve all of those images, how would you pay for that?) and legal issues (how do you handle it when a photographer, or worse, a major photo agency sues you for using their image without permission? Many such entities are highly litigious and they'd be completely in the right, and you can't just say "sorry" and take the image down.)

The only way to do it would be to have enough bandwidth in the bag to serve the images, and maybe to only use known official press photographs or freely available images, and straight away the latter makes a lot of people lose interest because they want the prettiest photos and not just the same as what Spotify offers, plus that means a lot of overheads on approving the image uploads (you'd need a system similar to RateYourMusic).

A service providing high-resolution artist images would be really good. However, it needs a backer that doesn't mind losing money on it, and a degree of risk regarding the possibility of legal challenges. You'd have to decide if you're willing to do that.

Again, this is a personal reply, not speaking as a moderator or representative of Last.fm and this post shouldn't be construed as such.
(Edited)
Photo of lennie

lennie

  • 145 Posts
  • 134 Reply Likes
These are indeed valid points, thanks for the inputs.
Regarding the legal challenges, I wonder how last.fm handles these requests at the moment. This can change in the near future (at least in Europe) due to the new copyright laws, but so far I think last.fm basically forced the user to upload only pictures where he has the full rights to do so:

You must only upload images that you have created yourself or that you are expressly authorised or licensed to upload. By clicking "Upload image", you are confirming that the image fully complies with Last.fm's Terms of Use and that you own all rights in the image or have authorisation to upload it.
I guess by doing so last.fm/CBS was able to protect itself at least until now against any lawsuits, but of course I don't know for sure.

Photo of Donnie

Donnie

  • 2 Posts
  • 3 Reply Likes
I think to make api for my service on php. And provide access to a small number of users. That there was no big load. If there are many who want to, then it will be necessary to rent a server. I have a good database and images. But I have little free time. 

Is this a good idea?
Photo of Paul Webster

Paul Webster

  • 18 Posts
  • 3 Reply Likes
Terrible way to do this.
"some data may have been indirectly accessible through a small number of API calls"
It is clearly shown in artist.getInfo
For example - from last.fm own documentation

<artist>
  <name>Cher</name>
  <mbid>bfcc6d75-a6a5-4bc6-8282-47aec8531818</mbid>
  <url>http://www.last.fm/music/Cher</url>
  <image size="small">http://userserve-ak.last.fm/serve/50/285717.jpg</image>
  <image size="medium">http://userserve-ak.last.fm/serve/85/285717.jpg</image> 
  <image size="large">http://userserve-ak.last.fm/serve/160/285717.jpg</image>
The page where that is shown has not been updated to show that image links are now always pointing to a "star" image and should be discarded.
https://www.last.fm/api/show/artist.getInfo

A real shame as many of the artists that we play are not household names and the images of them were uploaded by fans or the artists themselves.
Photo of Gabriel Calin

Gabriel Calin

  • 7 Posts
  • 9 Reply Likes
This has always been in the API, so at least don't say that it has always been against your terms of use. 

Do you have any particular reason to prevent us accessing the photos? Spotify API exposes images, for example. Or maybe you simply lack the bandwith to feed images to all your API users?

For my application, the image is just a nice to have feature but still, you don't break an API when you don't have to. Plus all the players and apps where images are really important.

Photo of He's dead, Jim!

He's dead, Jim!

  • 1592 Posts
  • 402 Reply Likes
Spotify is in a different legal situation since their photos are supplied by artists/labels, but on Last.fm they come from the users.
Photo of Сергей Фрилансер

Сергей Фрилансер

  • 1 Post
  • 0 Reply Likes
Open access to the pictures! It is possible and on a paid basis if the issue is in the load on the channel.
Photo of Ken MacFarlane

Ken MacFarlane

  • 5 Posts
  • 0 Reply Likes
user.getArtistTracks appears to be broken--any query I send, regardless of user name and/or artist, returns total=0 and empty list for tracks.  Confirmed it's not an authentication issue, because user.getRecentTracks works correctly.
Photo of John Doe

John Doe

  • 1 Post
  • 0 Reply Likes
Hello! Could you fix this API call, please?
https://www.last.fm/ru/api/show/user.getartisttracks

Seems that now it always returns empty data.
Photo of Mohdish

Mohdish

  • 5 Posts
  • 0 Reply Likes
Hi,
Does anyone know of a PHP work around for this to any service where I can get artist image?
Thanks
Stephen
Photo of Patrick

Patrick

  • 1299 Posts
  • 930 Reply Likes
I'm seeing these stars on an official Last.FM desktop client. Is this normal?
(Edited)
Photo of KatyLB

KatyLB, Moderator

  • 452 Posts
  • 375 Reply Likes
Which version of the desktop client is this on?
Photo of RFF Radio

RFF Radio

  • 11 Posts
  • 9 Reply Likes
It's the copyright law, gone out of control...
Photo of Patrick

Patrick

  • 1299 Posts
  • 930 Reply Likes
KatyLB, I'm using Last.FM desktop client version 2.1.37 (Built on QT 4.8.3) on Windows 7 64-bit. I downloaded the application from the official site.
Photo of Joe Carroll

Joe Carroll

  • 1 Post
  • 1 Reply Like
Napster Developer has a good API with images. That's what I ended up moving my project over to use. https://developer.napster.com/developer
Photo of Mohdish

Mohdish

  • 5 Posts
  • 0 Reply Likes
Do you have example script?  I'm particalarly looking for PHP, but can work with JS too
Photo of Patrick

Patrick

  • 1299 Posts
  • 930 Reply Likes
Are there any updates? Now images on the official desktop application are not showing whatsoever.

Photo of Jon

Jon, Community & Customer Services

  • 4770 Posts
  • 3570 Reply Likes
It's a different issue to changes announced

Please reference the new conversation here: Images broken in the desktop app
Photo of Giulio Molinario

Giulio Molinario

  • 99 Posts
  • 35 Reply Likes
I think it's related to API. I don't get any info on what i am scrobbling in the app (on the website it seems working though). Here's an example, valid for any artist: 
Photo of Giulio Molinario

Giulio Molinario

  • 99 Posts
  • 35 Reply Likes
Seems to improving better: Now i see almost anything, including images, tags, bios and correct stats, with some exceptions (sometimes it shows the correct stats, sometimes not), but most seems to be ok. Hope it lasts

An example of current glitches: 
Photo of Hugo

Hugo

  • 57 Posts
  • 15 Reply Likes
This reply was created from a merged topic originally titled artist.getinfo images are blank stars.

The images returned by artist.getInfo are white stars on a grey background, not artist images.

https://www.last.fm/api/show/artist.getInfo

For example:

https://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Cher&api_key=YOUR_API_KEY&format=json

Returns:

{"artist": {"name": "Cher","mbid": "bfcc6d75-a6a5-4bc6-8282-47aec8531818","url": "https://www.last.fm/music/Cher","image": [{"#text": "https://lastfm-img2.akamaized.net/i/u/34s/2a96cbd8b46e442fc41c2b86b821562f.png","size": "small"},{"#text": "https://lastfm-img2.akamaized.net/i/u/64s/2a96cbd8b46e442fc41c2b86b821562f.png","size": "medium"},{"#text": "https://lastfm-img2.akamaized.net/i/u/174s/2a96cbd8b46e442fc41c2b86b821562f.png","size": "large"},{"#text": "https://lastfm-img2.akamaized.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png","size": "extralarge"},{"#text": "https://lastfm-img2.akamaized.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png","size": "mega"},{"#text": "https://lastfm-img2.akamaized.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png","size": ""}], ...

The images (eg. https://lastfm-img2.akamaized.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png) are like this:





Another demo, see the background of https://hugovk.github.io/now-playing-radiator/#bbc6music

Please can you check it?

Thank you!

Photo of Paul Webster

Paul Webster

  • 17 Posts
  • 3 Reply Likes
New policy from last.fm - see the announcement at the start of this thread.
Photo of Hugo

Hugo

  • 57 Posts
  • 15 Reply Likes
While we allow API users to have access to a lot of data through the API, it has always been against our API Terms of Use for third parties to use audio, audiovisual, images or artwork. 

Looks like that was added/clarified in 2014:


API Terms of Service, 2014-03-04:

5.1.8
You will not use the Last.fm Data in any way or on any website that is associated or promotes, encourages, facilitates or condones the illegal or unauthorised use or sharing of audio and/or audiovisual content;

API Terms of Service, 2014-07-19:

5.1.8
You will not use the Last.fm Data in any way or on any website that is associated or promotes, encourages, facilitates or condones the illegal or unauthorised use or sharing of content. You will not use any audio, audiovisual, images and/or artwork, whether or not accessible through the API, and all such content is expressly excluded from this Agreement;


Photo of Paul Webster

Paul Webster

  • 18 Posts
  • 3 Reply Likes
Well done for digging that out. I don't remember an announcement about that significant change to the wording. I have changed code to get new images from Discogs.
Photo of Annabel Spaargaren

Annabel Spaargaren

  • 13 Posts
  • 15 Reply Likes
Thank for breaking my application without warning. Is this going to happen to album images too or are those safe?
Photo of Paul Webster

Paul Webster

  • 18 Posts
  • 3 Reply Likes
How about now changing it again to not return any image at all?
This /should/ be handled by applications since it was not mandatory that an image would be present.
This would stop the "star" image being spread around the place.
Photo of Aaron Hudspeth

Aaron Hudspeth

  • 6 Posts
  • 9 Reply Likes
So has anyone found a reliable workaround for this?
@lastfm staff: I would legitimately be willing to pay for access to those artist images. It's killing my website.
Photo of BlastFM Limited

BlastFM Limited

  • 5 Posts
  • 3 Reply Likes
I have found a workaround, it's called make your own, I have built an image system with API and had my players re-coded to use my image system. Although it seemed like an impossible task, it is working really well. It's not the first time services have been cut/restored around here and it is always better to have a system that you control yourself and nobody else can turn off any time they feel like it. I don't see a future for people like that, what need do we have for their precious services now.
Photo of omega1

omega1

  • 3 Posts
  • 10 Reply Likes
Same here, written our own solution, considered it years ago due to this same concern, wish we had done so at the time... Have a good API system working now so all is good...
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
Depends on how your implementing the search. Give me a URL and I'll take a look.
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
not suited already, not all finds

Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
I'm busy till this weekend but I'll post you a function to replace all of your artist images
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
Okay, I'll wait

Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
Are you wanting to replace all the images on your page or just implement a search?
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
just implement a search


Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
There is a library for that on github.

https://github.com/dmelo/lastfm-autocomplete
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
albums only

Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
can be type instead artist, photo album of

Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
This isn't really the place for basic programming help. I had assumed you had a search in place and merely needed to change over a function call. You're looking for basic programming help. The link I sent you contains complete instructions. If you have basic programming requests you need to use the stack overflow forum.
Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
I have an api from last.fm ,but the output of artists is not working

Photo of тест тест

тест тест

  • 9 Posts
  • 0 Reply Likes
error) && !empty($biograph)): ?>

artist->bio->content)) { $bio = str_replace('Read more', '', preg_replace("!(?artist->bio->content))); // обреаем до 700 символов echo trunc($bio, 283, '...'); } ?>

Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
Yes that is what the function I posted does. It replaced the missing image.
Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
Your site is in php, I don't do php that much.
Photo of lawrencenull

lawrencenull

  • 27 Posts
  • 26 Reply Likes
You need to ask on stack overflow
Photo of castilh0s

castilh0s

  • 2 Posts
  • 1 Reply Like
Hi, since the Last.fm API doesn't retrieving artist images anymore, I developed, for myself, an little service to get this images, if anyone has interest in the service, I will like to share with you.
(Edited)