Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Last Fm Client Bundle

Last Fm Client Bundle Laravel Package

calliostro/last-fm-client-bundle

Symfony bundle that integrates the modern calliostro/lastfm-client with autowiring and Guzzle. Configure your API key, secret, session key, user agent, and optional rate limiter to access Last.fm music data and scrobbling.

View on GitHub
Deep Wiki
Context7

Lightweight Symfony bundle for the Last.fm API with autowiring, scrobbling, resilience, and rate limiting support.

Frequently asked questions about Last Fm Client Bundle
What is calliostro/last-fm-client-bundle used for?
It is a lightweight Symfony bundle that integrates the calliostro/lastfm-client with autowiring and Guzzle so you can read Last.fm music data and scrobble plays. It adds bundle configuration for api_key, api_secret, session_key, user_agent and an optional rate limiter. Version 2.1.0 also exposes auto_retry and max_retries for built-in retry handling.
How do I install the Last.fm client bundle with Composer?
Run composer require calliostro/lastfm-bundle, which is the install command documented in the README for the repository published as calliostro/last-fm-client-bundle. Symfony Flex registers the bundle automatically; otherwise enable it in bundles.php. Then create config/packages/calliostro_lastfm.yaml with at least your api_key.
Can I use this Symfony Last.fm bundle in a Laravel application?
It is built and tested as a Symfony bundle, not a Laravel package, so there is no service provider or Laravel-specific config out of the box. Laravel's container supports autowiring and type-hinted constructor injection much like Symfony, but you will need to bind the underlying client manually and mirror the calliostro_lastfm settings into something like config/lastfm.php. Treat it as an integration task rather than a drop-in install if your app is Laravel-first.
Which PHP and Laravel versions does the bundle support?
The bundle requires PHP 8.1 or newer and uses modern language features such as enums and named arguments. Its CI exercises PHP 8.1 through 8.6. Because there is no Laravel version constraint, Laravel compatibility depends on your PHP version, and Laravel 9 or 10+ on PHP 8.1+ is the realistic baseline.
How do I configure the Last.fm API key, secret and session key?
Configure the calliostro_lastfm key in YAML with api_key and api_secret, ideally via environment variables such as LASTFM_API_KEY and LASTFM_SECRET. The optional session_key is required for authenticated operations like scrobbling and can come from the Last.fm OAuth flow or a pre-generated key. You can also set user_agent and an optional rate_limiter service.
How does the bundle handle Last.fm rate limits and 429 or 503 errors?
Since calliostro/lastfm-client 2.1, the client retries Last.fm rate limit responses (429) and server overload (503) internally. Two config keys control this: auto_retry, which defaults to true, and max_retries, which defaults to 3. You can additionally wire symfony/rate-limiter by pointing the rate_limiter option at your RateLimiterFactory service.
How do I scrobble tracks to Last.fm with this bundle?
Scrobbling requires an authenticated session key in addition to the API key and secret, so complete the Last.fm auth flow or supply a stored session key first. Once configured, inject the client through the container and call its scrobble methods; the underlying client handles request signing. Note that scrobble writes are rate limited, so keep retries enabled or tune max_retries for your traffic.
Should I keep my own retry middleware if the client already retries?
Pick one retry owner: the built-in client retry is the simpler default, so disable or remove application or middleware-level retries for Last.fm calls. Running both layers can compound backoff and multiply load on Last.fm during outages. If you must keep middleware retries, set auto_retry to false instead.
Is the package production ready and actively maintained?
The project ships CI, Codecov coverage reporting, PHPStan level 8 analysis and Symfony code style checks, and version 2.1.0 is a minor, non-breaking release over 2.0.0. That said, review the release notes and pin versions in composer.lock before relying on it in production. Running staging tests against real Last.fm credentials is worthwhile because rate limit behavior depends on your traffic.
What changed in v2.1.0 and is upgrading from v1.x breaking?
Version 2.1.0 upgraded to calliostro/lastfm-client 2.1 and added auto_retry and max_retries, and it is non-breaking relative to 2.0.0. Breaking changes are scoped to migrations from v1.x, mainly the dependency swap to the new client plus namespace and configuration key updates. The repository's UPGRADE.md is the checklist to follow.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc