A simple Python script that pulls recent tracks and top tracks from any public Last.fm user profile and outputs the data in a nicely formatted Markdown table.
You get:
- ✅ Terminal output
- 📄 Markdown file saved locally
- Python 3.6+
- A Last.fm API key (free): Get it here
pip install requestspython main.py https://www.last.fm/user/your_usernamepython main.py https://www.last.fm/user/dean_fx📄 This will:
- Print recent & top tracks to the terminal
- Save a file like:
dean_fx_lastfm_stats.md
Edit the script and replace the API_KEY variable at the top:
API_KEY = "YOUR_API_KEY_HERE"- 📥 Fetches up to hundreds of recent and top tracks (via paginated API calls)
- 💾 Saves Markdown output to file in current directory
- 💬 Displays output in terminal for easy copy/paste
- 🔓 Works with any public Last.fm user — no auth required
## Recent Tracks for **dean_fx**
| Track | Artist | Time |
| --- | --- | --- |
| Hypnotize | Psycho Boys Club | 30 Apr 5:08pm |
...
## Top Tracks for **dean_fx** (All Time)
| Track | Artist | Plays |
| --- | --- | --- |
| One More Time | Daft Punk | 132 |
...Made with 🎧 by Dean Amiridis
MIT