Skip to main content

Lastfm

@magistr/lastfmv2026.08.19.1· 3d agoMODELSREPORTS
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/lastfmprofile (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.

02Models1
@magistr/lastfmv2026.08.19.1extensions/models/lastfm.ts
fn profile()
Fetch the user's profile: playcount, artist/album/track counts,

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
03Reports1
@magistr/lastfm-statsmodel
extensions/reports/lastfm_stats.ts

Listening statistics derived from the synced scrobble history:

musiclastfmlisteningstatistics
04Previous Versions1
2026.07.27.1

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

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

05Stats
A
100 / 100
Downloads
0
Archive size
31.4 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
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels