# Last.fm Tags

This statement allows you to extract various lists of tags from Last.fm. The results are always returned to a specified track variable as a list delimited by the default list delimiter (\~). Returned lists are ordered by most popular first. Note that not all tags may be returned. In fact at most the top fifty tags are returned for any of these functions.

Last.fm tags are not genres. Many of the tags might be genres but the tags can also contain years, decades, artist names, feelings, opinions and some are only decipherable by the people who set the tags.

The following functions are available:

Top Tags
  A list of the most popular tags sitewide is returned.
Album Tags
  A list of tags for a specific album is returned. You must specify the source for the Album and Artist metadata. Artist can be extracted from the Artist field, Album Artist field or a track variable. Album can be extracted from the Album field or a track variable.
Track Tags
  A list of tags for a specific track is returned. You must specify the source for the Track and Artist metadata. Artist can be extracted from the Artist field, Album Artist field or a track variable. Track can be extracted from the Title field or a track variable.
Artist Tags
  A list of tags for a specific artist is returned. You must specify the source for the Artist metadata. Artist can be extracted from the Artist field, Album Artist field or a track variable.

When the Album Artist field is specified as the source of the artist metadata and the field is empty the Artist field will be used.

When executed stepwise only one call is made for any combination of source metadata.

Note that when the result track variable is empty either there were no tags returned or something went wrong. The Network Response property will contain a non zero integer value in the case of an error. Most of the errors are somewhat esoteric but they are as follows:

> -1
>   One or more of the source fields was empty.
> -2
>   The metadata could not be escaped for a URL representation.
> -3
>   An unknown network layer error ocurred.
> -4
>   The response JSON could not be decoded
> -5
>   The metadata could not be matched. Note that the APIs do not always flag this situation. It is possible that no error is raised and no tags are returned.
> Integers in the range of 2-29
>   Error codes returned by the API. These are very unlikely.
> HTML response codes
>   Integers greater than or equal to 100. Note 200 is never set and is returned as 0.