Download the PHP package calliostro/last-fm-client-bundle without Composer
On this page you can find all versions of the php package calliostro/last-fm-client-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download calliostro/last-fm-client-bundle
More information about calliostro/last-fm-client-bundle
Files in calliostro/last-fm-client-bundle
Package last-fm-client-bundle
Short Description Ultra-lightweight Symfony bundle for the Last.fm API — music scrobbling, data & integration made easy
License MIT
Homepage https://github.com/calliostro/lastfm-bundle
Informations about the package last-fm-client-bundle
⚡ Last.fm Client Bundle for Symfony – Complete Music Scrobbling & Data Access
🚀 SYMFONY INTEGRATION! Seamless autowiring for the complete Last.fm music API. Zero bloat, maximum performance.
Symfony bundle that integrates the modern calliostro/lastfm-client into your Symfony application. Built with modern PHP 8.1+ features, dependency injection, and powered by Guzzle.
📦 Installation
Install via Composer:
⚙️ Configuration
Configure the bundle in config/packages/calliostro_lastfm.yaml:
API Key: You need to create an API account at Last.fm to get your API key. This is required for all operations.
API Secret: Required for authenticated write operations like scrobbling, loving tracks, or updating now playing status. Used together with API Key to generate signatures for authenticated requests.
Session Key: Required for user-specific authenticated operations like scrobbling tracks, loving tracks, updating now playing status, or accessing user's personal data. Obtain this through Last.fm's authentication flow or use a pre-generated session key.
User-Agent: By default, the client uses LastfmClient/2.0.0 (+https://github.com/calliostro/lastfm-client) as User-Agent. You can override this in the configuration if needed.
🚀 Quick Start
Basic Usage
Scrobbling and User Data
Music Discovery
✨ Key Features
- Ultra-Lightweight – Minimal Symfony integration with zero bloat for the ultra-lightweight Last.fm client
- Complete API Coverage – All Last.fm API endpoints supported (Album, Artist, Auth, Chart, Geo, Library, Tag, Track, User)
- Direct API Calls –
$client->getArtistInfo(artist: 'name')maps to/2.0/?method=artist.getinfo, no abstractions - Type Safe + IDE Support – Full PHP 8.1+ types, PHPStan Level 8, method autocomplete
- Symfony Native – Seamless autowiring with Symfony 6.4, 7.x & 8.x
- Well Tested – Comprehensive test coverage, Symfony coding standards
- Flexible Auth – API Key for read operations, API Key + Secret + Session Key for user operations (scrobbling, etc.)
🎵 All Last.fm API Methods as Direct Calls
- Album Methods – getAlbumInfo(), addAlbumTags(), getAlbumTags(), getAlbumTopTags(), removeAlbumTag(), searchAlbums()
- Artist Methods – getArtistInfo(), getArtistCorrection(), getArtistSimilar(), getArtistTags(), getArtistTopAlbums(), getArtistTopTags(), getArtistTopTracks(), addArtistTags(), removeArtistTag(), searchArtists()
- Auth Methods – getMobileSession(), getSession(), getToken()
- Chart Methods – getTopArtists(), getTopTags(), getTopTracks()
- Geo Methods – getTopArtists(), getTopTracks()
- Library Methods – getArtists()
- Tag Methods – getInfo(), getSimilar(), getTopAlbums(), getTopArtists(), getTopTracks(), getWeeklyChartList()
- Track Methods – getTrackInfo(), getTrackCorrection(), getTrackSimilar(), getTrackTags(), getTrackTopTags(), addTrackTags(), loveTrack(), removeTrackTag(), scrobbleTrack(), unloveTrack(), updateNowPlaying(), searchTracks()
- User Methods – getUserInfo(), getUserFriends(), getUserLovedTracks(), getUserPersonalTags(), getUserRecentTracks(), getUserTopAlbums(), getUserTopArtists(), getUserTopTags(), getUserTopTracks(), getUserWeeklyAlbumChart(), getUserWeeklyArtistChart(), getUserWeeklyChartList(), getUserWeeklyTrackChart()
All Last.fm API endpoints are supported with clean documentation — see Last.fm API Documentation for complete method reference
📋 Requirements
- php ^8.1
- symfony ^6.4 | ^7.0 | ^8.0
- calliostro/lastfm-client ^2.0
🔧 Service Integration
⚡ Rate Limiting (Optional)
For high-volume applications, use the powerful symfony/rate-limiter component:
1. Configure Rate Limiter
2. Configure Bundle
Choose your rate limit based on your usage:
- Standard access: Use 5/sec (as shown above) for all API operations
- High-volume applications: Consider reducing to 3-4/sec for safety margin
The bundle uses a Guzzle middleware that automatically handles rate limiting by:
- Intercepting outgoing requests before they're sent
- Checking rate limit availability using Symfony's RateLimiter
- Automatically waiting when limits are exceeded (using microsecond precision)
- Retrying requests after the appropriate delay
This seamless integration ensures your application never exceeds API limits without requiring any code changes. Higher rates may result in HTTP 429 responses if rate limiting is not configured.
🤝 Contributing
Contributions are welcome! Please see DEVELOPMENT.md for detailed setup instructions, testing guide, and development workflow.
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
🙏 Acknowledgments
- Last.fm for providing the excellent music scrobbling and data API
- Symfony for the robust framework and DI container
- calliostro/lastfm-client for the modern client library
⭐ Star this repo if you find it useful! It helps others discover this lightweight solution.
All versions of last-fm-client-bundle with dependencies
calliostro/lastfm-client Version ^2.0
symfony/config Version ^6.4|^7.0|^8.0
symfony/dependency-injection Version ^6.4|^7.0|^8.0
symfony/http-kernel Version ^6.4|^7.0|^8.0