Skip to content

Setting up Last.fm connection

Pauli Järvinen edited this page Dec 26, 2025 · 6 revisions

It is possible to set up the Music app to show details about artists, albums, and songs from the Last.fm service. Also scrobbling the plays to Last.fm is supported starting from Music v2.5.0. Setting this up is a two-phase process:

  1. Obtain an API key from Last.fm
  2. Insert that API key (and secret) to your config/config.php

1. Getting the API key

To get the API key, first navigate to https://www.last.fm/api/account/create. If you aren't already logged in to Last.fm, you are required to do so, or create a new account if you don't have one already. When you are logged in, the previous link should take yout to a form like this:

Last.fm API key creation form

You don't need to worry about the rest of the fields, but just enter your contact email and the application name and hit Submit. The application name given here will be visible to the users when connecting their Last.fm account for scrobbling, if you decide to enable it.

After submitting the form, you should be shown a view like this:

Last.fm has created a new API key

From here, you need at least the long string of letters and numbers after the label "API key". If you want to set up also the scrobbling, then you will need the "Shared secret", too. You can find these values also later by navigating to https://www.last.fm/api/accounts.

2. Inserting the API key to your config file

After you have the Last.fm API key, you should add it to the config file of your cloud instance. If, for example, you have installed ownCloud to /var/www/html/owncloud, the settings file can be found from /var/www/html/owncloud/config/config.php. For Nextcloud, the path is the same, just substitute owncloud with nextcloud.

Once you have the file open, you need to add a new key-value pair to the file, using the previously obtained API key. It should look something like

'music.lastfm_api_key' => 'c5bdc58a62113d1fa78fca85a712b18a',

If you want to allow the scrobbling, then in addition add the API secret like

'music.lastfm_api_secret' => 'c5bdc512ac5a367fe014553ab5365cf9',

(note: the API key and secret shown above are not actual working alternatives)

3. Enjoy

You should now be all set up. You shall find data from Last.fm by clicking the "i" icon after any artist or album name in the Albums view of the Music app. There is information available about almost any artist you can imagine and about a great number of albums, too.

Last.fm data about artists is provided also via the Subsonic API; at least the DSub client application can utilize this data.

If you enabled the scrobbling, the users will now find the button to connect their Last.fm account from the Music app Settings view under the section "Last.fm Integration".

Clone this wiki locally