PHPackages                             calliostro/last-fm-client-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. calliostro/last-fm-client-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

calliostro/last-fm-client-bundle
================================

Ultra-lightweight Symfony bundle for the Last.fm API — music scrobbling, data &amp; integration made easy

v2.0.0(7mo ago)1391↑81.3%MITPHPPHP ^8.1CI passing

Since Apr 18Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/calliostro/last-fm-client-bundle)[ Packagist](https://packagist.org/packages/calliostro/last-fm-client-bundle)[ Docs](https://github.com/calliostro/lastfm-bundle)[ RSS](/packages/calliostro-last-fm-client-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (9)Versions (12)Used By (0)

⚡ Last.fm Client Bundle for Symfony – Complete Music Scrobbling &amp; Data Access
=================================================================================

[](#-lastfm-client-bundle-for-symfony--complete-music-scrobbling--data-access)

[![Package Version](https://camo.githubusercontent.com/f228d4ff5410f2ce9fea21e9c2eae85dcd95fcc7d7d8f3f9b6d4fde5e5ad7f3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c6c696f7374726f2f6c6173742d666d2d636c69656e742d62756e646c652e737667)](https://packagist.org/packages/calliostro/last-fm-client-bundle)[![Total Downloads](https://camo.githubusercontent.com/64a92e2296f9fa7170ac1c47c0ef6c5678b51c60790785dcad2561835a56c082/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c6c696f7374726f2f6c6173742d666d2d636c69656e742d62756e646c652e737667)](https://packagist.org/packages/calliostro/last-fm-client-bundle)[![License](https://camo.githubusercontent.com/835cb8080ce73f813b37990235da720bc4c4f35b6eccc53306517409ad548117/68747470733a2f2f706f7365722e707567782e6f72672f63616c6c696f7374726f2f6c6173742d666d2d636c69656e742d62756e646c652f6c6963656e7365)](https://packagist.org/packages/calliostro/last-fm-client-bundle)[![PHP Version](https://camo.githubusercontent.com/acffb6ae1962992d26e4466782832787e79504a6250f80d732c4283458b9f497/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75652e737667)](https://php.net)[![CI](https://github.com/calliostro/last-fm-client-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/calliostro/last-fm-client-bundle/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/a4eb37441e76964e8049e36ef542c39329a1ca726fd169c758d5d85670aed821/68747470733a2f2f636f6465636f762e696f2f67682f63616c6c696f7374726f2f6c6173742d666d2d636c69656e742d62756e646c652f67726170682f62616467652e7376673f746f6b656e3d33415445465946374130)](https://codecov.io/gh/calliostro/last-fm-client-bundle)[![PHPStan Level](https://camo.githubusercontent.com/d117944b58da8146f96b4ef7403807610a20eeb3fbcaaaf95157bbcdad1686eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e737667)](https://phpstan.org/)[![Code Style](https://camo.githubusercontent.com/d6e83f920d0c54ea87386b08cd4a24b7e078588bb3ba9fd0782684be1b1037b1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d53796d666f6e792d627269676874677265656e2e737667)](https://github.com/FriendsOfPHP/PHP-CS-Fixer)

> **🚀 SYMFONY INTEGRATION!** Seamless autowiring for the complete Last.fm music API. Zero bloat, maximum performance.

Symfony bundle that integrates the **modern** [calliostro/lastfm-client](https://github.com/calliostro/lastfm-client) into your Symfony application. Built with modern PHP 8.1+ features, dependency injection, and powered by Guzzle.

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require calliostro/lastfm-bundle
```

⚙️ Configuration
----------------

[](#️-configuration)

Configure the bundle in `config/packages/calliostro_lastfm.yaml`:

```
calliostro_lastfm:
    # Required: API Key for all practical operations (get from https://www.last.fm/api/account/create)
    api_key: '%env(LASTFM_API_KEY)%'

    # Required for authenticated operations: API Secret
    api_secret: '%env(LASTFM_SECRET)%'

    # Optional: Session key for scrobbling and user operations
    # Get this via Last.fm OAuth flow or use a pre-generated session key
    # session_key: '%env(LASTFM_SESSION_KEY)%'

    # Optional: HTTP User-Agent header for API requests
    # user_agent: 'MyApp/1.0 +https://myapp.com'

    # Optional: Professional rate limiting (requires symfony/rate-limiter)
    # rate_limiter: lastfm_api       # Your configured RateLimiterFactory service
```

**API Key:** You need to [create an API account](https://www.last.fm/api/account/create) 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](https://www.last.fm/api/authentication) 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
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
