lastfmgo

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 7 Imported by: 1

README

lastfm-go

A Go wrapper for the last.fm REST API (2.0) and modern alternative to shkh/lastfm-go. This library aims to be idomatic, simple, and powerful at the same time.

[!NOTE] While the go.mod file contains a number of dependencies for testing and examples, the core library itself has no external dependencies.

Installation

go get -u github.com/p-mng/lastfm-go

Usage

Please refer to the provided examples for common use cases (e.g., authentication, scrobbling, and integration with other libraries).

Supported API endpoints

album
  • album.addTags
  • album.getInfo
  • album.getTags
  • album.getTopTags
  • album.removeTag
  • album.search
artist
  • artist.addTags
  • artist.getCorrection
  • artist.getInfo
  • artist.getSimilar
  • artist.getTags
  • artist.getTopAlbums
  • artist.getTopTags
  • artist.getTopTracks
  • artist.removeTag
  • artist.search
auth
  • auth.getMobileSession
  • auth.getSession
  • auth.getToken
chart
  • chart.getTopArtists
  • chart.getTopTags
  • chart.getTopTracks
geo
  • geo.getTopArtists
  • geo.getTopTracks
library
  • library.getArtists
tag
  • tag.getInfo
  • tag.getSimilar
  • tag.getTopAlbums
  • tag.getTopArtists
  • tag.getTopTags
  • tag.getTopTracks
  • tag.getWeeklyChartList
track
  • track.addTags
  • track.getCorrection
  • track.getInfo
  • track.getSimilar
  • track.getTags
  • track.getTopTags
  • track.love
  • track.removeTag
  • track.scrobble
  • track.search
  • track.unlove
  • track.updateNowPlaying
user
  • user.getFriends
  • user.getInfo
  • user.getLovedTracks
  • user.getPersonalTags
  • user.getRecentTracks
  • user.getTopAlbums
  • user.getTopArtists
  • user.getTopTags
  • user.getTopTracks
  • user.getWeeklyAlbumChart
  • user.getWeeklyArtistChart
  • user.getWeeklyChartList
  • user.getWeeklyTrackChart

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Documentation

Overview

Package lastfmgo provides a Go wrapper for the last.fm REST API (2.0) and modern alternative to shkh/lastfm-go. This library aims to be idomatic, simple, and powerful at the same time.

Generally, using this library involves creating a new client (web, mobile, or desktop). For write endpoints (e.g., track.scrobble or album.addTags), this client needs to be authenticated to generate a session key. This session key can be used alongside the other parameters to make authenticated requests. Please refer to the last.fm API documentation for the other required and optional parameters.

The parameters "api_key" and "api_sig" are set automatically by the client and do not need to be specified. The client also automatically handles API errors and converts them to Go errors.

Please refer to the examples for common use cases (e.g., authentication, scrobbling, error handling, and integration with other libraries).

Index

Constants

View Source
const BaseURL = "https://ws.audioscrobbler.com/2.0/"

BaseURL is the default base URL of the last.fm API.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlbumAddTagsResponse

type AlbumAddTagsResponse struct {
	BaseResponse
}

AlbumAddTagsResponse stores the response for album.addTags.

https://www.last.fm/api/show/album.addTags

type AlbumGetInfoResponse

type AlbumGetInfoResponse struct {
	BaseResponse
	Album struct {
		Name   string `xml:"name"`
		Artist string `xml:"artist"`
		MBID   string `xml:"mbid"`
		URL    string `xml:"url"`
		Images []struct {
			Size string `xml:"size,attr"`
			URL  string `xml:",chardata"`
		} `xml:"image"`
		Listeners     int64 `xml:"listeners"`
		Playcount     int64 `xml:"playcount"`
		UserPlaycount int64 `xml:"userplaycount"`
		Tracks        []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			URL        string `xml:"url"`
			Duration   int64  `xml:"duration"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
		} `xml:"tracks>track"`
		Tags []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"tags>tag"`
		Wiki struct {
			Published string `xml:"published"`
			Summary   string `xml:"summary"`
			Content   string `xml:"content"`
		} `xml:"wiki"`
	} `xml:"album"`
}

AlbumGetInfoResponse stores the response for album.getInfo.

https://www.last.fm/api/show/album.getInfo

type AlbumGetTagsResponse

type AlbumGetTagsResponse struct {
	BaseResponse
	Tags struct {
		Album  string `xml:"album,attr"`
		Artist string `xml:"artist,attr"`
		Tags   []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"tag"`
	} `xml:"tags"`
}

AlbumGetTagsResponse stores the response for album.getTags.

https://www.last.fm/api/show/album.getTags

type AlbumGetTopTagsResponse

type AlbumGetTopTagsResponse struct {
	BaseResponse
	TopTags struct {
		Album  string `xml:"album,attr"`
		Artist string `xml:"artist,attr"`
		Tags   []struct {
			Count int64  `xml:"count"`
			Name  string `xml:"name"`
			URL   string `xml:"url"`
		} `xml:"tag"`
	} `xml:"toptags"`
}

AlbumGetTopTagsResponse stores the response for album.getTopTags.

https://www.last.fm/api/show/album.getTopTags

type AlbumRemoveTagResponse

type AlbumRemoveTagResponse struct {
	BaseResponse
}

AlbumRemoveTagResponse stores the response for album.removeTag.

https://www.last.fm/api/show/album.removeTag

type AlbumSearchResponse

type AlbumSearchResponse struct {
	BaseResponse
	Results struct {
		OpenSearchResponse
		Albums []struct {
			Name   string `xml:"name"`
			Artist string `xml:"artist"`
			URL    string `xml:"url"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			Streamable int64  `xml:"streamable"`
			MBID       string `xml:"mbid"`
		} `xml:"albummatches>album"`
	} `xml:"results"`
}

AlbumSearchResponse stores the response for album.search.

https://www.last.fm/api/show/album.search

type ArtistAddTagsResponse

type ArtistAddTagsResponse struct {
	BaseResponse
}

ArtistAddTagsResponse stores the response for artist.addTags.

https://www.last.fm/api/show/artist.addTags

type ArtistGetCorrectionResponse

