Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 132 commits ahead of eartle:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


liblastfm is a collection of libraries to help you integrate services into your rich desktop software. It is officially supported software developed by staff.

Michael Coffey

Fork it:

Join us for chats on IRC!

Server: Channel: #last.desktop


liblastfm requires:

Additionally, to build it you will need:

  • cmake

Mac OS X

We recommend that you use Homebrew to install dependancies

In order to install QT 5 run:

brew install qt

In order to install QT 4.8 run:

brew install cartr/qt4/qt@4
brew install cartr/qt4/qt-webkit@2.3

Don't forget to turn on the BUILD_WITH_QT4 option in CMakeLists.txt

And for other dependencies:

brew install cmake
brew install fftw
brew install libsamplerate


Do something like this:

sudo apt-get install qt4-qmake pkg-config g++ libqt4-dev cmake libfftw-dev libsamplerate0-dev

Please note, we have only tested on Linux, but we think it'll work on all varieties of UNIX. If it doesn't, report the bug to eartle on GitHub.


Install Visual Studio 2008 or higher. Install Qt. Install the Windows Server 2003 Platform SDK r2:

Set up your environment variables so all include paths and tools are available.

Open a plain Windows shell, and see the next section.

Installing liblastfm

mkdir _build && cd _build
cmake ..
make -j4
sudo make install

Using liblastfm

We have copied the API at onto C++, so like you find artist.getInfo there you will find an lastfm::Artist::getInfo function in our C++ API. lastfm is a namespace, Artist a class and getInfo a function.

Thus the API is quite easy to learn. We suggest installing and checking the include/lastfm/* directory to find out all capabilities.

The demos directory shows some further basic usage including Audioscrobbling and getting metadata for music via our fingerprinting technology.

You need an API key from to use the webservice API.

Your link line needs to include the following:

-llastfm -lQtCore -lQtNetwork -lQtXml


Please set an identifiable UserAgent on your HTTP requests for the actual MP3s, in extreme cases we'll contact you directly and demand you do so :P

HTTP & Networking

You can specify your own QNetworkAccessManager derived class for liblastfm to use with lastfm::setNetworkAccessManager(). Our default is pretty good though, auto-determining proxy settings on Windows and OS X for instance.


Public Headers

  1. Header guards should be prefixed with LASTFM, eg. LASTFM_WS_REPLY_H
  2. #includes should be to the system path eg. #include <lastfm/Scrobbler.h>
  3. Don't make a header public unless it is absolutely required!
  4. All headers under src/ (not subfolders) are public by default


A Qt C++ library for the webservices







No packages published


  • C++ 94.5%
  • CMake 2.8%
  • C 2.2%
  • Objective-C 0.5%