How to extract Last.FM user’s LOVED tracks to a new Spotify playlist

last.fmspotify-playlist

Is there a way to export all loved tracks from my LastFM user account into a new playlist on Spotify?

I found three non-satisfying online tools:

  • Spotibot is useless for my over 700 loved tracks.
  • LastFM-to-CSV includes unloved scrobble-d tracks.
  • lastexplort.py is not a WebApp.
  • The below suggested JavaScript Spreadsheet imports maximum 1000 loved tracks. This limitation doesn't allow me to import the oldest tracks from my lastfm tracklist.

The less favorised method is to edit the exported CSV scrobbles tracklist with a spreadsheet application, and then upload it to the WebApp called Playlist Converter. But, as I mentioned, this CSV list now contains all automatically scrobbled tracks – which mostly are not my loved tracks from LastFM.

Best Answer

So heres the solution - navigate to this page and create yourself an API key for free: https://www.last.fm/api/account/create

Then go to this sheet I made you - https://docs.google.com/spreadsheets/d/11n8fgt2Q9lo2w6VKylSg2uwyxsQ_GXzDw1OWAVl83Ms/edit#gid=0

The underlying magic is simply that I added the ImportJson script sourced from here https://github.com/bradjasper/ImportJSON/blob/master/ImportJSON.gs to the app script - which fetches the same api as your LastFM-to-CSV page - except it calls on the method that you actually want - which is loved tracks not recent tracks

Then paste your api key in cell F1 and put your username in cell B1 and voila - there you have a unique spreadsheet of the data.

You can then download or export as a csv which i suggest doing right away so you dont keep trying to fetch the API everytime you refresh the page.

enter image description here