openapi: 3.0.3 info: title: Last.fm Web Services API (2.0) Album User API version: '2.0' description: 'The Last.fm (AudioScrobbler) Web Services 2.0 API provides programmatic access to music metadata, charts, geo-listening data, tags, user listening history, and scrobbling. The API is method-dispatched: every request targets the single endpoint `https://ws.audioscrobbler.com/2.0/` and identifies the operation via the `method` query/body parameter (e.g. `method=track.getInfo`). Read methods accept `GET`; write methods (scrobbling, tagging, love/unlove, session management) require `POST` with an authenticated session key and a signed `api_sig` parameter (MD5 of sorted params + shared secret). Responses default to XML; pass `format=json` for JSON. ' termsOfService: https://www.last.fm/api/tos contact: name: Last.fm API Support url: https://www.last.fm/api email: partners@last.fm license: name: Last.fm API Terms of Service url: https://www.last.fm/api/tos servers: - url: https://ws.audioscrobbler.com/2.0 description: Production AudioScrobbler endpoint - url: http://ws.audioscrobbler.com/2.0 description: Non-TLS endpoint (legacy) security: - ApiKeyAuth: [] - SignedAuth: [] tags: - name: User description: User profile, friends, listening history, top entities, and weekly charts. paths: /: get: operationId: invokeReadMethod summary: Invoke A Read Method description: 'Single read-side dispatch endpoint. The `method` parameter selects the operation (e.g. `album.getInfo`, `artist.getTopTracks`, `chart.getTopArtists`). Use `format=json` for JSON responses. ' tags: - User parameters: - $ref: '#/components/parameters/MethodParam' - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - $ref: '#/components/parameters/CallbackParam' - name: artist in: query schema: type: string description: Artist name (used by album.*, artist.*, track.* read methods). - name: album in: query schema: type: string description: Album name (used by album.* methods). - name: track in: query schema: type: string description: Track name (used by track.* methods). - name: mbid in: query schema: type: string description: MusicBrainz identifier; takes precedence over artist/album/track names. - name: user in: query schema: type: string description: Last.fm username (used by user.* methods). - name: tag in: query schema: type: string description: Tag name (used by tag.* methods). - name: country in: query schema: type: string description: ISO 3166-1 country name (used by geo.* methods). - name: limit in: query schema: type: integer default: 50 maximum: 1000 description: Max items per page. - name: page in: query schema: type: integer default: 1 description: Page number for paginated results. - name: period in: query schema: type: string enum: - overall - 7day - 1month - 3month - 6month - 12month description: Aggregation window for user.getTop* methods. - name: autocorrect in: query schema: type: integer enum: - 0 - 1 default: 0 description: Auto-correct misspelled artist/track names when set to 1. - name: username in: query schema: type: string description: Username context for personalized fields (playcount, userplaycount). responses: '200': description: Successful response in XML (default) or JSON (`format=json`). content: application/json: schema: oneOf: - $ref: '#/components/schemas/AlbumInfoResponse' - $ref: '#/components/schemas/ArtistInfoResponse' - $ref: '#/components/schemas/TrackInfoResponse' - $ref: '#/components/schemas/TagInfoResponse' - $ref: '#/components/schemas/UserInfoResponse' - $ref: '#/components/schemas/ChartResponse' - $ref: '#/components/schemas/GeoResponse' - $ref: '#/components/schemas/SearchResponse' application/xml: schema: type: string description: XML payload wrapped in ``. '400': $ref: '#/components/responses/ErrorResponse' '403': $ref: '#/components/responses/ErrorResponse' '429': $ref: '#/components/responses/ErrorResponse' /?method=user.getFriends: get: operationId: userGetFriends summary: Get User Friends tags: - User description: Get a list of the user's friends on Last.fm. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: recenttracks in: query schema: type: integer enum: - 0 - 1 - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: User friends list. content: application/json: schema: type: object additionalProperties: true /?method=user.getInfo: get: operationId: userGetInfo summary: Get User Info tags: - User description: Get information about a user profile. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string responses: '200': description: User profile envelope. content: application/json: schema: $ref: '#/components/schemas/UserInfoResponse' /?method=user.getLovedTracks: get: operationId: userGetLovedTracks summary: Get Loved Tracks tags: - User description: Get the last 50 tracks loved by a user. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: User loved tracks. content: application/json: schema: type: object additionalProperties: true /?method=user.getPersonalTags: get: operationId: userGetPersonalTags summary: Get Personal Tags tags: - User description: Get the user's personal tags for an artist, album, or track. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: tag in: query required: true schema: type: string - name: taggingtype in: query required: true schema: type: string enum: - artist - album - track - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: Personal tags. content: application/json: schema: type: object additionalProperties: true /?method=user.getRecentTracks: get: operationId: userGetRecentTracks summary: Get Recent Tracks tags: - User description: Get a list of the recent tracks listened to by this user. Also includes the currently playing track if there is one. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: limit in: query schema: type: integer default: 50 maximum: 200 - name: page in: query schema: type: integer default: 1 - name: from in: query schema: type: integer description: Unix timestamp (UTC). - name: to in: query schema: type: integer description: Unix timestamp (UTC). - name: extended in: query schema: type: integer enum: - 0 - 1 responses: '200': description: Recent tracks for the user. content: application/json: schema: $ref: '#/components/schemas/RecentTracksResponse' /?method=user.getTopAlbums: get: operationId: userGetTopAlbums summary: Get User Top Albums tags: - User description: Get the top albums listened to by a user. You can stipulate a time period. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: period in: query schema: type: string enum: - overall - 7day - 1month - 3month - 6month - 12month - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: Top albums for the user. content: application/json: schema: $ref: '#/components/schemas/TopAlbumsResponse' /?method=user.getTopArtists: get: operationId: userGetTopArtists summary: Get User Top Artists tags: - User description: Get the top artists listened to by a user. You can stipulate a time period. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: period in: query schema: type: string enum: - overall - 7day - 1month - 3month - 6month - 12month - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: Top artists for the user. content: application/json: schema: $ref: '#/components/schemas/ChartResponse' /?method=user.getTopTags: get: operationId: userGetTopTags summary: Get User Top Tags tags: - User description: Get the top tags used by this user. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: limit in: query schema: type: integer default: 50 responses: '200': description: Top tags used by the user. content: application/json: schema: $ref: '#/components/schemas/TopTagsResponse' /?method=user.getTopTracks: get: operationId: userGetTopTracks summary: Get User Top Tracks tags: - User description: Get the top tracks listened to by a user. You can stipulate a time period. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: period in: query schema: type: string enum: - overall - 7day - 1month - 3month - 6month - 12month - name: limit in: query schema: type: integer default: 50 - name: page in: query schema: type: integer default: 1 responses: '200': description: Top tracks for the user. content: application/json: schema: $ref: '#/components/schemas/TopTracksResponse' /?method=user.getWeeklyAlbumChart: get: operationId: userGetWeeklyAlbumChart summary: Get Weekly Album Chart tags: - User description: Get an album chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent week. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: from in: query schema: type: integer - name: to in: query schema: type: integer responses: '200': description: Weekly album chart for the user. content: application/json: schema: $ref: '#/components/schemas/TopAlbumsResponse' /?method=user.getWeeklyArtistChart: get: operationId: userGetWeeklyArtistChart summary: Get Weekly Artist Chart tags: - User description: Get an artist chart for a user profile, for a given date range. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: from in: query schema: type: integer - name: to in: query schema: type: integer responses: '200': description: Weekly artist chart. content: application/json: schema: $ref: '#/components/schemas/ChartResponse' /?method=user.getWeeklyChartList: get: operationId: userGetWeeklyChartList summary: Get Weekly Chart List tags: - User description: Get a list of available charts for this user, expressed as date ranges that can be sent to the chart services. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string responses: '200': description: Available chart ranges. content: application/json: schema: type: object additionalProperties: true /?method=user.getWeeklyTrackChart: get: operationId: userGetWeeklyTrackChart summary: Get Weekly Track Chart tags: - User description: Get a track chart for a user profile, for a given date range. parameters: - $ref: '#/components/parameters/ApiKeyParam' - $ref: '#/components/parameters/FormatParam' - name: user in: query required: true schema: type: string - name: from in: query schema: type: integer - name: to in: query schema: type: integer responses: '200': description: Weekly track chart. content: application/json: schema: $ref: '#/components/schemas/TopTracksResponse' components: schemas: TopTracksResponse: type: object properties: toptracks: type: object properties: track: type: array items: $ref: '#/components/schemas/Track' Artist: type: object properties: name: type: string mbid: type: string url: type: string format: uri image: type: array items: $ref: '#/components/schemas/Image' streamable: type: string ontour: type: string stats: type: object properties: listeners: type: string playcount: type: string similar: type: object properties: artist: type: array items: $ref: '#/components/schemas/Artist' tags: type: object properties: tag: type: array items: $ref: '#/components/schemas/Tag' bio: $ref: '#/components/schemas/Wiki' SearchResponse: type: object properties: results: type: object properties: opensearch:Query: type: object additionalProperties: true opensearch:totalResults: type: string opensearch:startIndex: type: string opensearch:itemsPerPage: type: string albummatches: type: object properties: album: type: array items: $ref: '#/components/schemas/Album' artistmatches: type: object properties: artist: type: array items: $ref: '#/components/schemas/Artist' trackmatches: type: object properties: track: type: array items: $ref: '#/components/schemas/Track' Image: type: object properties: size: type: string enum: - small - medium - large - extralarge - mega '#text': type: string format: uri ChartResponse: type: object properties: artists: type: object properties: artist: type: array items: $ref: '#/components/schemas/Artist' AlbumInfoResponse: type: object properties: album: $ref: '#/components/schemas/Album' ArtistInfoResponse: type: object properties: artist: $ref: '#/components/schemas/Artist' TopTagsResponse: type: object properties: toptags: type: object properties: tag: type: array items: $ref: '#/components/schemas/Tag' Track: type: object properties: name: type: string mbid: type: string url: type: string format: uri duration: type: string artist: $ref: '#/components/schemas/Artist' album: type: object properties: artist: type: string title: type: string mbid: type: string url: type: string format: uri listeners: type: string playcount: type: string userplaycount: type: string userloved: type: string enum: - '0' - '1' toptags: type: object properties: tag: type: array items: $ref: '#/components/schemas/Tag' wiki: $ref: '#/components/schemas/Wiki' '@attr': type: object properties: nowplaying: type: string date: type: object properties: uts: type: string '#text': type: string TrackInfoResponse: type: object properties: track: $ref: '#/components/schemas/Track' Tag: type: object properties: name: type: string url: type: string format: uri count: type: integer UserProfile: type: object properties: name: type: string realname: type: string url: type: string format: uri country: type: string age: type: string gender: type: string subscriber: type: string playcount: type: string playlists: type: string bootstrap: type: string registered: type: object properties: unixtime: type: string '#text': type: string image: type: array items: $ref: '#/components/schemas/Image' TopAlbumsResponse: type: object properties: topalbums: type: object properties: album: type: array items: $ref: '#/components/schemas/Album' Wiki: type: object properties: published: type: string summary: type: string content: type: string GeoResponse: type: object properties: topartists: type: object properties: artist: type: array items: $ref: '#/components/schemas/Artist' Album: type: object properties: artist: type: string name: type: string mbid: type: string url: type: string format: uri image: type: array items: $ref: '#/components/schemas/Image' listeners: type: string playcount: type: string tracks: type: object properties: track: type: array items: $ref: '#/components/schemas/Track' tags: type: object properties: tag: type: array items: $ref: '#/components/schemas/Tag' wiki: $ref: '#/components/schemas/Wiki' RecentTracksResponse: type: object properties: recenttracks: type: object properties: track: type: array items: $ref: '#/components/schemas/Track' '@attr': type: object properties: user: type: string page: type: string perPage: type: string totalPages: type: string total: type: string UserInfoResponse: type: object properties: user: $ref: '#/components/schemas/UserProfile' ErrorPayload: type: object properties: error: type: integer description: 'Numeric Last.fm error code. Common: 2 invalid service, 3 invalid method, 4 authentication failed, 5 invalid format, 6 invalid parameters, 7 invalid resource, 8 operation failed, 9 invalid session key, 10 invalid api key, 11 service offline, 13 invalid method signature, 16 service temporarily unavailable, 26 suspended api key, 29 rate limit exceeded. ' message: type: string TagInfoResponse: type: object properties: tag: type: object properties: name: type: string total: type: integer reach: type: integer wiki: $ref: '#/components/schemas/Wiki' responses: ErrorResponse: description: Error response (status='failed'). content: application/json: schema: $ref: '#/components/schemas/ErrorPayload' application/xml: schema: type: string description: '`message`' parameters: MethodParam: name: method in: query required: true schema: type: string description: 'Method name in `package.method` format (e.g. `track.getInfo`, `chart.getTopArtists`, `user.getRecentTracks`). ' FormatParam: name: format in: query schema: type: string enum: - xml - json default: xml description: Response format. Defaults to XML. ApiKeyParam: name: api_key in: query required: true schema: type: string description: Your Last.fm API key. CallbackParam: name: callback in: query schema: type: string description: Optional JSONP callback function name when `format=json`. securitySchemes: ApiKeyAuth: type: apiKey in: query name: api_key description: Required on all calls. Obtain from https://www.last.fm/api/account/create. SignedAuth: type: apiKey in: query name: api_sig description: 'MD5 signature of all request parameters (excluding format and callback) sorted alphabetically by name, concatenated as name+value pairs, with the shared secret appended. Required for all write/auth methods. '