Download the PHP package calliostro/lastfm-client without Composer
On this page you can find all versions of the php package calliostro/lastfm-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download calliostro/lastfm-client
More information about calliostro/lastfm-client
Files in calliostro/lastfm-client
Package lastfm-client
Short Description Lightweight Last.fm API client for PHP 8.1+ with modern developer comfort — Clean parameter API and minimal dependencies
License MIT
Homepage https://github.com/calliostro/lastfm-client
Informations about the package lastfm-client
⚡ Last.fm API Client for PHP 8.1+ – Lightweight with Maximum Developer Comfort
🚀 MINIMAL YET POWERFUL! Focused, lightweight Last.fm API client — as compact as possible while maintaining modern PHP comfort and clean APIs.
📦 Installation
Do You Need to Register?
For ALL API calls: Registration required
- Register your application at Last.fm to get credentials
- API Key needed for: ALL methods (artist info, search, charts, etc.)
For write operations: Session authentication required
- Session Key needed for: scrobbling, loving tracks, personal collections, tagging
🚀 Quick Start
Read-only data (API key required for all methods):
Search with API credentials:
Your scrobbles (session authentication):
Multi-user apps (mobile auth):
✨ Key Features
- Simple Setup – Works immediately with an API key, easy authentication for advanced features
- Complete API Coverage – All 55+ Last.fm API endpoints supported
- Clean Parameter API – Natural method calls:
getArtistInfo('Billie Eilish')with named parameter support - Lightweight Focus – Minimal codebase with only essential dependencies
- Modern PHP Comfort – Full IDE support, type safety, PHPStan Level 8 without bloat
- Secure Authentication – Full session and mobile authentication support
- Well Tested – 100% test coverage, PSR-12 compliant
- Future-Ready – PHP 8.1–8.5 compatible (beta/dev testing)
- Pure Guzzle – Modern HTTP client, no custom transport layers
🎵 All Last.fm API Methods as Direct Calls
- Album Methods – getAlbumInfo(), searchAlbums(), getAlbumTopTags(), addAlbumTags(), removeAlbumTag(), getAlbumTags()
- Artist Methods – getArtistInfo(), getArtistTopTracks(), getSimilarArtists(), searchArtists(), getArtistTopAlbums(), getArtistCorrection(), addArtistTags(), removeArtistTag(), getArtistTags(), getArtistTopTags()
- Track Methods – getTrackInfo(), searchTracks(), getSimilarTracks(), scrobbleTrack(), updateNowPlaying(), loveTrack(), unloveTrack(), getTrackCorrection(), addTrackTags(), removeTrackTag(), getTrackTags(), getTrackTopTags()
- User Methods – getUserInfo(), getUserRecentTracks(), getUserLovedTracks(), getUserTopArtists(), getUserTopTracks(), getUserTopAlbums(), getUserFriends(), getUserArtistTracks(), getUserPersonalTags(), getUserTopTags()
- Chart Methods – getTopArtistsChart(), getTopTracksChart(), getTopTagsChart()
- Geography Methods – getTopArtistsByCountry(), getTopTracksByCountry()
- Tag Methods – getTagInfo(), getSimilarTags(), getTagTopArtists(), getTagTopTracks(), getTagTopAlbums(), getTopTags(), getTagWeeklyChartList()
- Authentication Methods – getToken(), getSession(), getMobileSession()
- Library Methods – getLibraryArtists()
- User Charts – getUserWeeklyArtistChart(), getUserWeeklyAlbumChart(), getUserWeeklyTrackChart(), getUserWeeklyChartList()
All Last.fm API endpoints are supported with clean documentation — see Last.fm API Documentation for complete method reference
💡 Note: Some endpoints require authentication (scrobbling, user libraries) or specific permissions.
📋 Requirements
- php ^8.1
- guzzlehttp/guzzle ^6.5 || ^7.0
⚙️ Configuration
Configuration
Simple (works out of the box):
Advanced (middleware, custom options, etc.):
💡 Note: By default, the client uses
LastFmClient/2.0.0 +https://github.com/calliostro/lastfm-clientas User-Agent. You can override this by setting custom headers as shown above.
🔐 Authentication
Get credentials at Last.fm API Registration.
Quick Reference
| What you want to do | Method | What you need |
|---|---|---|
| Get artist/track/chart info | createWithApiKey() |
API key + secret |
| Search the database | createWithApiKey() |
API key + secret |
| Scrobble tracks | createWithSession() |
API key + secret + session |
| Access user collections | createWithSession() |
API key + secret + session |
| Mobile app | createWithMobileAuth() |
API key + secret + user/pass |
Complete Session Flow Example
Step 1: authorize.php – Redirect user to Last.fm
Step 2: callback.php – Handle Last.fm callback
🤝 Contributing
Contributions are welcome! See DEVELOPMENT.md for detailed setup instructions, testing guide, and development workflow.
📄 License
MIT License – see LICENSE file.
🙏 Acknowledgments
- Last.fm for providing the excellent music data and scrobbling API
- Guzzle for the robust HTTP client
- The PHP community for continuous inspiration
⭐ Star this repo if you find it useful!