Skip to main content

Lastfm

@magistr/lastfmv2026.10.25.10· MIT· 27d agoBEHAVIORSREPORTS
01README

Last.fm for swamp — read a user's scrobble history and listening statistics from the Last.fm 2.0 web API. Read-only: every method used here is an unauthenticated user.* / artist.* / album.* / track.* read that needs only an API key, so there is no OAuth dance and no MD5 request signing.

Model:

  • @magistr/lastfm — profile (user.getInfo), loved-tracks, artist-info / album-info / track-info, the six-period charts (top-artists, top-albums, top-tracks over overall|7day|1month|3month|6month|12month), the weekly chart range list and the three weekly charts, and sync-history — an idempotent fan-out that pages user.getRecentTracks into one scrobbles.<year> resource per calendar year.

Report:

  • @magistr/lastfm-stats — a model-scope report over the synced history that derives what the API's six fixed periods cannot: per-year, per-month, per-weekday and per-hour distributions, unique artist/album/track counts, listening streaks, and top lists over an arbitrary date window.

The API key is marked sensitive and is never persisted into a resource. It travels as a query parameter (Last.fm offers no header auth), so the base URL is pinned to HTTPS, non-https overrides are rejected, and every URL is redacted before it can reach an error message, a log line, or a fixture.

02Release Notes

2026.10.25.10

  • Repo-wide republish; no functional change.
03Behaviors1
@magistr/lastfmv2026.10.25.10extensions/models/lastfm.ts
fn profile()
Fetch the user's profile: playcount, artist/album/track counts,
fn loved-tracks()
List the tracks the user has marked as loved.
fn artist-info(artist: string)
Fetch artist detail — listeners, global playcount, the user's own
ArgumentTypeDescription
artiststringArtist name
fn album-info(artist: string, album: string)
Fetch album detail including the user's own playcount.
ArgumentTypeDescription
artiststring
albumstring
fn track-info(artist: string, track: string)
Fetch track detail including the user's own playcount.
ArgumentTypeDescription
artiststring
trackstring
fn top-artists()
Top artists over one of the six standard periods
fn top-albums()
Top albums over one of the six standard periods.
fn top-tracks()
Top tracks over one of the six standard periods.
fn weekly-chart-list()
List the from/to timestamp ranges for which weekly charts exist.
fn weekly-artist-chart(from?: number, to?: number)
Weekly artist chart for a from/to range (see weekly-chart-list).
ArgumentTypeDescription
from?number
to?number
fn weekly-album-chart(from?: number, to?: number)
Weekly album chart for a from/to range.
ArgumentTypeDescription
from?number
to?number
fn weekly-track-chart(from?: number, to?: number)
Weekly track chart for a from/to range.
ArgumentTypeDescription
from?number
to?number
fn sync-history()
Page the full scrobble history into one `scrobbles.<year>` resource

Resources

profile(infinite)— Last.fm user profile and lifetime totals
chart(infinite)— Top artists/albums/tracks for a period or weekly range
loved(infinite)— Tracks the user has loved
weekly(infinite)— Available weekly chart ranges
entity(infinite)— Artist, album, or track detail
scrobbles(infinite)— One calendar year of scrobbles (partition of the history)
history(infinite)— Sync cursor and per-year counts for the scrobble history
04Reports1
@magistr/lastfm-statsmodel
extensions/reports/lastfm_stats.ts

Listening statistics derived from the synced scrobble history:

musiclastfmlisteningstatistics
05Previous Versions14
2026.10.25.1MIT

2026.10.25.1

Changed

  • README: swamp vault put now prompts for secrets (hidden input) instead of taking them on the command line, where shell history keeps them.
2026.10.15.9MIT

2026.10.15.9

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.8MIT

2026.10.15.8

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.6MIT

2026.10.15.6

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.5MIT

2026.10.15.5

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.4MIT

2026.10.15.4

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.3MIT

2026.10.15.3

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.2MIT

2026.10.15.2

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.1MIT

2026.10.15.1

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.14.2MIT(was none)

2026.10.14.2

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.

Modified 1 behaviors

2026.09.19.2

2026.09.19.2

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.09.17.1

2026.09.17.1

Changed

  • Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.08.19.1
2026.07.27.1

Merge pull request #172 from umag/feat/lastfm-extension

feat(lastfm): add @magistr/lastfm read-only scrobble extension

06Stats
A
100 / 100
Downloads
41
Archive size
26.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
07Platforms
08Labels