Dynamic Last.fm “now playing / last played” card as SVG for your GitHub profile README.
Album art is embedded as base64 inside the SVG so it renders correctly on GitHub (external image URLs inside SVG are blocked in <img> tags).
- Create a Last.fm API account and copy your API key.
- Deploy to Vercel (import this repo).
- Framework preset: Other
- Build command: leave empty (or use repo
vercel.json) - Output directory: public (set automatically via
vercel.json)
- Add environment variable:
LASTFM_API_KEY= your key. - Embed in your profile README (replace domain and username):
cp .env.example .env.local # add LASTFM_API_KEY
npm install
npx vercel devOpen: http://localhost:3000/api/now-playing?user=YOUR_LASTFM_USER
| Parameter | Description | Default |
|---|---|---|
user |
Last.fm username (required) | — |
theme |
dark, light, or midnight |
dark |
width |
Card width in px (300–800) | 440 |
show_album |
Show album line (true / false) |
true |
cover |
Art shape: square, cd, or vinyl |
cd |
spin |
Rotation: playing (when live), always, never |
playing |
spin_speed |
Seconds per rotation (3–30) | 5 (cd), 8 (vinyl) |
bg, border, text, muted, accent |
Custom hex colors (no #) |
theme |
Alias: cover_style = cover, spin_duration = spin_speed. For spin, true/false map to playing/never.
<!-- Spinning vinyl, always rotates -->

<!-- CD cover, static when not listening -->

<!-- Classic square art, no disc -->

<!-- Light theme, wider card -->
user.getRecentTracks(limit 1) — current track or most recent scrobble.- Optional
track.getInfowhen artwork is missing or a placeholder. - Album image is fetched server-side and inlined as a data URI in the SVG.
- Response is cached for 5 minutes (
Cache-Control).