type ArtistGetCorrectionResponse struct {
	BaseResponse
	Correction struct {
		Index  int64 `xml:"index,attr"`
		Artist struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"artist"`
	} `xml:"corrections>correction"`
}

ArtistGetCorrectionResponse stores the response for artist.getCorrection.

https://www.last.fm/api/show/artist.getCorrection

type ArtistGetInfoResponse

type ArtistGetInfoResponse struct {
	BaseResponse
	Artist struct {
		Name   string `xml:"name"`
		MBID   string `xml:"mbid"`
		URL    string `xml:"url"`
		Images []struct {
			Size string `xml:"size,attr"`
			URL  string `xml:",chardata"`
		} `xml:"image"`
		Streamable int64 `xml:"streamable"`
		Ontour     int64 `xml:"ontour"`
		Stats      struct {
			Listeners     int64 `xml:"listeners"`
			Playcount     int64 `xml:"playcount"`
			UserPlaycount int64 `xml:"userplaycount"`
		} `xml:"stats"`
		Artists []struct {
			Name   string `xml:"name"`
			URL    string `xml:"url"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"similar>artist"`
		Tags []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"tags>tag"`
		Bio struct {
			Link struct {
				Href string `xml:"href,attr"`
				Rel  string `xml:"rel,attr"`
			} `xml:"links>link"`
			Published string `xml:"published"`
			Summary   string `xml:"summary"`
			Content   string `xml:"content"`
		} `xml:"bio"`
	} `xml:"artist"`
}

ArtistGetInfoResponse stores the response for artist.getInfo.

https://www.last.fm/api/show/artist.getInfo

type ArtistGetSimilarResponse

