PHPackages                             core23/lastfm-api - 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. [API Development](/categories/api)
4. /
5. core23/lastfm-api

Abandoned → [nucleos/lastfm](/?search=nucleos%2Flastfm)Library[API Development](/categories/api)

core23/lastfm-api
=================

Last.fm webservice client for php.

3.8.0(5mo ago)182.8k↓100%6[1 issues](https://github.com/nucleos/lastfm/issues)[10 PRs](https://github.com/nucleos/lastfm/pulls)MITPHPPHP ^8.3CI passing

Since Jan 5Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/nucleos/lastfm)[ Packagist](https://packagist.org/packages/core23/lastfm-api)[ Docs](https://nucleos.rocks)[ GitHub Sponsors](https://github.com/sponsors/core23)[ Fund](https://ko-fi.com/core23)[ RSS](/packages/core23-lastfm-api/feed)WikiDiscussions 3.2.x Synced 2mo ago

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

Last.fm PHP library
===================

[](#lastfm-php-library)

[![Latest Stable Version](https://camo.githubusercontent.com/80ed2597efe47d2f18c0ddc65cc3236c85a40d2c11f00344edcc3f87d9fbf939/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f762f737461626c65)](https://packagist.org/packages/nucleos/lastfm)[![Latest Unstable Version](https://camo.githubusercontent.com/675dd827175a18c13f019bf80d6ad9a7e725ac548c6f634d1c45d1c5259b0a0d/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f762f756e737461626c65)](https://packagist.org/packages/nucleos/lastfm)[![License](https://camo.githubusercontent.com/007c6780dcad3687a2de87770d63dfa963af698da544fae1dbb75e88b28d368f/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f6c6963656e7365)](LICENSE.md)

[![Total Downloads](https://camo.githubusercontent.com/70217d21a695153cc5f40b6a86f794e9d9603af49cac37f7d025210390394fe8/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f646f776e6c6f616473)](https://packagist.org/packages/nucleos/lastfm)[![Monthly Downloads](https://camo.githubusercontent.com/211581e2f227609655be7371224fa45e68c2c663da5f1be23e7c24fe3603edfd/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f642f6d6f6e74686c79)](https://packagist.org/packages/nucleos/lastfm)[![Daily Downloads](https://camo.githubusercontent.com/230ff6f87bbe68ca5f9ab2b6b525f47b949febe84fc4eb993bdfe19325942ea2/68747470733a2f2f706f7365722e707567782e6f72672f6e75636c656f732f6c617374666d2f642f6461696c79)](https://packagist.org/packages/nucleos/lastfm)

[![Continuous Integration](https://github.com/nucleos/lastfm/workflows/Continuous%20Integration/badge.svg?event=push)](https://github.com/nucleos/lastfm/actions?query=workflow%3A%22Continuous+Integration%22+event%3Apush)[![Code Coverage](https://camo.githubusercontent.com/335f8b5a084ed7a5c9e236b568254eec5887cb621eb8ca70faedbae664ea6337/68747470733a2f2f636f6465636f762e696f2f67682f6e75636c656f732f6c617374666d2f67726170682f62616467652e737667)](https://codecov.io/gh/nucleos/lastfm)[![Type Coverage](https://camo.githubusercontent.com/fd3a823f3ab69d584a645a070c9fc7ce39eb4bb74febe18c67e020a7637f1b73/68747470733a2f2f73686570686572642e6465762f6769746875622f6e75636c656f732f6c617374666d2f636f7665726167652e737667)](https://shepherd.dev/github/nucleos/lastfm)

This library provides a wrapper for using the [Last.fm API](http://www.last.fm/api) inside PHP.

Installation
------------

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:

```
composer require nucleos/lastfm
# To define a default http client and message factory
composer require symfony/http-client nyholm/psr7

```

Usage
-----

[](#usage)

```
// Create connection
use Nucleos\LastFm\Service\AuthService;
use Nucleos\LastFm\Service\ChartService;
use Nucleos\LastFm\Service\PsrClientConnection;

$connection = new PsrClientConnection($httpClient, $requestFactory);

// Auth user to get a token
// http://www.last.fm/api/auth/?api_key=API_KEY

// Create a session (with generated token)
$token = 'API token';
$authApi = new AuthService($connection);
$session = $authApi->createSession($token);

$chartApi = new ChartService($connection);
$tags = $chartApi->getTopTags(10);
```

Limitations
-----------

[](#limitations)

Last.fm removed some of their favorite APIs due their relaunch in March 2016. Some of the following removed methods are available via a webcrawler. Please have a look at the `Nucleos\LastFm\Crawler` package.

```
    Album
        album.getBuylinks
        album.getShouts
        album.share
    Artist
        artist.getEvents
        artist.getPastEvents
        artist.getPodcast
        artist.getShouts
        artist.getTopFans
        artist.share
        artist.shout
    Chart
        chart.getHypedArtists
        chart.getHypedTracks
        chart.getLovedTracks
    Event
        event.attend
        event.getAttendees
        event.getInfo
        event.getShouts
        event.share
        event.shout
    Geo
        geo.getEvents
        geo.getMetroArtistChart
        geo.getMetroHypeArtistChart
        geo.getMetroHypeTrackChart
        geo.getMetroTrackChart
        geo.getMetroUniqueArtistChart
        geo.getMetroUniqueTrackChart
        geo.getMetroWeeklyChartlist
        geo.getMetros
    Group
        group.getHype
        group.getMembers
        group.getWeeklyAlbumChart
        group.getWeeklyArtistChart
        group.getWeeklyChartList
        group.getWeeklyTrackChart
    Library
        library.addAlbum
        library.addArtist
        library.addTrack
        library.getAlbums
        library.getTracks
        library.removeAlbum
        library.removeArtist
        library.removeScrobble
        library.removeTrack
    Playlist
        playlist.addTrack
        playlist.create
    Radio
        radio.getPlaylist
        radio.search
        radio.tune
    Tag
        tag.getWeeklyArtistChart
        tag.search
    Tasteometer
        tasteometer.compare
        tasteometer.compareGroup
    Track
        track.ban
        track.getBuylinks
        track.getFingerprintMetadata
        track.getShouts
        track.getTopFans
        track.share
        track.unban
    User
        user.getArtistTracks
        user.getBannedTracks
        user.getEvents
        user.getNeighbours
        user.getNewReleases
        user.getPastEvents
        user.getPlaylists
        user.getRecentStations
        user.getRecommendedArtists
        user.getRecommendedEvents
        user.getShouts
        user.shout
        user.signUp
        user.terms
    Venue
        venue.getEvents
        venue.getPastEvents
        venue.search

```

License
-------

[](#license)

This library is under the [MIT license](LICENSE.md).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance76

Regular maintenance activity

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Recently: every ~12 days

Total

30

Last Release

167d ago

Major Versions

0.6.0 → 1.0.02019-03-23

1.0.0 → 2.0.02019-09-28

2.1.0 → 3.0.02020-06-28

PHP version history (7 changes)0.1.0PHP ^7.0

0.3.0PHP ^7.1

0.6.0PHP ^7.2

3.1.0PHP ^7.3 || ^8.0

3.2.0PHP ^8.0

3.5.0PHP ^8.1

3.7.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/46179d0f1a863a1a71c634a413d857f8428ad9a8273cd065ba4f0e864730dde9?d=identicon)[core23](/maintainers/core23)

---

Top Contributors

[![core23](https://avatars.githubusercontent.com/u/3440437?v=4)](https://github.com/core23 "core23 (359 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (233 commits)")[![nucleos-bot](https://avatars.githubusercontent.com/u/60489587?v=4)](https://github.com/nucleos-bot "nucleos-bot (222 commits)")[![kodiakhq[bot]](https://avatars.githubusercontent.com/in/29196?v=4)](https://github.com/kodiakhq[bot] "kodiakhq[bot] (43 commits)")[![jstowey](https://avatars.githubusercontent.com/u/5090149?v=4)](https://github.com/jstowey "jstowey (1 commits)")

---

Tags

apicrawlerhacktoberfestlastfmlibraryphpspiderwebservice-clientapicrawlerspiderlast.fmwebservice client

### Embed Badge

![Health badge](/badges/core23-lastfm-api/health.svg)

```
[![Health](https://phpackages.com/badges/core23-lastfm-api/health.svg)](https://phpackages.com/packages/core23-lastfm-api)
```

###  Alternatives

[nucleos/lastfm

Last.fm webservice client for php.

1812.9k2](/packages/nucleos-lastfm)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
