This space is intended for tools that make it easier to work with the API exposed by, a popular community of music lovers.

These are not official tools, but contributions by the community. The official documentation for that API can be found here.

If you have any tools that might be useful for the community, drop me a note!

XML response definitions

The API consists of some a number of web services, called though a RESTful URL, returning an XML response.

The API documentation does show an example response, but no formal definition of the response. We created XML Schema Definitions (xsd's) from some of the responses here

geo.getEvents uses some elements for the Geo positioning namespace. Normally, this is an RDF namespace, but to be able to use it in XML we also created an XSD for it:

Tools for PHP development

Matt Oakes wrote a PHP API library

Tools for .Net development

A library for .Net is also available: LastFmLib.Net

Tools for Python development

Bindings for Python can be found here

Tools for Java development

There are currently 2 active projects for Java bindings: janni kovacs' API bindings and the one in this project.

Based on the XSD's above, we generated a Java library containing:

  • Java bean classes
  • Unmarshalling (converting XML to these Java classes)
  • Calling the API, returning unmarshalled response
The first 2 features are currently implemented by leveraging Apache jaxme, an open-source JAXB implementation.

Calling the API is currently done with some special-purpose code. Preferably, however, we'd have this code generated based on a WSDL 2.0 definition, which has support for RESTful webservices. We have some initial work done, but so far the Axis2 Maven plugin is refusing to generate code based on it.


Currently, get the api lib by checking out the lastfmlib project from and doing a 'mvn package'.


A simple example project (web application) using the lib is also included in CVS. It demonstrates fetching some events for a certain location, and listing any of those events which include any of the top artists for a given user.

To give a taste, the meat of the application looks like this:

			User user = new UserImpl(apiKey);
			Geo geo = new GeoImpl(apiKey);

			List<ArtistType> artists = user.getTopArtists(demoModel.user, null);
			Set<String> topArtistNames = getNames(artists);
			for (EventType event : geo.getManyEvents(demoModel.location, null, null, null, null, 20))
				for (String artist : (List<String>) event.getArtists().getArtist())
					if (topArtistNames.contains(artist))

			info("Found " + matchingEvents.size() + " matching events out of " + events.size() + " total."); Logo Logo project page