type ArtistGetSimilarResponse struct {
	BaseResponse
	SimilarArtists struct {
		Artist  string `xml:"artist,attr"`
		Artists []struct {
			Name   string  `xml:"name"`
			MBID   string  `xml:"mbid"`
			Match  float64 `xml:"match"`
			URL    string  `xml:"url"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			Streamable int64 `xml:"streamable"`
		} `xml:"artist"`
	} `xml:"similarartists"`
}

ArtistGetSimilarResponse stores the response for artist.getSimilar.

https://www.last.fm/api/show/artist.getSimilar

type ArtistGetTagsResponse

type ArtistGetTagsResponse struct {
	BaseResponse
	Tags struct {
		Artist string `xml:"artist,attr"`
		Tags   []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"tag"`
	} `xml:"tags"`
}

ArtistGetTagsResponse stores the response for artist.getTags.

https://www.last.fm/api/show/artist.getTags

type ArtistGetTopAlbumsResponse

type ArtistGetTopAlbumsResponse struct {
	BaseResponse
	TopAlbums struct {
		PaginationResponse
		Artist string `xml:"artist,attr"`
		Albums []struct {
			Rank      int64  `xml:"rank,attr"`
			Name      string `xml:"name"`
			Playcount int64  `xml:"playcount"`
			MBID      string `xml:"mbid"`
			URL       string `xml:"url"`
			Artist    struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"album"`
	} `xml:"topalbums"`
}

ArtistGetTopAlbumsResponse stores the response for artist.getTopAlbums.

https://www.last.fm/api/show/artist.getTopAlbums

type ArtistGetTopTagsResponse

type ArtistGetTopTagsResponse struct {
	BaseResponse
	TopTags struct {
		Artist string `xml:"artist,attr"`
		Tags   []struct {
			Count int64  `xml:"count"`
			Name  string `xml:"name"`
			URL   string `xml:"url"`
		} `xml:"tag"`
	} `xml:"toptags"`
}

ArtistGetTopTagsResponse stores the response for artist.getTopTags.

https://www.last.fm/api/show/artist.getTopTags

type ArtistGetTopTracksResponse

type ArtistGetTopTracksResponse struct {
	BaseResponse
	TopTracks struct {
		PaginationResponse
		Artist string `xml:"artist,attr"`
		Tracks []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Playcount  int64  `xml:"playcount"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Artist     struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"track"`
	} `xml:"toptracks"`
}

ArtistGetTopTracksResponse stores the response for artist.getTopTracks.

https://www.last.fm/api/show/artist.getTopTracks

type ArtistRemoveTagResponse

type ArtistRemoveTagResponse struct {
	BaseResponse
}

ArtistRemoveTagResponse stores the response for artist.removeTag.

https://www.last.fm/api/show/artist.removeTag

type ArtistSearchResponse

type ArtistSearchResponse struct {
	BaseResponse
	Results struct {
		OpenSearchResponse
		Artists []struct {
			Name       string `xml:"name"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artistmatches>artist"`
	} `xml:"results"`
}

ArtistSearchResponse stores the response for artist.search.

https://www.last.fm/api/show/artist.search

type AuthGetMobileSessionResponse

type AuthGetMobileSessionResponse struct {
	BaseResponse
	Session struct {
		Name       string `xml:"name"`
		Key        string `xml:"key"`
		Subscriber int64  `xml:"subscriber"`
	} `xml:"session"`
}

AuthGetMobileSessionResponse stores the response for auth.getMobileSession.

https://www.last.fm/api/show/auth.getMobileSession

type AuthGetSessionResponse

type AuthGetSessionResponse struct {
	BaseResponse
	Session struct {
		Name       string `xml:"name"`
		Key        string `xml:"key"`
		Subscriber int64  `xml:"subscriber"`
	} `xml:"session"`
}

AuthGetSessionResponse stores the response for auth.getSession.

https://www.last.fm/api/show/auth.getSession

type AuthGetTokenResponse

type AuthGetTokenResponse struct {
	BaseResponse
	Token string `xml:"token"`
}

AuthGetTokenResponse stores the response for auth.getToken.

https://www.last.fm/api/show/auth.getToken

type BaseResponse

type BaseResponse struct {
	Status string `xml:"status,attr"`
	Error  struct {
		Code    int64  `xml:"code,attr"`
		Message string `xml:",chardata"`
	} `xml:"error"`
}

BaseResponse contains fields found in all responses.

type ChartGetTopArtistsResponse

type ChartGetTopArtistsResponse struct {
	BaseResponse
	Artists struct {
		PaginationResponse
		Artists []struct {
			Name       string `xml:"name"`
			Playcount  int64  `xml:"playcount"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artist"`
	} `xml:"artists"`
}

ChartGetTopArtistsResponse stores the response for chart.getTopArtists.

https://www.last.fm/api/show/chart.getTopArtists

type ChartGetTopTagsResponse

type ChartGetTopTagsResponse struct {
	BaseResponse
	Tags struct {
		PaginationResponse
		Tags []struct {
			Name       string   `xml:"name"`
			URL        string   `xml:"url"`
			Reach      int64    `xml:"reach"`
			Taggings   int64    `xml:"taggings"`
			Streamable int64    `xml:"streamable"`
			Wiki       struct{} `xml:"wiki"`
		} `xml:"tag"`
	} `xml:"tags"`
}

ChartGetTopTagsResponse stores the response for chart.getTopTags.

https://www.last.fm/api/show/chart.getTopTags

type ChartGetTopTracksResponse

type ChartGetTopTracksResponse struct {
	BaseResponse
	Tracks struct {
		PaginationResponse
		Tracks []struct {
			Name       string `xml:"name"`
			Duration   int64  `xml:"duration"`
			Playcount  int64  `xml:"playcount"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"track"`
	} `xml:"tracks"`
}

ChartGetTopTracksResponse stores the response for chart.getTopTracks.

https://www.last.fm/api/show/chart.getTopTracks

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for the last.fm API.

func NewDesktopClient

func NewDesktopClient(baseURL, apiKey, apiSecret string) (Client, error)

NewDesktopClient creates a new client prepared for desktop authentication. Requires calling the following methods:

  1. Client.AuthGetToken
  2. Client.DesktopAuthorizationURL
  3. Client.AuthGetSession

https://www.last.fm/api/desktopauth

func NewMobileClient

func NewMobileClient(baseURL, apiKey, apiSecret, username, password string) (Client, error)

NewMobileClient creates a new client prepared for mobile authentication. Requires calling the following methods:

  1. Client.AuthGetMobileSession

https://www.last.fm/api/mobileauth

func NewWebClient

func NewWebClient(baseURL, apiKey, apiSecret, callbackURL string) (Client, error)

NewWebClient creates a new client prepared for web authentication. Requires calling the following methods:

  1. Client.WebAuthorizationURL
  2. Client.AuthGetSession

You must create a server running on callbackURL to catch the token. If callbackURL is an empty string, the default callback URL will be used.

https://www.last.fm/api/webauth

func (Client) AlbumAddTags

func (c Client) AlbumAddTags(params P) (AlbumAddTagsResponse, error)

AlbumAddTags calls the album.addTags endpoint.

https://www.last.fm/api/show/album.addTags

func (Client) AlbumGetInfo

func (c Client) AlbumGetInfo(params P) (AlbumGetInfoResponse, error)

AlbumGetInfo calls the album.getInfo endpoint.

https://www.last.fm/api/show/album.getInfo

func (Client) AlbumGetTags

func (c Client) AlbumGetTags(params P) (AlbumGetTagsResponse, error)

AlbumGetTags calls the album.getTags endpoint.

https://www.last.fm/api/show/album.getTags

func (Client) AlbumGetTopTags

func (c Client) AlbumGetTopTags(params P) (AlbumGetTopTagsResponse, error)

AlbumGetTopTags calls the album.getTopTags endpoint.

https://www.last.fm/api/show/album.getTopTags

func (Client) AlbumRemoveTag

func (c Client) AlbumRemoveTag(params P) (AlbumRemoveTagResponse, error)

AlbumRemoveTag calls the album.removeTag endpoint.

https://www.last.fm/api/show/album.removeTag

func (Client) AlbumSearch

func (c Client) AlbumSearch(params P) (AlbumSearchResponse, error)

AlbumSearch calls the album.search endpoint.

https://www.last.fm/api/show/album.search

func (Client) ArtistAddTags

func (c Client) ArtistAddTags(params P) (ArtistAddTagsResponse, error)

ArtistAddTags calls the artist.addTags endpoint.

https://www.last.fm/api/show/artist.addTags

func (Client) ArtistGetCorrection

func (c Client) ArtistGetCorrection(params P) (ArtistGetCorrectionResponse, error)

ArtistGetCorrection calls the artist.getCorrection endpoint.

https://www.last.fm/api/show/artist.getCorrection

func (Client) ArtistGetInfo

func (c Client) ArtistGetInfo(params P) (ArtistGetInfoResponse, error)

ArtistGetInfo calls the artist.getInfo endpoint.

https://www.last.fm/api/show/artist.getInfo

func (Client) ArtistGetSimilar

func (c Client) ArtistGetSimilar(params P) (ArtistGetSimilarResponse, error)

ArtistGetSimilar calls the artist.getSimilar endpoint.

https://www.last.fm/api/show/artist.getSimilar

func (Client) ArtistGetTags

func (c Client) ArtistGetTags(params P) (ArtistGetTagsResponse, error)

ArtistGetTags calls the artist.getTags endpoint.

https://www.last.fm/api/show/artist.getTags

func (Client) ArtistGetTopAlbums

func (c Client) ArtistGetTopAlbums(params P) (ArtistGetTopAlbumsResponse, error)

ArtistGetTopAlbums calls the artist.getTopAlbums endpoint.

https://www.last.fm/api/show/artist.getTopAlbums

func (Client) ArtistGetTopTags

func (c Client) ArtistGetTopTags(params P) (ArtistGetTopTagsResponse, error)

ArtistGetTopTags calls the artist.getTopTags endpoint.

https://www.last.fm/api/show/artist.getTopTags

func (Client) ArtistGetTopTracks

func (c Client) ArtistGetTopTracks(params P) (ArtistGetTopTracksResponse, error)

ArtistGetTopTracks calls the artist.getTopTracks endpoint.

https://www.last.fm/api/show/artist.getTopTracks

func (Client) ArtistRemoveTag

func (c Client) ArtistRemoveTag(params P) (ArtistRemoveTagResponse, error)

ArtistRemoveTag calls the artist.removeTag endpoint.

https://www.last.fm/api/show/artist.removeTag

func (Client) ArtistSearch

func (c Client) ArtistSearch(params P) (ArtistSearchResponse, error)

ArtistSearch calls the artist.search endpoint.

https://www.last.fm/api/show/artist.search

func (Client) AuthGetMobileSession

func (c Client) AuthGetMobileSession() (AuthGetMobileSessionResponse, error)

AuthGetMobileSession calls the auth.getMobileSession endpoint. This is the first and only step in the mobile authentication process.

https://www.last.fm/api/show/auth.getMobileSession

func (Client) AuthGetSession

func (c Client) AuthGetSession(token string) (AuthGetSessionResponse, error)

AuthGetSession calls the auth.getSession endpoint. This is the second step in the web authentication process and the third step in the desktop authentication process.

https://www.last.fm/api/show/auth.getSession

func (Client) AuthGetToken

func (c Client) AuthGetToken() (AuthGetTokenResponse, error)

AuthGetToken calls the auth.getToken endpoint. This is the first step in the desktop authentication process.

https://www.last.fm/api/show/auth.getToken

func (Client) ChartGetTopArtists

func (c Client) ChartGetTopArtists(params P) (ChartGetTopArtistsResponse, error)

ChartGetTopArtists calls the chart.getTopArtists endpoint.

https://www.last.fm/api/show/chart.getTopArtists

func (Client) ChartGetTopTags

func (c Client) ChartGetTopTags(params P) (ChartGetTopTagsResponse, error)

ChartGetTopTags calls the chart.getTopTags endpoint.

https://www.last.fm/api/show/chart.getTopTags

func (Client) ChartGetTopTracks

func (c Client) ChartGetTopTracks(params P) (ChartGetTopTracksResponse, error)

ChartGetTopTracks calls the chart.getTopTracks endpoint.

https://www.last.fm/api/show/chart.getTopTracks

func (Client) DesktopAuthorizationURL

func (c Client) DesktopAuthorizationURL(token string) string

DesktopAuthorizationURL generates a URL to request authorization from the user. This is the second step in the desktop authentication process.

https://www.last.fm/api/desktopauth

func (Client) GeoGetTopArtists

func (c Client) GeoGetTopArtists(params P) (GeoGetTopArtistsResponse, error)

GeoGetTopArtists calls the geo.getTopArtists endpoint.

https://www.last.fm/api/show/geo.getTopArtists

func (Client) GeoGetTopTracks

func (c Client) GeoGetTopTracks(params P) (GeoGetTopTracksResponse, error)

GeoGetTopTracks calls the geo.getTopTracks endpoint.

https://www.last.fm/api/show/geo.getTopTracks

func (Client) LibraryGetArtists

func (c Client) LibraryGetArtists(params P) (LibraryGetArtistsResponse, error)

LibraryGetArtists calls the library.getArtists endpoint.

https://www.last.fm/api/show/library.getArtists

func (Client) TagGetInfo

func (c Client) TagGetInfo(params P) (TagGetInfoResponse, error)

TagGetInfo calls the tag.getInfo endpoint.

https://www.last.fm/api/show/tag.getInfo

func (Client) TagGetSimilar

func (c Client) TagGetSimilar(params P) (TagGetSimilarResponse, error)

TagGetSimilar calls the tag.getSimilar endpoint.

https://www.last.fm/api/show/tag.getSimilar

func (Client) TagGetTopAlbums

func (c Client) TagGetTopAlbums(params P) (TagGetTopAlbumsResponse, error)

TagGetTopAlbums calls the tag.getTopAlbums endpoint.

https://www.last.fm/api/show/tag.getTopAlbums

func (Client) TagGetTopArtists

func (c Client) TagGetTopArtists(params P) (TagGetTopArtistsResponse, error)

TagGetTopArtists calls the tag.getTopArtists endpoint.

https://www.last.fm/api/show/tag.getTopArtists

func (Client) TagGetTopTags

func (c Client) TagGetTopTags(params P) (TagGetTopTagsResponse, error)

TagGetTopTags calls the tag.getTopTags endpoint.

https://www.last.fm/api/show/tag.getTopTags

func (Client) TagGetTopTracks

func (c Client) TagGetTopTracks(params P) (TagGetTopTracksResponse, error)

TagGetTopTracks calls the tag.getTopTracks endpoint.

https://www.last.fm/api/show/tag.getTopTracks

func (Client) TagGetWeeklyChartList

func (c Client) TagGetWeeklyChartList(params P) (TagGetWeeklyChartListResponse, error)

TagGetWeeklyChartList calls the tag.getWeeklyChartList endpoint.

https://www.last.fm/api/show/tag.getWeeklyChartList

func (Client) TrackAddTags

func (c Client) TrackAddTags(params P) (TrackAddTagsResponse, error)

TrackAddTags calls the track.addTags endpoint.

https://www.last.fm/api/show/track.addTags

func (Client) TrackGetCorrection

func (c Client) TrackGetCorrection(params P) (TrackGetCorrectionResponse, error)

TrackGetCorrection calls the track.getCorrection endpoint.

https://www.last.fm/api/show/track.getCorrection

func (Client) TrackGetInfo

func (c Client) TrackGetInfo(params P) (TrackGetInfoResponse, error)

TrackGetInfo calls the track.getInfo endpoint.

https://www.last.fm/api/show/track.getInfo

func (Client) TrackGetSimilar

func (c Client) TrackGetSimilar(params P) (TrackGetSimilarResponse, error)

TrackGetSimilar calls the track.getSimilar endpoint.

https://www.last.fm/api/show/track.getSimilar

func (Client) TrackGetTags

func (c Client) TrackGetTags(params P) (TrackGetTagsResponse, error)

TrackGetTags calls the track.getTags endpoint.

https://www.last.fm/api/show/track.getTags

func (Client) TrackGetTopTags

func (c Client) TrackGetTopTags(params P) (TrackGetTopTagsResponse, error)

TrackGetTopTags calls the track.getTopTags endpoint.

https://www.last.fm/api/show/track.getTopTags

func (Client) TrackLove

func (c Client) TrackLove(params P) (TrackLoveResponse, error)

TrackLove calls the track.love endpoint.

https://www.last.fm/api/show/track.love

func (Client) TrackRemoveTag

func (c Client) TrackRemoveTag(params P) (TrackRemoveTagResponse, error)

TrackRemoveTag calls the track.removeTag endpoint.

https://www.last.fm/api/show/track.removeTag

func (Client) TrackScrobble

func (c Client) TrackScrobble(params P) (TrackScrobbleResponse, error)

TrackScrobble calls the track.scrobble endpoint.

https://www.last.fm/api/show/track.scrobble

func (Client) TrackSearch

func (c Client) TrackSearch(params P) (TrackSearchResponse, error)

TrackSearch calls the track.search endpoint.

https://www.last.fm/api/show/track.search

func (Client) TrackUnlove

func (c Client) TrackUnlove(params P) (TrackUnloveResponse, error)

TrackUnlove calls the track.unlove endpoint.

https://www.last.fm/api/show/track.unlove

func (Client) TrackUpdateNowPlaying

func (c Client) TrackUpdateNowPlaying(params P) (TrackUpdateNowPlayingResponse, error)

TrackUpdateNowPlaying calls the track.updateNowPlaying endpoint.

https://www.last.fm/api/show/track.updateNowPlaying

func (Client) UserGetFriends

func (c Client) UserGetFriends(params P) (UserGetFriendsResponse, error)

UserGetFriends calls the user.getFriends endpoint.

https://www.last.fm/api/show/user.getFriends

func (Client) UserGetInfo

func (c Client) UserGetInfo(params P) (UserGetInfoResponse, error)

UserGetInfo calls the user.getInfo endpoint.

https://www.last.fm/api/show/user.getInfo

func (Client) UserGetLovedTracks

func (c Client) UserGetLovedTracks(params P) (UserGetLovedTracksResponse, error)

UserGetLovedTracks calls the user.getLovedTracks endpoint.

https://www.last.fm/api/show/user.getLovedTracks

func (Client) UserGetPersonalTags

func (c Client) UserGetPersonalTags(params P) (UserGetPersonalTagsResponse, error)

UserGetPersonalTags calls the user.getPersonalTags endpoint.

https://www.last.fm/api/show/user.getPersonalTags

func (Client) UserGetRecentTracks

func (c Client) UserGetRecentTracks(params P) (UserGetRecentTracksResponse, error)

UserGetRecentTracks calls the user.getRecentTracks endpoint.

https://www.last.fm/api/show/user.getRecentTracks

func (Client) UserGetTopAlbums

func (c Client) UserGetTopAlbums(params P) (UserGetTopAlbumsResponse, error)

UserGetTopAlbums calls the user.getTopAlbums endpoint.

https://www.last.fm/api/show/user.getTopAlbums

func (Client) UserGetTopArtists

func (c Client) UserGetTopArtists(params P) (UserGetTopArtistsResponse, error)

UserGetTopArtists calls the user.getTopArtists endpoint.

https://www.last.fm/api/show/user.getTopArtists

func (Client) UserGetTopTags

func (c Client) UserGetTopTags(params P) (UserGetTopTagsResponse, error)

UserGetTopTags calls the user.getTopTags endpoint.

https://www.last.fm/api/show/user.getTopTags

func (Client) UserGetTopTracks

func (c Client) UserGetTopTracks(params P) (UserGetTopTracksResponse, error)

UserGetTopTracks calls the user.getTopTracks endpoint.

https://www.last.fm/api/show/user.getTopTracks

func (Client) UserGetWeeklyAlbumChart

func (c Client) UserGetWeeklyAlbumChart(params P) (UserGetWeeklyAlbumChartResponse, error)

UserGetWeeklyAlbumChart calls the user.getWeeklyAlbumChart endpoint.

https://www.last.fm/api/show/user.getWeeklyAlbumChart

func (Client) UserGetWeeklyArtistChart

func (c Client) UserGetWeeklyArtistChart(params P) (UserGetWeeklyArtistChartResponse, error)

UserGetWeeklyArtistChart calls the user.getWeeklyArtistChart endpoint.

https://www.last.fm/api/show/user.getWeeklyArtistChart

func (Client) UserGetWeeklyChartList

func (c Client) UserGetWeeklyChartList(params P) (UserGetWeeklyChartListResponse, error)

UserGetWeeklyChartList calls the user.getWeeklyChartList endpoint.

https://www.last.fm/api/show/user.getWeeklyChartList

func (Client) UserGetWeeklyTrackChart

func (c Client) UserGetWeeklyTrackChart(params P) (UserGetWeeklyTrackChartResponse, error)

UserGetWeeklyTrackChart calls the user.getWeeklyTrackChart endpoint.

https://www.last.fm/api/show/user.getWeeklyTrackChart

func (Client) WebAuthorizationURL

func (c Client) WebAuthorizationURL() string

WebAuthorizationURL generates a URL to request authorization from the user. This is the first step in the web authentication process.

https://www.last.fm/api/webauth

type GeoGetTopArtistsResponse

type GeoGetTopArtistsResponse struct {
	BaseResponse
	TopArtists struct {
		PaginationResponse
		Country string `xml:"country,attr"`
		Artists []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artist"`
	} `xml:"topartists"`
}

GeoGetTopArtistsResponse stores the response for geo.getTopArtists.

https://www.last.fm/api/show/geo.getTopArtists

type GeoGetTopTracksResponse

type GeoGetTopTracksResponse struct {
	BaseResponse
	Tracks struct {
		PaginationResponse
		Country string `xml:"country,attr"`
		Tracks  []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Duration   int64  `xml:"duration"`
			Listeners  int64  `xml:"listeners"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"track"`
	} `xml:"tracks"`
}

GeoGetTopTracksResponse stores the response for geo.getTopTracks.

https://www.last.fm/api/show/geo.getTopTracks

type LibraryGetArtistsResponse

type LibraryGetArtistsResponse struct {
	BaseResponse
	Artists struct {
		PaginationResponse
		User    string `xml:"user,attr"`
		Artists []struct {
			Name       string `xml:"name"`
			Playcount  int64  `xml:"playcount"`
			Tagcount   int64  `xml:"tagcount"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artist"`
	} `xml:"artists"`
}

LibraryGetArtistsResponse stores the response for library.getArtists.

https://www.last.fm/api/show/library.getArtists

type OpenSearchResponse

type OpenSearchResponse struct {
	For   string `xml:"for,attr"`
	Query struct {
		Role        string `xml:"role,attr"`
		SearchTerms string `xml:"searchTerms,attr"`
		StartPage   int64  `xml:"startPage,attr"`
	} `xml:"Query"`
	TotalResults int64 `xml:"totalResults"`
	StartIndex   int64 `xml:"startIndex"`
	ItemsPerPage int64 `xml:"itemsPerPage"`
}

OpenSearchResponse contains fields found in OpenSearch query responses.

type P

type P map[string]any

P is a shorthand for map[string]any.

type PaginationResponse

type PaginationResponse struct {
	Page       int64 `xml:"page,attr"`
	PerPage    int64 `xml:"perPage,attr"`
	Total      int64 `xml:"total,attr"`
	TotalPages int64 `xml:"totalPages,attr"`
}

PaginationResponse contains fields found in paginated responses.

type TagGetInfoResponse

type TagGetInfoResponse struct {
	BaseResponse
	Tag struct {
		Name  string `xml:"name"`
		Total int64  `xml:"total"`
		Reach int64  `xml:"reach"`
		Wiki  struct {
			Summary string `xml:"summary"`
			Content string `xml:"content"`
		} `xml:"wiki"`
	} `xml:"tag"`
}

TagGetInfoResponse stores the response for tag.getInfo.

https://www.last.fm/api/show/tag.getInfo

type TagGetSimilarResponse

type TagGetSimilarResponse struct {
	BaseResponse
	SimilarTags struct{} `xml:"similartags"`
}

TagGetSimilarResponse stores the response for tag.getSimilar.

https://www.last.fm/api/show/tag.getSimilar

type TagGetTopAlbumsResponse

type TagGetTopAlbumsResponse struct {
	BaseResponse
	Albums struct {
		PaginationResponse
		Tag    string `xml:"tag,attr"`
		Albums []struct {
			Rank   int64  `xml:"rank,attr"`
			Name   string `xml:"name"`
			MBID   string `xml:"mbid"`
			URL    string `xml:"url"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"album"`
	} `xml:"albums"`
}

TagGetTopAlbumsResponse stores the response for tag.getTopAlbums.

https://www.last.fm/api/show/tag.getTopAlbums

type TagGetTopArtistsResponse

type TagGetTopArtistsResponse struct {
	BaseResponse
	TopArtists struct {
		PaginationResponse
		Tag     string `xml:"tag,attr"`
		Artists []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artist"`
	} `xml:"topartists"`
}

TagGetTopArtistsResponse stores the response for tag.getTopArtists.

https://www.last.fm/api/show/tag.getTopArtists

type TagGetTopTagsResponse

type TagGetTopTagsResponse struct {
	BaseResponse
	TopTags struct {
		NumRes int64 `xml:"num_res,attr"`
		Offset int64 `xml:"offset,attr"`
		Total  int64 `xml:"total,attr"`
		Tags   []struct {
			Name  string `xml:"name"`
			Count int64  `xml:"count"`
			Reach int64  `xml:"reach"`
		} `xml:"tag"`
	} `xml:"toptags"`
}

TagGetTopTagsResponse stores the response for tag.getTopTags.

https://www.last.fm/api/show/tag.getTopTags

type TagGetTopTracksResponse

type TagGetTopTracksResponse struct {
	BaseResponse
	Tracks struct {
		PaginationResponse
		Tag    string `xml:"tag,attr"`
		Tracks []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Duration   int64  `xml:"duration"`
			URL        string `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			MBID string `xml:"mbid"`
		} `xml:"track"`
	} `xml:"tracks"`
}

TagGetTopTracksResponse stores the response for tag.getTopTracks.

https://www.last.fm/api/show/tag.getTopTracks

type TagGetWeeklyChartListResponse

type TagGetWeeklyChartListResponse struct {
	BaseResponse
	Weeklychartlist struct {
		Tag    string `xml:"tag,attr"`
		Charts []struct {
			From int64 `xml:"from,attr"`
			To   int64 `xml:"to,attr"`
		} `xml:"chart"`
	} `xml:"weeklychartlist"`
}

TagGetWeeklyChartListResponse stores the response for tag.getWeeklyChartList.

https://www.last.fm/api/show/tag.getWeeklyChartList

type TrackAddTagsResponse

type TrackAddTagsResponse struct {
	BaseResponse
}

TrackAddTagsResponse stores the response for track.addTags.

https://www.last.fm/api/show/track.addTags

type TrackGetCorrectionResponse

type TrackGetCorrectionResponse struct {
	BaseResponse
	Correction struct {
		ArtistCorrected int64 `xml:"artistcorrected,attr"`
		Index           int64 `xml:"index,attr"`
		TrackCorrected  int64 `xml:"trackcorrected,attr"`
		Track           struct {
			Name   string `xml:"name"`
			URL    string `xml:"url"`
			Artist struct {
				Name string `xml:"name"`
				URL  string `xml:"url"`
			} `xml:"artist"`
		} `xml:"track"`
	} `xml:"corrections>correction"`
}

TrackGetCorrectionResponse stores the response for track.getCorrection.

https://www.last.fm/api/show/track.getCorrection

type TrackGetInfoResponse

type TrackGetInfoResponse struct {
	BaseResponse
	Track struct {
		Name       string `xml:"name"`
		URL        string `xml:"url"`
		Duration   int64  `xml:"duration"`
		Streamable struct {
			FullTrack  int64 `xml:"fulltrack,attr"`
			Streamable int64 `xml:",chardata"`
		} `xml:"streamable"`
		Listeners int64 `xml:"listeners"`
		Playcount int64 `xml:"playcount"`
		Artist    struct {
			Name string `xml:"name"`
			MBID string `xml:"mbid"`
			URL  string `xml:"url"`
		} `xml:"artist"`
		Album struct {
			Artist string `xml:"artist"`
			Title  string `xml:"title"`
			URL    string `xml:"url"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"album"`
		Tags []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"toptags>tag"`
		Wiki struct {
			Published string `xml:"published"`
			Summary   string `xml:"summary"`
			Content   string `xml:"content"`
		} `xml:"wiki"`
	} `xml:"track"`
}

TrackGetInfoResponse stores the response for track.getInfo.

https://www.last.fm/api/show/track.getInfo

type TrackGetSimilarResponse

type TrackGetSimilarResponse struct {
	BaseResponse
	SimilarTracks struct {
		Artist string `xml:"artist,attr"`
		Track  string `xml:"track,attr"`
		Tracks []struct {
			Name       string  `xml:"name"`
			Playcount  int64   `xml:"playcount"`
			Match      float64 `xml:"match"`
			URL        string  `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Duration int64 `xml:"duration"`
			Artist   struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			MBID string `xml:"mbid"`
		} `xml:"track"`
	} `xml:"similartracks"`
}

TrackGetSimilarResponse stores the response for track.getSimilar.

https://www.last.fm/api/show/track.getSimilar

type TrackGetTagsResponse

type TrackGetTagsResponse struct {
	BaseResponse
	Tags struct {
		Artist string `xml:"artist,attr"`
		Track  string `xml:"track,attr"`
		Tags   []struct {
			Name string `xml:"name"`
			URL  string `xml:"url"`
		} `xml:"tag"`
	} `xml:"tags"`
}

TrackGetTagsResponse stores the response for track.getTags.

https://www.last.fm/api/show/track.getTags

type TrackGetTopTagsResponse

type TrackGetTopTagsResponse struct {
	BaseResponse
	TopTags struct {
		Artist string `xml:"artist,attr"`
		Track  string `xml:"track,attr"`
		Tags   []struct {
			Count int64  `xml:"count"`
			Name  string `xml:"name"`
			URL   string `xml:"url"`
		} `xml:"tag"`
	} `xml:"toptags"`
}

TrackGetTopTagsResponse stores the response for track.getTopTags.

https://www.last.fm/api/show/track.getTopTags

type TrackLoveResponse

type TrackLoveResponse struct {
	BaseResponse
}

TrackLoveResponse stores the response for track.love.

https://www.last.fm/api/show/track.love

type TrackRemoveTagResponse

type TrackRemoveTagResponse struct {
	BaseResponse
}

TrackRemoveTagResponse stores the response for track.removeTag.

https://www.last.fm/api/show/track.removeTag

type TrackScrobbleResponse

type TrackScrobbleResponse struct {
	BaseResponse
	Scrobbles struct {
		Accepted  int64 `xml:"accepted,attr"`
		Ignored   int64 `xml:"ignored,attr"`
		Scrobbles []struct {
			Track struct {
				Corrected int64  `xml:"corrected,attr"`
				Name      string `xml:",chardata"`
			} `xml:"track"`
			Artist struct {
				Corrected int64  `xml:"corrected,attr"`
				Name      string `xml:",chardata"`
			} `xml:"artist"`
			Album struct {
				Corrected int64  `xml:"corrected,attr"`
				Name      string `xml:",chardata"`
			} `xml:"album"`
			AlbumArtist struct {
				Corrected int64  `xml:"corrected,attr"`
				Name      string `xml:",chardata"`
			} `xml:"albumArtist"`
			Timestamp      int64 `xml:"timestamp"`
			IgnoredMessage struct {
				Code    int64  `xml:"code,attr"`
				Message string `xml:",chardata"`
			} `xml:"ignoredMessage"`
		} `xml:"scrobble"`
	} `xml:"scrobbles"`
}

TrackScrobbleResponse stores the response for track.scrobble.

https://www.last.fm/api/show/track.scrobble

type TrackSearchResponse

type TrackSearchResponse struct {
	BaseResponse
	Results struct {
		OpenSearchResponse
		ItemsPerPage int64 `xml:"itemsPerPage"`
		Tracks       []struct {
			Name       string `xml:"name"`
			Artist     string `xml:"artist"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Listeners  int64  `xml:"listeners"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			MBID string `xml:"mbid"`
		} `xml:"trackmatches>track"`
	} `xml:"results"`
}

TrackSearchResponse stores the response for track.search.

https://www.last.fm/api/show/track.search

type TrackUnloveResponse

type TrackUnloveResponse struct {
	BaseResponse
}

TrackUnloveResponse stores the response for track.unlove.

https://www.last.fm/api/show/track.unlove

type TrackUpdateNowPlayingResponse

type TrackUpdateNowPlayingResponse struct {
	BaseResponse
	Nowplaying struct {
		Track struct {
			Corrected int64  `xml:"corrected,attr"`
			Name      string `xml:",chardata"`
		} `xml:"track"`
		Artist struct {
			Corrected int64  `xml:"corrected,attr"`
			Name      string `xml:",chardata"`
		} `xml:"artist"`
		Album struct {
			Corrected int64 `xml:"corrected,attr"`
		} `xml:"album"`
		AlbumArtist struct {
			Corrected int64 `xml:"corrected,attr"`
		} `xml:"albumArtist"`
		IgnoredMessage struct {
			Code    int64  `xml:"code,attr"`
			Message string `xml:",chardata"`
		} `xml:"ignoredMessage"`
	} `xml:"nowplaying"`
}

TrackUpdateNowPlayingResponse stores the response for track.updateNowPlaying.

https://www.last.fm/api/show/track.updateNowPlaying

type UserGetFriendsResponse

type UserGetFriendsResponse struct {
	BaseResponse
	Friends struct {
		PaginationResponse
		User  string `xml:"user,attr"`
		Users []struct {
			Name     string `xml:"name"`
			RealName string `xml:"realname"`
			Images   []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			URL        string `xml:"url"`
			Country    string `xml:"country"`
			Subscriber int64  `xml:"subscriber"`
			Playcount  int64  `xml:"playcount"`
			Playlists  int64  `xml:"playlists"`
			Bootstrap  int64  `xml:"bootstrap"`
			Registered struct {
				UnixTime int64  `xml:"unixtime,attr"`
				Time     string `xml:",chardata"`
			} `xml:"registered"`
			Type string `xml:"type"`
		} `xml:"user"`
	} `xml:"friends"`
}

UserGetFriendsResponse stores the response for user.getFriends.

https://www.last.fm/api/show/user.getFriends

type UserGetInfoResponse

type UserGetInfoResponse struct {
	BaseResponse
	User struct {
		Name     string `xml:"name"`
		RealName string `xml:"realname"`
		Images   []struct {
			Size string `xml:"size,attr"`
			URL  string `xml:",chardata"`
		} `xml:"image"`
		URL        string `xml:"url"`
		Country    string `xml:"country"`
		Age        int64  `xml:"age"`
		Gender     string `xml:"gender"`
		Subscriber int64  `xml:"subscriber"`
		Playcount  int64  `xml:"playcount"`
		Playlists  int64  `xml:"playlists"`
		Bootstrap  int64  `xml:"bootstrap"`
		Registered struct {
			UnixTime int64  `xml:"unixtime,attr"`
			Time     string `xml:",chardata"`
		} `xml:"registered"`
		Type        string `xml:"type"`
		ArtistCount int64  `xml:"artist_count"`
		AlbumCount  int64  `xml:"album_count"`
		TrackCount  int64  `xml:"track_count"`
	} `xml:"user"`
}

UserGetInfoResponse stores the response for user.getInfo.

https://www.last.fm/api/show/user.getInfo

type UserGetLovedTracksResponse

type UserGetLovedTracksResponse struct {
	BaseResponse
	Lovedtracks struct {
		PaginationResponse
		User   string `xml:"user,attr"`
		Tracks []struct {
			Name string `xml:"name"`
			MBID string `xml:"mbid"`
			URL  string `xml:"url"`
			Date struct {
				UTS  int64  `xml:"uts,attr"`
				Time string `xml:",chardata"`
			} `xml:"date"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
		} `xml:"track"`
	} `xml:"lovedtracks"`
}

UserGetLovedTracksResponse stores the response for user.getLovedTracks.

https://www.last.fm/api/show/user.getLovedTracks

type UserGetPersonalTagsResponse

type UserGetPersonalTagsResponse struct {
	BaseResponse
	Taggings struct {
		PaginationResponse
		Tag    string `xml:"tag,attr"`
		User   string `xml:"user,attr"`
		Albums []struct {
			Name   string   `xml:"name"`
			MBID   struct{} `xml:"mbid"`
			URL    string   `xml:"url"`
			Artist struct {
				Name string   `xml:"name"`
				MBID struct{} `xml:"mbid"`
				URL  string   `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"albums>album"`
		Artists []struct {
			Name       string   `xml:"name"`
			MBID       struct{} `xml:"mbid"`
			URL        string   `xml:"url"`
			Streamable int64    `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artists>artist"`
		Tracks []struct {
			Name       string   `xml:"name"`
			Duration   string   `xml:"duration"`
			MBID       struct{} `xml:"mbid"`
			URL        string   `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string   `xml:"name"`
				MBID struct{} `xml:"mbid"`
				URL  string   `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"tracks>track"`
	} `xml:"taggings"`
}

UserGetPersonalTagsResponse stores the response for user.getPersonalTags.

https://www.last.fm/api/show/user.getPersonalTags

type UserGetRecentTracksResponse

type UserGetRecentTracksResponse struct {
	BaseResponse
	RecentTracks struct {
		PaginationResponse
		User   string `xml:"user,attr"`
		Tracks []struct {
			Artist struct {
				Name   string   `xml:"name"`
				MBID   struct{} `xml:"mbid"`
				URL    string   `xml:"url"`
				Images []struct {
					Size string `xml:"size,attr"`
					URL  string `xml:",chardata"`
				} `xml:"image"`
			} `xml:"artist"`
			Loved      int64  `xml:"loved"`
			Name       string `xml:"name"`
			Streamable int64  `xml:"streamable"`
			MBID       string `xml:"mbid"`
			Album      struct {
				MBID string `xml:"mbid,attr"`
				Name string `xml:",chardata"`
			} `xml:"album"`
			URL    string `xml:"url"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			Date struct {
				UTS  int64  `xml:"uts,attr"`
				Time string `xml:",chardata"`
			} `xml:"date"`
		} `xml:"track"`
	} `xml:"recenttracks"`
}

UserGetRecentTracksResponse stores the response for user.getRecentTracks.

https://www.last.fm/api/show/user.getRecentTracks

type UserGetTopAlbumsResponse

type UserGetTopAlbumsResponse struct {
	BaseResponse
	TopAlbums struct {
		PaginationResponse
		User   string `xml:"user,attr"`
		Albums []struct {
			Rank      int64  `xml:"rank,attr"`
			Name      string `xml:"name"`
			Playcount int64  `xml:"playcount"`
			MBID      string `xml:"mbid"`
			URL       string `xml:"url"`
			Artist    struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"album"`
	} `xml:"topalbums"`
}

UserGetTopAlbumsResponse stores the response for user.getTopAlbums.

https://www.last.fm/api/show/user.getTopAlbums

type UserGetTopArtistsResponse

type UserGetTopArtistsResponse struct {
	BaseResponse
	TopArtists struct {
		PaginationResponse
		User    string `xml:"user,attr"`
		Artists []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Playcount  int64  `xml:"playcount"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable int64  `xml:"streamable"`
			Images     []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"artist"`
	} `xml:"topartists"`
}

UserGetTopArtistsResponse stores the response for user.getTopArtists.

https://www.last.fm/api/show/user.getTopArtists

type UserGetTopTagsResponse

type UserGetTopTagsResponse struct {
	BaseResponse
	TopTags struct {
		User string `xml:"user,attr"`
		Tags []struct {
			Name  string `xml:"name"`
			Count int64  `xml:"count"`
			URL   string `xml:"url"`
		} `xml:"tag"`
	} `xml:"toptags"`
}

UserGetTopTagsResponse stores the response for user.getTopTags.

https://www.last.fm/api/show/user.getTopTags

type UserGetTopTracksResponse

type UserGetTopTracksResponse struct {
	BaseResponse
	TopTracks struct {
		PaginationResponse
		User   string `xml:"user,attr"`
		Tracks []struct {
			Rank       int64  `xml:"rank,attr"`
			Name       string `xml:"name"`
			Duration   int64  `xml:"duration"`
			Playcount  int64  `xml:"playcount"`
			MBID       string `xml:"mbid"`
			URL        string `xml:"url"`
			Streamable struct {
				FullTrack  int64 `xml:"fulltrack,attr"`
				Streamable int64 `xml:",chardata"`
			} `xml:"streamable"`
			Artist struct {
				Name string `xml:"name"`
				MBID string `xml:"mbid"`
				URL  string `xml:"url"`
			} `xml:"artist"`
			Images []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
		} `xml:"track"`
	} `xml:"toptracks"`
}

UserGetTopTracksResponse stores the response for user.getTopTracks.

https://www.last.fm/api/show/user.getTopTracks

type UserGetWeeklyAlbumChartResponse

type UserGetWeeklyAlbumChartResponse struct {
	BaseResponse
	WeeklyAlbumChart struct {
		From   int64  `xml:"from,attr"`
		To     int64  `xml:"to,attr"`
		User   string `xml:"user,attr"`
		Albums []struct {
			Rank   int64 `xml:"rank,attr"`
			Artist struct {
				MBID string `xml:"mbid,attr"`
				Name string `xml:",chardata"`
			} `xml:"artist"`
			Name      string `xml:"name"`
			MBID      string `xml:"mbid"`
			Playcount int64  `xml:"playcount"`
			URL       string `xml:"url"`
		} `xml:"album"`
	} `xml:"weeklyalbumchart"`
}

UserGetWeeklyAlbumChartResponse stores the response for user.getWeeklyAlbumChart.

https://www.last.fm/api/show/user.getWeeklyAlbumChart

type UserGetWeeklyArtistChartResponse

type UserGetWeeklyArtistChartResponse struct {
	BaseResponse
	WeeklyArtistChart struct {
		From    int64  `xml:"from,attr"`
		To      int64  `xml:"to,attr"`
		User    string `xml:"user,attr"`
		Artists []struct {
			Rank      int64  `xml:"rank,attr"`
			Name      string `xml:"name"`
			MBID      string `xml:"mbid"`
			Playcount int64  `xml:"playcount"`
			URL       string `xml:"url"`
		} `xml:"artist"`
	} `xml:"weeklyartistchart"`
}

UserGetWeeklyArtistChartResponse stores the response for user.getWeeklyArtistChart.

https://www.last.fm/api/show/user.getWeeklyArtistChart

type UserGetWeeklyChartListResponse

type UserGetWeeklyChartListResponse struct {
	BaseResponse
	Weeklychartlist struct {
		User   string `xml:"user,attr"`
		Charts []struct {
			From int64 `xml:"from,attr"`
			To   int64 `xml:"to,attr"`
		} `xml:"chart"`
	} `xml:"weeklychartlist"`
}

UserGetWeeklyChartListResponse stores the response for user.getWeeklyChartList.

https://www.last.fm/api/show/user.getWeeklyChartList

type UserGetWeeklyTrackChartResponse

type UserGetWeeklyTrackChartResponse struct {
	BaseResponse
	WeeklyTrackChart struct {
		From   int64  `xml:"from,attr"`
		To     int64  `xml:"to,attr"`
		User   string `xml:"user,attr"`
		Tracks []struct {
			Rank   int64 `xml:"rank,attr"`
			Artist struct {
				MBID string `xml:"mbid,attr"`
				Name string `xml:",chardata"`
			} `xml:"artist"`
			Name      string `xml:"name"`
			MBID      string `xml:"mbid"`
			Playcount int64  `xml:"playcount"`
			Images    []struct {
				Size string `xml:"size,attr"`
				URL  string `xml:",chardata"`
			} `xml:"image"`
			URL string `xml:"url"`
		} `xml:"track"`
	} `xml:"weeklytrackchart"`
}

UserGetWeeklyTrackChartResponse stores the response for user.getWeeklyTrackChart.

https://www.last.fm/api/show/user.getWeeklyTrackChart

Directories

Path Synopsis
examples
api_error command
desktop_auth command
geo command
mobile_auth command
musicbrainz command
scrobble command
web_auth command
Package internal provides basic functions for building last.fm API requests.
Package internal provides basic functions for building last.fm API requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL