
How to Enable Last.fm Scrobbling Natively in AzuraCast (The Permanent & Correct Way)
The official AzuraCast documentation provides the raw Liquidsoap code block and notes that the platform supports native Last.fm scrobbling right before add_skip_command(radio). However, it doesn’t elaborate on the specific UI layout, where to bypass global security restrictions, or how to safely initialize the backend processing.
If you attempt to add this by directly editing your station’s liquidsoap.liq file via terminal, it will be completely wiped out and reset whenever your station restarts or updates. This is because AzuraCast treats that file as temporary generated output, not the source of truth.
To set up Last.fm scrobbling so that it permanently survives updates and restarts, you must use AzuraCast’s native configuration engine. Here is the exact, clean sequence to do it.
Step 1: Enable Advanced Features Globally
By default, AzuraCast restricts individual stations from entering custom raw code blocks for system stability. You must lift this restriction at the administrator level first.
- Log into your AzuraCast Web UI as a global administrator.
- Navigate to Administration -> System Settings -> Settings.
- Check the box for Enable Advanced Features.
- Click Save Changes at the bottom of the page.
Step 2: Add the Last.fm Code via the Station UI
With advanced features turned on, a dedicated configuration panel is unlocked on your individual station dashboard.
- Open your specific Station Dashboard.
- In the left sidebar menu, expand the Broadcasting section and click on Edit Liquidsoap Configuration.
- Scroll down to the custom configuration area (the “third text box” referenced in documentation discussions) right before
add_skip_command(radio). - Paste the standard Liquidsoap scrobbler block into that box:
settings.audioscrobbler.api_key := "YOUR_LAST_FM_API_KEY"
settings.audioscrobbler.api_secret := "YOUR_LAST_FM_API_SECRET"
radio = audioscrobbler.submit(
username="YOUR_LAST_FM_USERNAME",
password="YOUR_LAST_FM_PASSWORD",
force=true,
metadata_preprocessor=(fun(m) -> if m["jingle_mode"] == "true" then [] else m end),
radio
)Code language: JavaScript (javascript)
Be sure to replace the placeholders with your actual Last.fm API account credentials, username, and password.
- Click Save Changes at the bottom of the page.
Step 3: Apply the Changes
Saving the form updates AzuraCast’s station configuration, but it does not instantly update your live stream.
- Click Restart Broadcasting, or use the equivalent CLI Restart All Radio Stations action, to apply the new config.
Note: Running this restart action will temporarily disconnect active listeners.
Verification & Notes
- Safe Read-Only Verification: To verify your changes compiled successfully, navigate to the station Logs page / Log Viewer. AzuraCast exposes the generated Liquidsoap config under the Utilities tab, while standard station logs reside under the Logs tab. Never edit this file by hand, as it is auto-generated and completely overwritten on restart.
- Scrobbling Behavior: You can confirm scrobbling is active by monitoring your Last.fm profile activity in real-time. While a track is playing, it will show as “Scrobbling now” on your profile. When the track finishes, it becomes permanently scrobbled. As per Liquidsoap processing logic, jingles are explicitly skipped, and tracks completely missing an Artist or a Title will not be scrobbled.
