# Table of Contents - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Terms of Service | Last.fm](#api-terms-of-service-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [Login | Last.fm](#login-last-fm) - [Login | Last.fm](#login-last-fm) - [Login | Last.fm](#login-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [API Docs | Last.fm](#api-docs-last-fm) - [Page Not Found | Last.fm](#page-not-found-last-fm) --- # API Docs | Last.fm [#](#last-fm-music-discovery-api) Last.fm Music Discovery API ============================================================== The Last.fm API allows anyone to build their own programs using Last.fm data. [Find out more](/api/intro) about how you can plug directly into our vast database or browse the list of methods on the left. [#](#getting-started) Getting started -------------------------------------- Our API is available to anyone. Here's what you need to get going: 1. [Get an API account](/api/account/create) 2. [Read the Documentation](/api/intro) 3. [Join the Support Forums](https://support.last.fm/c/support/api) Commercial or Research Usage If you are planning to use our API for commercial or research/academic purposes, please contact us prior to use via email at [partners@last.fm](mailto:partners@last.fm) . [Introduction](/api/intro) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#authentication-web-application-how-to) Authentication: Web Application How-To =================================================================================== This authentication how-to is for web applications only. Desktop application developers should see the [desktop application how-to](/api/desktopauth) . [#](#_1-get-an-api-key) 1. Get an API Key ------------------------------------------ If you don’t already have an API account, please [apply for one](/api/account/create) . For each of your [accounts](/api/accounts) you will have a **shared secret** which you will require in [Section 6](#_6-sign-your-calls) . You will also need to set up a **callback url** which our authentication service will redirect to in [Section 4](#_4-fetch-a-web-service-session) . [#](#_2-request-authorization-from-the-user) 2. Request authorization from the user ------------------------------------------------------------------------------------ Send your user to [last.fm/api/auth](/api/auth) with your API key as a parameter. Use an HTTP GET request. Your request will look like this: http://www.last.fm/api/auth/?api_key=xxx If the user is not logged in to Last.fm, they will be redirected to the login page before being asked to grant your web application permission to use their account. On this page they will see the name of your application, along with the application description and logo as supplied in Section 1. ### [#](#_2-1-custom-callback-url) 2.1 Custom callback url You can optionally specify a callback URL that is different to your API Account callback url. Include this as a query param `cb` . This allows you to have users forward to a specific part of your site after the authorisation process. http://www.last.fm/api/auth/?api_key=xxx&cb=http://example.com [#](#_3-create-an-authentication-handler) 3. Create an authentication handler ------------------------------------------------------------------------------ Once the user has granted permission to use their account on the Last.fm page, Last.fm will redirect to your **callback url**, supplying an authentication token as a GET variable. /?token=xxxxxxx If the **callback url** already contains a query string then token variable will be appended, like; &token=xxxxxxx The script located at your callback url should pick up this authentication token and use it to create a Last.fm web service session as described in Section 4. ### [#](#_3-1-authentication-tokens) 3.1 Authentication Tokens Authentication tokens are user and API account specific. They are valid for 60 minutes from the moment they are granted. [#](#_4-fetch-a-web-service-session) 4. Fetch a Web Service Session -------------------------------------------------------------------- Send your api key along with an api signature and your authentication token as arguments to the [auth.getSession](/api/show/auth.getSession) API method call. The parameters for this call are defined as such: **api\_key**: Your 32-character API Key. **token**: The authentication token received at your callback url as a GET variable. **api\_sig**: Your 32-character API method signature, as explained in [Section 6](#_6-sign-your-calls) Note: You can only use an authentication token once. It will be consumed when creating your web service session. The response format of this call is shown on the [auth.getSession](/api/show/auth.getSession) method page. ### [#](#_4-1-session-lifetime) 4.1 Session Lifetime Session keys have an infinite lifetime by default. You are recommended to store the key securely. Users are able to revoke privileges for your application on their Last.fm settings screen, rendering session keys invalid. [#](#_5-make-authenticated-web-service-calls) 5. Make authenticated web service calls -------------------------------------------------------------------------------------- You can now sign your web service calls with a method signature, provided along with the session key you received in [Section 4](#_4-fetch-a-web-service-session) and your API key. You will need to include all three as parameters in subsequent calls in order to be able to access services that require authentication. You can visit individual method call pages to find out if they require authentication. Your three authentication parameters are defined as: **sk** (Required) : The session key returned by [auth.getSession](/api/show/auth.getSession) service. **api\_key** (Required) : Your 32-character API key. **api\_sig** (Required) : Your API method signature, constructed as explained in [Section 6](#6) [#](#_6-sign-your-calls) 6. Sign your calls -------------------------------------------- Construct your api method signatures by first ordering all the parameters sent in your call alphabetically by parameter name and concatenating them into one string using a `` scheme. So for a call to `auth.getSession` you may have: **api_key**xxxxxxxx**method**auth.getSession**token**xxxxxxx Ensure your parameters are [utf8](http://www.utf-8.com) encoded. Now append your **secret** to this string. Finally, generate an [md5](http://en.wikipedia.org/wiki/MD5) hash of the resulting string. For example, for an account with a secret equal to 'mysecret', your api signature will be: api signature = md5("api_keyxxxxxxxxmethodauth.getSessiontokenxxxxxxxmysecret") Where `md5()` is an md5 hashing operation and its argument is the string to be hashed. The hashing operation should return a 32-character hexadecimal md5 hash. ← [Introduction](/api/intro) [Mobile How-To](/api/mobileauth) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-authentication) User Authentication ============================================== The authentication API provides third-parties with a secure means of creating Last.fm user sessions over the Last.fm API, for deeper integration with our platform. All _write_ services require authentication. [#](#_1-get-an-api-key) 1. Get an API Key ------------------------------------------ You will need to [apply for a key](/api/account/create) before authenticating with the API. [#](#_2-configure-your-api-account) 2. Configure Your API Account ------------------------------------------------------------------ Head over to your [api accounts page](/api/accounts) , and select the account you wish to configure. You need to supply an application name, a description and an optional logo. Each of your account pages contains an _API key_ and _secret_; you will need both to use the API. [#](#_3-choose-your-authentication-path) 3. Choose your authentication path ---------------------------------------------------------------------------- * If you're building a web application, see the [web application how-to](/api/webauth) for more details. * If you're building a desktop application, see the [desktop application how-to](/api/desktopauth) for more details. * If you're building on a standalone device such as a mobile phone, see the [mobile how-to](/api/mobileauth) for more details. In some cases, you may want to choose a different authentication path from the obvious (e.g. a mobile app could well use the desktop path if there's a web browser on the device). If in doubt, check them all out. [#](#_4-authentication-spec) 4. Authentication Spec ---------------------------------------------------- See the full [authentication API specification](/api/authspec) for an overview of the API. API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#introduction) Introduction ================================ The Last.fm API allows you to call _methods_ that respond in [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) style xml. Individual methods are detailed in the menu on the left. API ROOT The API root URL is located at [http://ws.audioscrobbler.com/2.0/](http://ws.audioscrobbler.com/2.0) Generally speaking, you will send a _method_ parameter expressed as 'package.method' along with method specific arguments to the root URL. The API supports multiple transport formats but will respond in Last.fm idiom xml by default. Note: * Please use an identifiable User-Agent header on all requests. This helps our logging and reduces the risk of you getting banned. * Be reasonable in your usage of the API and ensure you don't make an excessive number of calls as that can impact the reliability of the service to you and other users. We encourage best practice implementation, for example, if you're making a web application, try not to hit the API on page load. Your account may be suspended if your application is continuously making several calls per second or if you’re making excessive calls. See our [API Terms of Service](/api/tos) for more information on limits. * If you are planning to use our API for commercial purposes, please contact us via email at [partners@last.fm](mailto:partners@last.fm) . * We assume that you are using an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) \-compliant HTTP client to access the web services. In particular, pay attention to your url encoding. This will not be an issue for 99% of developers. [#](#encoding) Encoding ------------------------ Use [UTF-8](http://www.utf-8.com) encoding when sending arguments to API methods. [#](#request-styles) Request Styles ------------------------------------ You can get more information on how to work with [REST requests](/api/rest) or [XML-RPC requests](/api/xmlrpc) when calling the Last.fm API. [#](#authentication) Authentication ------------------------------------ The [authentication protocol](/api/authentication) allows you to perform actions on user accounts in a manner that is secure for Last.fm users. All write services require authentication. [#](#scrobbling) Scrobbling ---------------------------- We encourage services that use the Last.fm API to build-in scrobbling natively into their applications (where applicable, and particularly for media players), to allow users to send listening data in to their Last.fm user profiles. This can be done through our [Scrobbling API](/api/scrobbling) . [#](#discussion) Discussion ---------------------------- Join the [Last.fm Support Forums](https://support.last.fm/c/support/api) for information about new Web Services, access to beta API's, provide feedback and discuss development with other developers. [#](#terms-of-service) Terms of Service ---------------------------------------- For our API Terms of Service please see [here](/api/tos) ← [Last.fm API](/api) [Web How-To](/api/webauth) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#radio-api) Radio API ========================== DEPRECATED This functionality is no longer supported. Documentation exists for reference only. [#](#who-can-i-stream-radio-to) Who can I stream radio to? ----------------------------------------------------------- Warning Any API account can **only** stream radio to Last.fm's paid **subscribers** **Note:** Due to licensing restrictions, you may not use the radio API on mobile telephones. [#](#tuning-the-radio) Tuning the Radio ---------------------------------------- The radio API requires authentication. See the [authentication](/api/authentication) how-to. Once authenticated, you can tune the radio using the ~radio.tune~ API method. This takes a **station** parameter that must correspond to a last.fm protocol station url. Here is the general scheme of these URLs: lastfm://// Here is a list of the station types currently publicly available, with example protocol URLs: * **Artist** * Similar Artists Radio (e.g. ~lastfm://artist/cher/similarartists~ ) * Top Fans Radio (e.g. ~lastfm://artist/cher/fans~ ) * **User** * Library Radio (e.g. ~lastfm://user/last.hq/personal~ ) * Mix Radio (e.g. ~lastfm://user/last.hq/loved~ ) * Recommendation Radio (e.g. ~lastfm://user/last.hq/recommended~ ) * Neighbours Radio (e.g. ~lastfm://user/last.hq/neighbours~ ) * **Tag** * Global Tag Radio (e.g. ~lastfm://globaltags/disco~ ) [#](#fetching-radio-content) Fetching Radio Content ---------------------------------------------------- Once the station is tuned, use the API method ~radio.getPlaylist~ to fetch content in XSPF format (see the [XSPF specification](http://www.xspf.org) ). You will need to periodically pull on this XSPF service as it will provide content in small chunks. We recommend you prefetch a new XSPF before reaching the end of the last. The XSPF will look like this: +Cher+Similar+Artists Last.fm 2007-11-26T17:34:38 3600 http://play.last.fm/....mp3 Two People (Live) 8212510 Tina Live In Europe Tina Turner 265000 http://images.amazon.com/images/... 12345 http://www.last.fm/music/Tina+Turner http://www.last.fm/music/... http://www.last.fm/music/... ... ... The **expiry** extension is used to communicate in seconds (from the granting of the XSPF), how long any of the track URLs in your XSPF are valid for. If you request any tracks after this expiry period you will receive errors from our streaming service (see below). Note the **extension** node, which holds last.fm specific information relating to the track. The **trackauth** extension is now deprecated and can be ignored. Use the **location** nodes to fetch individual tracks. All tracks must be requested once and only once, in the order supplied in the XSPF. Requesting the same track multiple times will result in an HTTP error returned from our streamers. Note that the track URLs provided will force an HTTP 302 redirect to the actual track location. Please ensure your streaming library supports HTTP redirects when fetching tracks All tracks streamed are encoded as 128kbps [MP3](http://en.wikipedia.org/wiki/MP3) files. We recommend clients begin playback as soon as a reasonable buffer (6-8 seconds) has been fetched. Do not attempt to store the file locally other than maintaining a reasonable buffer. Pausing playback is strictly not allowed and our streamers will return an error if you attempt to reconnect to the track more than once. [#](#streamer-error-codes) Streamer Error Codes ------------------------------------------------ * **HTTP 403** - Invalid ticket: You may be requesting tracks in the wrong order, your playlist may have expired or you have attempted to fetch the same track URL multiple times. * **HTTP 503** - Unexpected Error: Our streamers are not healthy. Try again later. ← [Scrobbling 2.0 Documentation](/api/scrobbling) [Playlists API](/api/playlists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Terms of Service | Last.fm API Terms of Service ==================== If you are planning to use our API for commercial or research/academic purposes, or have any questions about the license terms, please drop us a line prior to use via email at partners \[at\] last \[dot\] fm Please carefully read this agreement (the "agreement") before using Last.fm's webservices, as it affects your legal rights and obligations. This Agreement governs the way that You are permitted to access Last.fm Data (as defined below) via the API. By accessing the API, You agree to accept and abide by the terms set out in this Agreement in respect of Your access to and use of the Last.fm Data. The terms of this Agreement may be updated by Last.fm from time to time by providing you with written notice containing the updated terms. Any such updated terms shall supersede and replace the terms of this Agreement. By continuing to use any Last.fm Data, you will be deemed to have accepted the updated terms. If you do not agree to be bound by this agreement, do not use Last.fm's webservices. The terms in a nutshell ----------------------- * Last.fm grants You a limited terminable licence to copy and use the Last.fm Data, subject to certain restrictions set out in this Agreement and any additional restrictions arising from changes to Last.fm's Privacy Policy from time to time. * Although You are granted this licence without charge, Last.fm reserves the right to share in revenue generated from your use of Last.fm Data in future on terms to be negotiated in good faith between Last.fm and You. * This Agreement covers only Your use of Last.fm Data. You must not sub-license the Last.fm Data to others. * This Agreement does not entitle you to stream music or other content available on the Last.fm Site. * You must not transmit, export, transfer, divert, or send any Last.fm Data to any country without obtaining any consents or authorisations required by law or regulation in such country. * You must credit Last.fm and include links to the Last.fm site when You use the Last.fm Data. * You must comply with the Last.fm Brand Guidelines that can be downloaded from http://www.last.fm/resources/ 1\. Definitions --------------- * **"API"** means the application programming interface that supports requests for web services made of it by computer programs * **"Data storage"** means any database, spreadsheet, chart, physical document, server, network, or other means of storing information, whether created or distributed by You or otherwise. * **"Last.fm Data"** means any data, images, text, content or other information or materials made available to You by Last.fm through the API. * **"Last.fm Site"** means Last.fm's website and all related properties, the url of which is located at www.last.fm * **"Term"** shall mean the duration of this Agreement which shall start on the date that Last.fm provides you with an API key pursuant to Clause 2.6 (evidenced by Last.fm's server logs) and shall continue unless and until terminated in accordance with Clause 9. * **"User(s)"** means a user of the Last.fm Site. 2\. Conditions of Use --------------------- ### 2.1 Your access to and use of the API and the Last.fm Data is subject to the terms of this Agreement, the Last.fm Site Terms of Use as posted on the Last.fm Site at http://www.last.fm/legal/terms and updated from time to time and the [Last.fm Privacy Policy](/legal/privacy)  as posted on the Last.fm Site at http://www.last.fm/legal/privacy and updated from time to time, each of which is incorporated into this Agreement by reference. If Last.fm has granted you permission to use the API and Last.fm Data for commercial purposes in accordance with the Commercial Use Terms, such Commercial Use Terms shall also form part of this Agreement. For more information about how to apply to use the API and Last.fm Data for commercial purposes, please contact us via email at partners \[at\] last \[dot\] fm. ### 2.2 You must be a registered User to have access to, retrieve and use the Last.fm Data. ### 2.3 You may access, retrieve, store and use any Last.fm Data in accordance with the laws relating to the storage and processing of data in the country in which You live, provided that if You live in a country outside the European Economic Area, You may only use and access and use Last.fm data in that country if Users have expressly given their permission for You to do so when they registered as a User. ### 2.4 You must at all times in Your use of the Last.fm Data: (i) comply with all local and international laws and regulations, including, all applicable intellectual property and data protection laws; and (ii) obtain all necessary licences and permissions. ### 2.5 You must not transmit, export, transfer, divert or send any Last.fm Data to any country without obtaining any consents or authorisations required under law or regulation in such country. ### 2.6 You agree to only use Last.fm's web services as documented on the following pages: [http://www.audioscrobbler.net/data/webservices/](http://www.audioscrobbler.net/data/webservices/) ; [http://www.last.fm/api/](http://www.last.fm/api/) . Last.fm will provide You with an API key from time to time to access and use the API. You may only use APIs in conjunction with the most recent user authentication key provided to You by Last.fm. You must not gather any other data from Last.fm in any other way. ### 2.7 You agree to use one of the buttons saying "powered by AudioScrobbler" from the page located at http://www.last.fm/resources, such button linking back to Last.fm. All links to Last.fm from pages with profile information for a Last.fm User account should link to the appropriate Last.fm User page (example: http://www.last.fm/user/). All links to Last.fm from pages displaying information on an artist, album or track should link to the appropriate catalogue page on Last.fm. For example: http://www.last.fm/music/, http://www.last.fm/music//, http://www.last.fm/music//\_/. All button/link placements are subject to approval by Last.fm and Last.fm can suggest the use of a button/link of its choice for You to use if Last.fm deems necessary. You agree to only give public access to pages using Last.fm's web services that have been previously approved by Last.fm in writing. ### 2.8 You agree to implement and comply with standards of privacy and confidentiality for the use and sharing of any Last.fm Data or any product thereof that are, as a minimum, as stringent as the standards set out in the Last.fm Privacy Policy as amended and updated by Last.fm from time to time. ### 2.9 Last.fm may use technical measures to track Your use of the Last.fm Data for the purpose of ensuring compliance with this Agreement. 3\. Use of the API and Last.fm Data ----------------------------------- ### 3.1 You are permitted to use the Last.fm Data solely for non-commercial purposes and for no other purpose and subject always to any limitations or conditions as advised to You by Last.fm at any time. If you are unsure whether your use of the Last.fm Data constitutes non-commercial or commercial use, you should contact us. ### 3.2 The permission granted to You at Clause 3.1 is strictly conditional upon Your using the Last.fm Data for non-commercial purposes, as set out above. If at any time you wish to use the Last.fm Data for commercial purposes, you must apply for a commercial use agreement. Any use by You of the Last.fm Data for commercial purposes without obtaining a commercial use agreement constitutes a material breach of this Agreement which shall entitle Last.fm to terminate your use of the Last.fm Data immediately. Any such termination shall be without prejudice to any rights and remedies of Last.fm, including the right to claim for damages against You. 4\. License to use the Last.fm Data ----------------------------------- ### 4.1 Subject to the restrictions set out at Clauses 4.2 and 4.3 below and in consideration of the licence granted to You below, Last.fm grants to You a worldwide, royalty-free, non-exclusive licence for the duration of copyright and any other rights in the Last.fm Data to: (i) copy the Last.fm Data; (ii) edit, modify, adapt or translate the Last.fm Data in any media to create a derivative work (a **"Derivative Work"**); (iii) incorporate the Last.fm Data in its entirety in unmodified form along with a number of other separate and independent works, assembled into a collective whole (a **"Collective Work"**); and (iv) publish, distribute or otherwise communicate the Last.fm Data or the Last.fm Data as incorporated in any Derivative Work or Collective Work to the public in any material form in any media now known. ### 4.2 The licence granted at Clause 4.1 above is conditional upon You: #### 4.2.1 Making reference to the licence granted by Last.fm (appropriate to the media used) on all copies of the Last.fm Data, Derivative Works and/or Collective Works published, distributed or otherwise communicated or made available to the public by You; #### 4.2.2 Crediting Last.fm in the form set out in Clause 2.7 where You have used Last.fm Data or created a Derivative Work and/or Collective Work that You publish, distribute or otherwise communicate to the public; #### 4.2.3 complying with any and all restrictions notified to You by Last.fm in relation to the treatment of any personal data (and for the purposes of this Clause 4.2.3, any changes to Last.fm's Privacy Policy shall automatically constitute notice); and #### 4.2.4 to the extent reasonably practicable, keeping intact all notices that refer to the licence granted to You, if any, that Last.fm specifies to be associated with the Last.fm Data, Derivative Works and/or Collective Works. ### 4.3 The licence granted to You at Clause 4.1 is subject to the following restrictions: #### 4.3.1 You must not impose any terms on the use to be made of the Last.fm Data, a Derivative Work or a Collective Work that alters or restricts the terms of the licence granted to You under this Agreement or which has the effect or intent of restricting the ability to exercise those rights; #### 4.3.2 You must not impose or apply any digital rights management technology to or on the Last.fm Data or the Last.fm Data as incorporated in a Derivative Work or Collective Work that alters or restricts the terms of the licence or any rights granted under it, or has the effect or intent of restricting the ability to exercise those rights; #### 4.3.3 You must not sub-license the Last.fm Data to a third party; and #### 4.3.4 You must not subject the Last.fm Data to any derogatory treatment, including (but not limited to) distortion or mutilation of the Last.fm Data or treatment that is prejudicial (in Last.fm's opinion) to the reputation of Last.fm. For the avoidance of doubt, the licence granted to You is temporary and restricted to a small portion of Last.fm Data available via the API, not to exceed the Reasonable Usage Cap in total at any time. Any use, storage, publication, distribution, communication, making available or otherwise of Last.fm Data in excess of the Reasonable Usage Cap is strictly prohibited. The "Reasonable Usage Cap" is a maximum of 100 MB, as may be updated by Last.fm from time to time. If you would like a larger portion of Last.fm Data, prior written consent from Last.fm is required - please contact us via email at partners \[at\] last \[dot\] fm. You will implement suitable caching in accordance with the HTTP headers sent with web service responses. ### 4.4 Rate Limit: Last.fm sets and enforces limits on use of the API to prevent abuse and ensure reliability of service (e.g. limiting the number of API requests that you may make or the number of users you may serve), in our sole discretion. You agree to, and will not attempt to circumvent, such limitations. If you would like to use the API beyond these limits, you must obtain Last.fm’s express consent (and Last.fm may decline such request or condition acceptance on your agreement to additional terms and/or charges for that use). To seek such approval, please contact us via email at partners \[at\] last \[dot\] fm. ### 4.5 Notwithstanding the licence at clause 4.1, all rights in and to the Last.fm Data (including all copyright and database rights) remain vested in Last.fm. ### 4.6 Last.fm may, from time to time, prevent certain Last.fm Data from being available via the API. ### 4.7 Last.fm respects copyright. You shall not under any circumstances use the Last.fm Data for the purpose of, or in conjunction with, the unauthorised exploitation of intellectual property or for any other purpose which encourages, supports or is in any way associated with unauthorised exploitation. 5\. Warranties and Indemnity ---------------------------- ### 5.1 You warrant and represent to Last.fm that: #### 5.1.1 You have the authority to enter into this Agreement on Your own behalf or on behalf of any company or other legal entity by which You are employed and that wishes to use the Last.fm Data; #### 5.1.2 You will comply with all local and international laws and regulations, including, all applicable intellectual property and data protection laws in connection with Your use and storage of the Last.fm Data; #### 5.1.3 You will obtain and maintain any and all necessary licences and permissions in connection with Your use of the Last.fm Data; #### 5.1.4 Your use of the Last.fm Data will not violate or infringe the rights of any third party, including intellectual property rights or rights of privacy; #### 5.1.5 You will not use the Last.fm Data for any purpose that is fraudulent, misleading or illegal or otherwise than is permitted by this Agreement; #### 5.1.6 You will not use the Last.fm Data for any purpose to enable You to personally identify or contact any User; #### 5.1.7 You will not use the Last.fm Data in any way that is libellous or defamatory of third parties, or is obscene, malicious or discriminatory in any way, including but not limited to race, disability, sex, sexual orientation or religion; #### 5.1.8 You will not use the Last.fm Data in any way or on any website that is associated or promotes, encourages, facilitates or condones the illegal or unauthorised use or sharing of content. You will not use any audio, audiovisual, images and/or artwork, whether or not accessible through the API, and all such content is expressly excluded from this Agreement; #### 5.1.9 You will not interfere or attempt to interfere with the operation or running of the Last.fm Site with any virus, worm, Trojan horse, adware, spyware or any other form of malicious code or software; and #### 5.1.10 You will at all times comply with the terms of this Agreement and any other terms or policies referenced in this Agreement or on the Last.fm Site. ### 5.2 You will not bring any claim against Last.fm, or any of its licensees, assigns or successors, for damages, liabilities, causes of action, judgments, or claims in respect of Your access, retrieval and/or use of the Last.fm Data or any intellectual property You develop that is based on may otherwise arise out of Your use of, reliance on, or reference to the Last.fm Site or Last.fm Data. ### 5.3 You will indemnify, and keep Last.fm, its affiliates, licensees, assigns, successors, customers, Users, all third-party advertisers, technology providers and service providers, and each of their respective employees, directors and representatives (each an "Indemnified Party"), fully and effectively indemnified from and against any and all liabilities, costs, expenses, damages and losses (including any direct, indirect or consequential losses, loss of profit, loss of reputation and all reasonable professional costs and expenses), suffered or incurred by an Indemnified Party arising out of or in connection with any claims, actions or proceedings ("Claims") which arise out of or are related to: (i) Your access, retrieval and use of the Last.fm Data; (ii) any breach of the warranties contained in Clause 5; and (iii) Your violation of any term or condition of this Agreement (including the Last.fm Site Terms of Use and Last.fm Privacy Policy attached). At Last.fm's option, You will assume control of the defence of any Claim and all related settlement negotiations, except that Last.fm shall be entitled to take any action which Last.fm (acting reasonably) deems necessary where You have failed to take action or materially delay taking action in defending or settling a Claim and such failure or delay may, in the opinion of Last.fm, prejudice the interests of Last.fm. In any event, You may not settle any Claim without Last.fm's prior written consent. 6\. Limitation of Liability --------------------------- ### 6.1 Nothing in this agreement shall limit Last.fm's liability for death or personal injury caused by the negligence of Last.fm or its officers, employees or agents or for fraudulent misrepresentations or fraud, or any other liability that cannot be limited or excluded by applicable law. ### 6.2 Last.fm gives no warranties of any kind, whether express, implied, statutory or otherwise, to the fullest extent permitted by law, including warranties of satisfactory quality, fitness for purpose and non infringement in relation to the last.fm site or the last.fm data. ### 6.3 To the extent permitted by applicable law, you acknowledge and agree that you use the last.fm site and the last.fm data at your own risk. the last.fm data and the last.fm site is made available on an "as is" basis and last.fm shall not be liable for the unavailability of the last.fm data or the last.fm site or any fault, defect or error in the last.fm data. ### 6.4 To the extent permitted by applicable law, last.fm shall not be liable to you for any losses of any kind arising under or in relation to your use of the last.fm site or last.fm data, including but not limited to (i) any loss of profits, business, contracts, anticipated savings, goodwill, or revenue; or (ii) any loss or corruption of data; or (iii) consequential loss or damage whatsoever, whether or not such losses or damages arise directly or indirectly and even if either party was aware of the possibility of such loss or damage. 7\. Licence to use Last.fm trade marks -------------------------------------- ### 7.1 Subject to the prior written approval of Last.fm in each case, Last.fm may make available to You certain trade marks, logos or graphics ("Marks") for use in conjunction with Your use of the Last.fm Data. You must comply with the Last.fm Brand Guidelines that can be downloaded from http://www.last.fm/resources/. Your use of the Marks in accordance with in accordance with this Agreement is conditional upon You not using any of the Marks: (i) to represent that Last.fm endorses, sponsors or is connected to Your use of the Last.fm Data, other than to inform third parties that the Last.fm Data originated from Last.fm; or (ii) in any way that is derogatory to or critical of Last.fm or any officer, director, agent, employee, affiliate, parent or subsidiary of Last.fm. ### 7.2 Last.fm is the worldwide owner of the Marks (whether registered or unregistered) and retains all right, title and interest in and to the Marks. Any and all goodwill arising from Your use of the Marks shall accrue to Last.fm. You will not copy or use the Marks in any way not authorised by Last.fm in writing or this Agreement. You will abide by any and all conditions set out by Last.fm in connection with Your use of the Marks and must not challenge the validity of the Marks or attempt to register similar or trade marks, service marks or logos. ### 7.3 Last.fm reserves the right to withdraw its consent for You to use the Marks at any time. Upon withdrawal of consent, You shall immediately discontinue Your use of the Marks. 8\. Publicity ------------- ### 8.1 Last.fm may, at any time in its sole discretion, prepare and issue press releases, statements, and promotional and other materials mentioning and/or describing Your use of the Last.fm Data and identifying You as the developer and otherwise describing the relationship between You and Last.fm. ### 8.2 You are not permitted to issue any publicity in connection with Your use of the Last.fm Data without the prior written consent of Last.fm. 9\. Term and Termination ------------------------ ### 9.1 This Agreement shall continue on an ongoing basis during the Term, subject to any earlier termination pursuant to clause 9.2. ### 9.2 You may terminate this Agreement at any time by sending an email to partners \[at\] last \[dot\] fm which shall be deemed to have been given on the date that the email is read by Last.fm (evidenced by a read receipt automatically sent to You). You acknowledge and agree that Last.fm may at any time in its sole discretion, without liability and with or without cause terminate this Agreement and/or terminate, restrict, block, disable or suspend Your access to the Last.fm Site or the Last.fm Data or any portion or feature of any of them. ### 9.3 Upon any termination of this Agreement, You must immediately discontinue Your use of the Last.fm API and as soon as reasonably possible delete all Last.fm Data in Your possession or control. Clauses 2.3, 2.4, 2.5, 2.6, 4.2.2, 5, 6, 7, 8 and 10 and any definitions that are necessary to give effect to such Clauses will survive any termination of Your use of the Last.fm Site or Last.fm Data and will continue to bind You and Last.fm in accordance with this Agreement. 10\. General ------------ ### 10.1 Last.fm reserves its right to amend this Agreement or any other document referenced in this Agreement at any time in its sole discretion by sending a new or amended version of this Agreement to You by email and by posting new or updated Last.fm Site Terms of Use and/or the Privacy Policy on the Last.fm Site. ### 10.2 Nothing in this Agreement shall be construed as constituting a partnership, joint venture or relationship of employer and employee between the parties. ### 10.3 This Agreement (and any other document incorporated into this Agreement by reference) sets out the entire agreement and understanding between You and Last.fm and supersedes all previous agreements, representations and arrangements between You and Last.fm (either oral or written). Nothing in this Clause shall limit or exclude any liability for fraudulent misrepresentation. ### 10.4 This Agreement will be binding upon and inure to the benefit of the parties and their respective successors and assigns. ### 10.5 Each of Last.fm's affiliates are express and intended third party beneficiaries of this Agreement and may enforce any of its terms and exercise any of the rights to the same extent as Last.fm. ### 10.6 Third party advertisers, technology providers and service providers are express and intended third-party beneficiaries of Clause 4.3 and are entitled to directly enforce their rights hereunder. ### 10.7 This Agreement shall be governed by the laws of England and the parties agree to submit to the exclusive jurisdiction of the Courts of England. ### 10.8 Except as set out at Clauses 10.6 and 10.7 above, nothing in this Agreement is intended to confer on any third party (whether referred to in this Agreement by name, class, description or otherwise) any benefit or any right under any legislation in any country to enforce any provision of this Agreement. THIS AGREEMENT SETS OUT THE CONDITIONS OF LAST.FM GIVING YOU ACCESS TO LAST.FM DATA ONLY. IF YOU ARE UNSURE ABOUT ANY PART OF THIS AGREEMENT, LAST.FM RECOMMENDS THAT YOU OBTAIN INDEPENDENT LEGAL ADVICE. API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#authentication-desktop-application-how-to) Authentication: Desktop Application How-To =========================================================================================== This authentication how-to is for desktop applications only. Web application developers should see the [web application how-to](/api/webauth) . [#](#_1-get-an-api-key) 1. Get an API Key ------------------------------------------ If you don’t already have an API account, please [apply for one](/api/account/create) . For each of your [accounts](/api/accounts) you will have a **shared secret** which you will require in [Section 6](#_6-sign-your-calls) . You will also need to set up a **callback url** which our authentication service will redirect to in [Section 4](#_4-fetch-a-web-service-session) . [#](#_2-fetch-a-request-token) 2. Fetch a request token -------------------------------------------------------- Make an API method call to the [auth.getToken](/api/show/auth.getToken) service. You should send the following arguments to that call: **api\_key**: Your 32-character API Key. **api\_sig**: A 32-character API method signature, constructed as explained in [Section 6](#_6-sign-your-calls) This will return a token. To see the response format check the method documentation page. The token is not authorized by the user at this stage. ### [#](#_2-1-authentication-tokens) 2.1 Authentication Tokens Authentication tokens are API account specific. They are valid for 60 minutes from the moment they are granted. [#](#_3-request-authorization-from-the-user) 3. Request authorization from the user ------------------------------------------------------------------------------------ Your application needs to open a web browser and send the user to [last.fm/api/auth](/api/auth) with your API key and auth token as parameters. Use an HTTP GET request. Your request will look like this: http://www.last.fm/api/auth/?api_key=xxxxxxxxxxx&token=xxxxxxxx If the user is not logged in to Last.fm, they will be redirected to the login page before being asked to grant your application permission to use their account. On this page they will see the name of your application, along with the application description and logo as supplied in Section 1. Once the user has granted your application permission to use their account, the browser-based process is over and the user is asked to close their browser and return to your application. [#](#_4-fetch-a-web-service-session) 4. Fetch A Web Service Session -------------------------------------------------------------------- Send your api key along with an api signature and your authentication token as arguments to the [auth.getSession](/api/show/auth.getSession) API method call. The parameters are defined as such: **api\_key**: Your 32-character API Key. **token**: The authentication token received from the auth.getToken method call. **api\_sig**: Your 32-character API method signature, as explained in [Section 6](#_6-sign-your-calls) Note: You can only use an authentication token once. It will be consumed when creating your web service session. The response format of this call is shown on the [auth.getSession](/api/show/auth.getSession) method page. ### [#](#_4-1-session-lifetime) 4.1 Session Lifetime Session keys have an infinite lifetime by default. You are recommended to store the key securely. Users are able to revoke privileges for your application on their Last.fm settings screen, rendering session keys invalid. [#](#_5-make-authenticated-web-service-calls) 5. Make authenticated web service calls -------------------------------------------------------------------------------------- You can now sign your web service calls with a method signature, provided along with the session key you received in [Section 4](#_4-fetch-a-web-service-session) and your API key. You will need to include all three as parameters in subsequent calls in order to be able to access services that require authentication. You can visit individual method call pages to find out if they require authentication. Your three authentication parameters are defined as: **sk** (Required) : The session key returned by [auth.getSession](/api/show/auth.getSession) service. **api\_key** (Required) : Your 32-character API key. **api\_sig** (Required) : Your API method signature, constructed as explained in [Section 6](#_6-sign-your-calls) [#](#_6-sign-your-calls) 6. Sign your calls -------------------------------------------- Construct your api method signatures by first ordering all the parameters sent in your call alphabetically by parameter name and concatenating them into one string using a `` scheme. So for a call to _auth.getSession_ you may have: **api_key**xxxxxxxx**method**auth.getSession**token**xxxxxxx Ensure your parameters are [utf8](http://www.utf-8.com) encoded. Now append your **secret** to this string. Finally, generate an [md5](http://en.wikipedia.org/wiki/MD5) hash of the resulting string. For example, for an account with a secret equal to 'mysecret', your api signature will be: api signature = md5("api_keyxxxxxxxxmethodauth.getSessiontokenxxxxxxxmysecret") Where `md5()` is an md5 hashing operation and its argument is the string to be hashed. The hashing operation should return a 32-character hexadecimal md5 hash. ← [Mobile How-To](/api/mobileauth) [Auth Spec](/api/authspec) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-addtags) artist.addTags ==================================== Tag an artist with one or more user supplied tags. [#](#params) Params -------------------- **artist** (Required) : The artist name **tags** (Required) : A comma delimited list of user supplied tags to apply to this artist. Accepts a maximum of 10 tags. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.search](/api/show/album.search) [artist.getCorrection](/api/show/artist.getCorrection) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-search) album.search ================================ Search for an album by name. Returns album matches sorted by relevance. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=album.search&album=believe&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=album.search&album=believe&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=album.search&album=believe&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=album.search&album=believe&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **limit** (Optional) : The number of results to fetch per page. Defaults to 30. **page** (Optional) : The page number to fetch. Defaults to first page. **album** (Required) : The album name **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- 734 0 20 Make Believe Weezer 2025180 http://www.last.fm/music/Weezer/Make+Believe http://userserve-ak.last.fm/serve/34/8673675.jpg http://userserve-ak.last.fm/serve/64/8673675.jpg http://userserve-ak.last.fm/serve/126/8673675.jpg 0 ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.removeTag](/api/show/album.removeTag) [artist.addTags](/api/show/artist.addTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-getinfo) album.getInfo ================================== Get the metadata and tracklist for an album on Last.fm using the album name or a musicbrainz id. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=album.getinfo&api\_key=YOUR\_API\_KEY&artist=Cher&album=Believe&format=json](http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=YOUR_API_KEY&artist=Cher&album=Believe&format=json) **XML:** [/2.0/?method=album.getinfo&api\_key=YOUR\_API\_KEY&artist=Cher&album=Believe](http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=YOUR_API_KEY&artist=Cher&album=Believe) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **album** (Required (unless mbid)\] : The album name **mbid** (Optional) : The musicbrainz id for the album **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **username** (Optional) : The username for the context of the request. If supplied, the user's playcount for this album is included in the response. **lang** (Optional) : The language to return the biography in, expressed as an ISO 639 alpha-2 code. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Believe Cher 2026126 61bf0388-b8a9-48f4-81d1-7eb02706dfb0 http://www.last.fm/music/Cher/Believe 6 Apr 1999, 00:00 ... ... ... 47602 212991 pop http://www.last.fm/tag/pop ... Believe 239 http://www.last.fm/music/Cher/_/Believe 1 Cher bfcc6d75-a6a5-4bc6-8282-47aec8531818 http://www.last.fm/music/Cher ... [#](#attributes) Attributes ---------------------------- * **duration** : In seconds [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.addTags](/api/show/album.addTags) [album.getTags](/api/show/album.getTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#rest-requests) REST Requests ================================== API ROOT The API root URL is located at [http://ws.audioscrobbler.com/2.0/](http://ws.audioscrobbler.com/2.0) Generally speaking, you will send a method parameter expressed as 'package.method' along with method specific arguments to the root URL. The following parameters are required for all calls: **api\_key** : A Last.fm API Key. **method** : An API method expressed as _package.method_, corresponding to a documented last.fm API method name. For example: http://ws.audioscrobbler.com/2.0/?method=artist.getSimilar&api_key=xxx... If you are accessing a _write_ service, you will need to submit your request as an HTTP POST request. All POST requests should be made to the root url: http://ws.audioscrobbler.com/2.0/ With all parameters (including the 'method') sent in the POST body. In order to perform write requests you will need to authenticate a user with the API. See [authentication](/api/authentication) for more. [#](#rest-responses) REST Responses ------------------------------------ Responses will be wrapped in an lfm status node ... Where _$status_ is either **ok** or **failed**. If the status is failed you'll get an error code and message. You can strip the status wrapper from the response by sending a **raw=true** argument with your method call. [#](#rest-errors) REST Errors ------------------------------ See the individual method call pages for service specific error codes. Errors will communicate a code and a message in the following format: Invalid API Key [#](#json-responses) JSON Responses ------------------------------------ You can request API responses in JSON format with the following parameters: **format=json** : A Last.fm API Key. **callback** (Optional) : A callback function name which will wrap the JSON response. [#](#note) Note: ----------------- If you don't specify a callback, there's no default, and the response will be pure JSON content with a `application/json` MIME type. With a callback, the MIME type is `text/javascript` The response is a translation of the XML response format, converted according to the following rules: 1. Attributes are expressed as string member values with the attribute name as key. 2. Element child nodes are expressed as object members values with the node name as key. 3. Text child nodes are expressed as string values, unless the element also contains attributes, in which case the text node is expressed as a string member value with the key `#text`. \* 4. Repeated child nodes will be grouped as an array member with the shared node name as key. \* This idiom is rarely used in our XML responses. [#](#example-success-response) Example success response: --------------------------------------------------------- { "results": { "tagmatches": { "tag": \[{\ "name": "disco",\ "count": "55483",\ "url": "www.last.fm\\/tag\\/disco"\ },\ ...\ {\ "name": "disco pop",\ "count": "160",\ "url": "www.last.fm\\/tag\\/disco%20pop"\ }\] }, "for": "disco" } } [#](#original-xml-response) Original XML response: --------------------------------------------------- 2641 0 20 disco 55483 www.last.fm/tag/disco ... disco pop 160 www.last.fm/tag/disco%20pop [#](#json-errors) JSON Errors ------------------------------ JSON errors do not follow the same transformation rules as success errors, but use the following simplified form: [#](#example-failure-response) Example failure response: --------------------------------------------------------- { "error": 10, "message": "Invalid API Key" } ← [API Tools](/api/downloads) [XML-RPC](/api/xmlrpc) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#xml-rpc) XML-RPC ====================== [#](#xml-rpc-requests) XML-RPC Requests ---------------------------------------- Send xml-rpc requests as HTTP POST requests to [http://ws.audioscrobbler.com/2.0/](http://ws.audioscrobbler.com/2.0) . Send your params as _named_ arguments using a struct in the first param node. See the example below. user.gettoptags user joanofarctan api_key b25b959554ed76058ac220b7b2e0a026 [#](#xml-rpc-responses) XML-RPC Responses ------------------------------------------ XML-RPC requests will receive responses in XML-RPC format by default. See the [XML-RPC specification](http://www.xmlrpc.com) for more information. ← [REST Requests](/api/rest) [Terms of Service](/api/tos) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-gettoptags) album.getTopTags ======================================== Get the top tags for an album on Last.fm, ordered by popularity. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=album.gettoptags&artist=radiohead&album=the%20bends&api\_key=YOUR\_API\_...](http://ws.audioscrobbler.com/2.0/?method=album.gettoptags&artist=radiohead&album=the%20bends&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=album.gettoptags&artist=radiohead&album=the%20bends&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=album.gettoptags&artist=radiohead&album=the%20bends&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **album** (Required (unless mbid)\] : The album name **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **mbid** (Optional) : The musicbrainz id for the album **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- albums I own 100 http://www.last.fm/tag/albums%20i%20own ... [#](#attributes) Attributes ---------------------------- * **count** : A weighted count of how often the tag was applied, with a maximum of 100 [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.getTags](/api/show/album.getTags) [album.removeTag](/api/show/album.removeTag) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-gettags) artist.getTags ==================================== Get the tags applied by an individual user to an artist on Last.fm. If accessed as an authenticated service /and/ you don't supply a user parameter then this service will return tags for the authenticated user. To retrieve the list of top tags applied to an artist by all users use artist.getTopTags. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.getTags&artist=Red%20Hot%20Chili%20Peppers&user=RJ&api\_key=YOU...](http://ws.audioscrobbler.com/2.0/?method=artist.getTags&artist=Red%20Hot%20Chili%20Peppers&user=RJ&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.getTags&artist=Red%20Hot%20Chili%20Peppers&user=RJ&api\_key=YOU...](http://ws.audioscrobbler.com/2.0/?method=artist.getTags&artist=Red%20Hot%20Chili%20Peppers&user=RJ&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the artist **user** (Optional) : If called in non-authenticated mode you must specify the user to look up **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- italo http://www.last.fm/tag/italo ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getSimilar](/api/show/artist.getSimilar) [artist.getTopAlbums](/api/show/artist.getTopAlbums) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#playlists-api) Playlists API ================================== DEPRECATED This functionality is no longer supported. Documentation exists for reference only. Last.fm playlists do not contain streaming content. [#](#fetching-last-fm-playlists) Fetching Last.fm Playlists ------------------------------------------------------------ Use the ~playlist.fetch~ method call to fetch [XSPF](http://www.xspf.org) playlists. XSPF is a web standard for sharable playlists, and [XSPF libraries](http://www.xspf.org/applications/#libraries) are available in several languages. ~playlist.fetch~ takes a \`lastfm' protocol URL as an argument; this identifies the playlist you're requesting. The following protocol url schemes are currently supported: * **Album Playlists** `lastfm://playlist/album/` * **User Playlists** `lastfm://playlist/` * **Tag Playlists** `lastfm://playlist/tag//freetracks` [#](#playback) Playback ------------------------ If you'd like to add play links to your playlist you can link to the Last.fm track page (which will be present in the XSPF extension node), appending '?autostart' to the URL. ← [Radio API](/api/radio) [API Tools](/api/downloads) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-removetag) album.removeTag ====================================== Remove a user's tag from an album. [#](#params) Params -------------------- **artist** (Required) : The artist name **album** (Required) : The album name **tag** (Required) : A single user tag to remove from this album. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.getTopTags](/api/show/album.getTopTags) [album.search](/api/show/album.search) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-addtags) album.addTags ================================== Tag an album using a list of user supplied tags. [#](#params) Params -------------------- **artist** (Required) : The artist name **album** (Required) : The album name **tags** (Required) : A comma delimited list of user supplied tags to apply to this album. Accepts a maximum of 10 tags. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [Terms of Service](/api/tos) [album.getInfo](/api/show/album.getInfo) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#api-tools) API Tools ========================== UNOFFICIAL These API tools are unofficial and are not supported by Last.fm. Please contact the individual authors with questions and patches if need be. **.NET** * [LastFmLib.Net](http://lastfmlibnet.sourceforge.net/index.php) * [LPFM Last.fm Scrobbler](http://lpfm.codeplex.com) **Actionscript** * [lastfm-as3-api](http://code.google.com/p/lastfm-as3-api) **C#** * [lastfm-sharp](http://code.google.com/p/lastfm-sharp) **Java** * [Last.fm API Java Bindings](http://www.u-mass.de/lastfm) **Javascript** * [JavaScript Last.fm API - Felix Bruns](https://github.com/fxb/javascript-last.fm-api) **Objective C** * [FMEngine](https://github.com/westbaer/FMEngine/tree/master) **Perl** * [Net::LastFM](http://search.cpan.org/dist/Net-LastFM/lib/Net/LastFM.pm) **PHP** * [PHP Last.FM API - Matt Oakes](https://github.com/matt-oakes/PHP-Last.fm-API) * [PHP last.fm API - Felix Bruns](https://github.com/fxb/php-last.fm-api) **Python** * [pyLast](https://github.com/pylast/pylast) **Qt C++** * [liblastfm](https://github.com/lastfm/liblastfm) **Ruby** * [Scrobbler2](http://github.com/gingerhendrix/scrobbler2/tree/master) [#](#contributing) Contributing -------------------------------- If you're writing any tools that use the Last.fm API and you think others might be interested (no matter what the programming language), post a link [on the support forum](https://support.last.fm/c/support/api) . If we decide to include it as a download on this page we'll even send you some Last.fm merchandise. Because we're nice like that. ← [Playlists API](/api/playlists) [REST Requests](/api/rest) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#album-gettags) album.getTags ================================== Get the tags applied by an individual user to an album on Last.fm. To retrieve the list of top tags applied to an album by all users use album.getTopTags. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=album.gettags&artist=cher&album=believe&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=album.gettags&artist=cher&album=believe&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=album.gettags&artist=cher&album=believe&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=album.gettags&artist=cher&album=believe&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **album** (Required (unless mbid)\] : The album name **mbid** (Optional) : The musicbrainz id for the album **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **user** (Optional) : If called in non-authenticated mode you must specify the user to look up **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- swedish http://www.last.fm/tag/swedish ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [album.getInfo](/api/show/album.getInfo) [album.getTopTags](/api/show/album.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-getcorrection) artist.getCorrection ================================================ Use the last.fm corrections data to check whether the supplied artist has a correction to a canonical artist [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.getcorrection&artist=Guns and Roses&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.getcorrection&artist=Guns%20and%20Roses&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.getcorrection&artist=Guns and Roses&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.getcorrection&artist=Guns%20and%20Roses&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required) : The artist name to correct. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Guns N' Roses eeb1195b-f213-4ce1-b28c-8565211f8e43 http://www.last.fm/music/Guns+N%27+Roses [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.addTags](/api/show/artist.addTags) [artist.getInfo](/api/show/artist.getInfo) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#scrobbling-2-0-documentation) Scrobbling 2.0 Documentation ================================================================ * [Overview](#overview) * [Now Playing Requests](#now-playing-requests) * [Sending a Request](#sending-a-request) * [How we handle requests](#how-we-handle-requests) * [Error handling](#error-handling) * [Scrobble Requests](#scrobble-requests) * [When is a scrobble a scrobble?](#when-is-a-scrobble-a-scrobble) * [When to set the "chosenByUser" parameter](#when-to-set-the-chosenbyuser-parameter) * [Sending a Request](#sending-a-request) * [How we handle requests](#how-we-handle-requests) * [Error handling](#error-handling) * [Retrying cached scrobbles](#retrying-cached-scrobbles) * [Filtered Requests](#filtered-requests) * [Meta data corrections](#meta-data-corrections) * [Help](#help) [#](#overview) Overview ------------------------ This is a guide on how to send scrobbles to Last.fm. Scrobbling is a way to send information about the music a user is listening to. A client is anything that plays music, such as desktop music players, mobile apps, websites, etc. For every track a user listens to the client should send a track.updateNowPlaying request and a track.scrobble request. Scrobbling 2.0 is not backwards compatible with the old Submissions Protocol 1.2.1 (which is deprecated). [#](#now-playing-requests) Now Playing Requests ------------------------------------------------ The "Now Playing" service lets a client notify Last.fm that a user has started listening to a track. This does not affect a user's charts, but will feature the current track on their profile page, along with an indication of what music player they're using. This API method call is optional for scrobbling clients, but recommended. Requests should be sent as soon as a user starts listening to a track. ### [#](#sending-a-request) Sending a Request The web service method for sending Now Playing information is [track.updateNowPlaying](/api/show/track.updateNowPlaying) . As with all our write web services, requests must be sent as HTTP POST requests to `http://ws.audioscrobbler.com/2.0/` with form urlencoded parameters in the body of the request. The text encoding must be UTF-8. Requests must be [authenticated](/api/authentication) . ### [#](#how-we-handle-requests) How we handle requests Once a request has been received by Last.fm the following sequence of events takes place on our side: * Check that the request passes our [filters](#filtered-requests) . * Find the track in our catalogue. * Update the user's Now Playing status with the track and client. * Return a response to the client indicating the outcome of the request. ### [#](#error-handling) Error handling Last.fm signals the success or failure of a request by three different means: * The HTTP status code. * The lfm status attribute of the lfm XML element returned in the response body. This will be either "ok" or "failed". * The lfm [error code](/api/errorcodes) (when the lfm status was "failed") further describes the cause of the error. This is the error element's code attribute in the XML returned in the response body. We recommend that your client logs all failed requests and their responses (HTTP headers, and the xml body) to assist debugging. Now Playing requests that fail should not be retried. [#](#scrobble-requests) Scrobble Requests ------------------------------------------ The scrobble service lets a client add a track-play to a user's profile. This data is used to show a user's listening history and generate personalised charts and recommendations (and more). ### [#](#when-is-a-scrobble-a-scrobble) When is a scrobble a scrobble? A track should only be scrobbled when the following conditions have been met: * The track must be longer than 30 seconds. * _And_ the track has been played for at least half its duration, or for 4 minutes (whichever occurs earlier.) As soon as these conditions have been met, the scrobble request may be sent at any time. It is often most convenient to send a scrobble request when a track has finished playing. Other considerations: * Do not attempt to determine a track's meta data from its filename. Please only use meta data from well-structured sources such as ID3 tags. * Do not use the corrections returned by the now playing service as input for the scrobble request, unless they have been explicitly approved by the user. ### [#](#when-to-set-the-chosenbyuser-parameter) When to set the "chosenByUser" parameter This parameter is used to indicate when a scrobble comes from a source that the user doesn't have "direct" control over. In most cases where a user is scrobbling their own music you can safely ignore this parameter. However, if the user is listening to music that is effectively chosen by someone other than themselves (e.g. from a Last.fm radio stream; from some other recommendation service; or radio show put together by a DJ or host) then this value should be set to "false". If there is any ambiguity or doubt then don't send this value. ### [#](#sending-a-request-2) Sending a Request The web service method for sending scrobbles is [track.scrobble](/api/show/track.scrobble) . As with all our write web services, requests must be sent as HTTP POST requests to **http://ws.audioscrobbler.com/2.0/** with form urlencoded (using utf-8) parameters in the body of the request. Requests must be [authenticated](/api/authentication) . Multiple scrobbles may be sent in a single batch request, this is recommended when there are cached scrobbles to be sent in the case of previous errors. A batch request may contain up to 50 scrobbles. ### [#](#how-we-handle-requests-2) How we handle requests Once a request has been received by Last.fm the following sequence of events takes place on our side: * Check that the request passes our [filters](#filtered-requests) . * Find the track in our catalogue. * Store the scrobble in the user's profile. * Return a response to the client indicating the outcome of the request. ### [#](#error-handling-2) Error handling Last.fm signals the success or failure of a request by three different means: * The HTTP status code. * The lfm status attribute of the lfm XML element returned in the response body. This will be either `ok` or `failed`. * The lfm [error code](/api/errorcodes) (when the lfm status was `failed`) further describes the cause of the error. This is the error element's code attribute in the XML returned in the response body. We recommend that your client logs all failed requests and their responses (HTTP headers, and the xml body) to assist debugging. No matter what the HTTP status code is, ## you must inspect the content of the response . If the HTTP status is not 200 OK it indicates there was an error (that should be logged), but it does not indicate how to handle it. Additionally a HTTP status of 200 OK does not mean the request was successful. For example if the request was missing a required parameter you will receive an HTTP "400 Bad Request" status and retrying without modifying the request will always give the same response. Next inspect the lfm status and lfm status code. If the lfm status is "ok" then the request succeeded. For example if you send a request that is missing the artist parameter the response will be the following: Missing required parameter artist Lfm error codes that indicate a scrobble request should be retried are: * **11** : Service Offline - This service is temporarily offline, try again later. * **16** : The service is temporarily unavailable, please try again. Additionally this lfm error code indicates that the client should reauthenticate to get a new session key before retrying the request: * **9** : Invalid session key - Please re-authenticate All other error codes indicate the scrobble request was incorrectly formed in some way and should not be retried. This diagrams describes the flow for sending scrobble requests and handling the response. ![https://cdn.last.fm/images/scrobbling-error-handling.png](https://cdn.last.fm/images/scrobbling-error-handling.png) ### [#](#retrying-cached-scrobbles) Retrying cached scrobbles Since the server connectivity may be variable (either because of network outage, or server failure), requests will occasionally fail. It is recommended that clients hold scrobbles that need be retried in a local cache. This cache should survive client restarts, allowing the user to close the client and restart later without losing unsubmitted scrobbles. Scrobbles should be sent in order, therefore cached scrobbles should be sent before new scrobbles. Scrobbles can be sent in batches of up to 50 scrobbles per request. [#](#filtered-requests) Filtered Requests ------------------------------------------ A scrobble or Now Playing request may be ignored if we detect bad meta data. This is not treated as an error condition, so if filtering takes place the response will have an "ok" status. The server will return an ignored message with an associated ignored code. This information is useful if the client wants to show information about why a track was not added to the user's profile. In the case of batch scrobble requests, each scrobble is filtered separately. So if only one scrobble has bad meta data and is ignored other scrobbles in the request will still be accepted. Possible ignored message codes: * **0** : None (the request passed all filters). * **1** : Filtered artist. * **2** : Filtered track. * **3** : Timestamp too far in the past. * **4** : Timestamp too far in the future. * **5** : Max daily scrobbles exceeded. We may add additional ignored codes in the future. For example if you sent a scrobble request with **artist="Unknown** Artist" the response will look something like this: Test Track Unknown Artist 1288728940 Artist name failed filter: Unknown Artist [#](#meta-data-corrections) Meta data corrections -------------------------------------------------- The Last.fm catalogue contains correction information which we use to merge mispelled artists and tracks into their correct versions. If we find such a correction when resolving a track in our catalogue we will return it in the response. This information could optionally be used by the client to suggest track meta data (ID3 tags, etc) corrections to the user. They should not be applied automatically. Most clients will simply ignore corrections. Corrections are indicated by a **corrected="1"** attribute. Its value will contain the corrected version (so the value will differ from that in the request). For example if you send a scrobble request with **artist="Bjork"** the response will look something like this: Wanderlust Björk 1288728745 This response shows the artist was corrected to "Björk". Considerations: * Do not use the corrections returned by the now playing service as input for the scrobble request, unless they have been explicitly approved by the user. [#](#help) Help ---------------- If you experience any problems using the scrobbling API please report them on our [support forums](https://support.last.fm) . Try to give as much information about the requests and responses as possible. ← [Auth Spec](/api/authspec) [Radio API](/api/radio) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#authentication-api) Authentication API ============================================ This is Version 1.0 of the Last.fm authentication API specification. [#](#_1-authors) 1. Authors ---------------------------- [Anil Bawa-Cavia](http://www.last.fm/user/joanofarctan) [#](#_2-requirements) 2. Requirements -------------------------------------- You must have applied for, and received, a Last.fm API account, via the account application screen. You must configure your [Last.fm API account](/api/accounts) with: * Your application name and description. * Your application logo. Your account page contains your _secret_ which must be used when making authenticated calls – see Section 8 below. ### [#](#_2-1-web-based-authentication) 2.1 Web-based Authentication You must also configure a callback URL which will be used in Section 3.2 below. [#](#_3-authentication-for-web-applications) 3. Authentication For Web Applications ------------------------------------------------------------------------------------ ### [#](#_3-1-request-authorization-from-the-user) 3.1 Request authorization from the user Web applications should send a user to [last.fm/api/auth](/api/auth) , sending an API key as a parameter, in order to authenticate the user. This should be an HTTP GET request. Your request will look like this: http://www.last.fm/api/auth/?api_key=xxxxxxxxxx If the user is not logged in to Last.fm, they will be redirected to the login page before being asked to grant your web application permission to use their account. On this page they will see the name of your application, along with the application description and logo as supplied in Section 2. ### [#](#_3-2-create-an-authentication-handler) 3.2 Create an authentication handler Once the user has granted permission to use their account on the Last.fm page, Last.fm will redirect to your **callback url**, supplying an authentication token as a GET variable. /?token=yyyyyy The script located at your callback url should pick up this authentication token and use it to create a Last.fm web service session as described in Section 3.3. ### [#](#_3-3-create-a-web-service-session) 3.3 Create a Web Service Session Send your api key along with an api signature and your authentication token as arguments to the [auth.getSession](/api/show/auth.getSession) API method call. The parameters for this call are defined as such: **api\_key**: Your 32-character API Key. **token**: The authentication token received at your callback url as a GET variable. **api\_sig**: Your 32-character API method signature, as explained in [Section 8](#_8-signing-calls) . The call will respond with a _session key_ that can be used in authenticated calls. [#](#_4-authentication-for-desktop-applications) 4. Authentication For Desktop Applications -------------------------------------------------------------------------------------------- ### [#](#_4-1-fetch-a-request-token) 4.1 Fetch a request token Make an API method call to the [auth.getToken](/api/show/auth.getToken) service. You should send the following arguments to that call: **api\_key**: Your 32-character API Key. **api\_sig**: A 32-character API method signature, constructed as explained in [Section 8](#_8-signing-calls) . This will return a token. To see the response format check the method documentation page. The token is not authorized by the user at this stage and cannot be used to create a session until it has been authorized. ### [#](#_4-2-request-authorization-from-the-user) 4.2 Request authorization from the user Your application needs to open an instance of a web browser and send the user to [last.fm/api/auth](/api/auth) with your API key and authentication token as parameters. Use an HTTP GET request. Your request will look like this: http://www.last.fm/api/auth/?api_key=xxxxxxxxxx&token=yyyyyy If the user is not logged in to Last.fm, they will be redirected to the login page before being asked to grant your application permission to use their account. On this page they will see the name of your application, along with the application description and logo as supplied in Section 2. Once the user has granted your application permission to use their account, the browser-based process is over and the user is asked to close their browser and return to your application. ### [#](#_4-3-create-a-web-service-session) 4.3 Create a Web Service Session Send your api key along with an api signature and your authentication token as arguments to the [auth.getSession](/api/show/auth.getSession) API method call. The parameters for this call are defined as such: **api\_key**: Your 32-character API Key. **token**: The authentication token received at your callback url as a GET variable. **api\_sig**: Your 32-character API method signature, as explained in [Section 8](#_8-signing-calls) . The call will respond with a _session key_ that can be used in authenticated calls. [#](#_5-authentication-for-mobile-applications) 5. Authentication For Mobile Applications ------------------------------------------------------------------------------------------ Send a request to [auth.getMobileSession](/api/show/auth.getMobileSession) , sending the user's credentials to the call. The parameters for this call are defined as: **password** (Required) : The user's password in plaintext. **username** (Required) : The user's Last.fm username. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [Section 8](#8) for more information. This call **must** be a POST made over HTTPS. [auth.getMobileSession](/api/show/auth.getMobileSession) will return a _session key_ in response to be used in authenticated calls. [#](#_6-tokens-sessions) 6. Tokens & Sessions ---------------------------------------------- ### [#](#_6-1-authentication-tokens) 6.1 Authentication Tokens Authentication tokens are API account specific. They are valid for 60 minutes from the moment they are granted and can only used once (they are consumed when a session is created). ### [#](#_6-2-session-lifetime) 6.2 Session Lifetime Session keys have an infinite lifetime by default. You are recommended to store the key securely. Users are able to revoke privileges for your application on their Last.fm settings screen, rendering session keys invalid. [#](#_7-making-authenticated-calls) 7. Making authenticated calls ------------------------------------------------------------------ You should sign authenticated web service calls with a method signature, provided along with the session key you received from [auth.getSession](/api/show/auth.getSession) and your API key. You will need to include all three as parameters in authenticated calls. You can visit individual method call pages to find out if they require authentication. Your three authentication parameters are defined as: **sk** (Required) : The session key returned by [auth.getSession](/api/show/auth.getSession) service. **api\_key** (Required) : Your 32-character API key. **api\_sig** (Required) : Your API method signature, constructed as explained in [Section 8](#_8-signing-calls) . [#](#_8-signing-calls) 8. Signing Calls ---------------------------------------- Sign your authenticated calls by first ordering the parameters sent in your call alphabetically by parameter name and concatenating them into one string using a `` scheme. You must not include the **format** and **callback** parameters. So for a call to `auth.getSession` you may have: api_keyxxxxxxxxxxmethodauth.getSessiontokenyyyyyy Ensure your parameters are [utf8](http://www.utf-8.com) encoded. Now append your **secret** to this string. Finally, generate an [md5](http://en.wikipedia.org/wiki/MD5) hash of the resulting string. For example, for an account with a secret equal to 'ilovecher', your api signature will be: api signature = md5("api_keyxxxxxxxxxxmethodauth.getSessiontokenyyyyyyilovecher") Where `md5()` is an md5 hashing operation and its argument is the string to be hashed. The hashing operation should return a 32-character hexadecimal md5 hash. ← [Desktop How-To](/api/desktopauth) [Scrobbling 2.0 Documentation](/api/scrobbling) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-getsimilar) artist.getSimilar ========================================== Get all the artists similar to this artist [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.getsimilar&artist=cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.getsimilar&artist=cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **limit** (Optional) : Limit the number of similar artists returned **artist** (Required (unless mbid)\] : The artist name **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **mbid** (Optional) : The musicbrainz id for the artist **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Sonny & Cher 3d6e4b6d-2700-458c-9722-9021965a8164 1 www.last.fm/music/Sonny%2B%2526%2BCher http://userserve-ak.last.fm/serve/34/71168880.png http://userserve-ak.last.fm/serve/64/71168880.png http://userserve-ak.last.fm/serve/126/71168880.png http://userserve-ak.last.fm/serve/252/71168880.png http://userserve-ak.last.fm/serve/500/71168880/Sonny++Cher.png 1 ... [#](#attributes) Attributes ---------------------------- * **match** : A similarity value between 0 (not similar) and 1 (very similar) [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getInfo](/api/show/artist.getInfo) [artist.getTags](/api/show/artist.getTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#authentication-mobile-application-how-to) Authentication: Mobile Application How-To ========================================================================================= This authentication how-to is for standalone mobile devices only. [#](#_1-get-an-api-key) 1. Get an API Key ------------------------------------------ You can apply for an API key [here](/api/account/create) . When you have been granted an API Key you can configure your accounts by visiting [last.fm/api/accounts](/api/api/accounts) . Here you will see a **shared secret** which will be required in [Section 4](#_4-sign-your-calls) . [#](#_2-request-authorization-from-the-user) 2. Request authorization from the user ------------------------------------------------------------------------------------ Send a request to [auth.getMobileSession](/api/show/auth.getMobileSession) , sending the user's credentials to the call. The parameters for this call are defined as: **username** (Required) : The last.fm username. **password** (Required) : A plaintext password. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [Section 4](#_4-sign-your-calls) for more information. This webservice has to be called via POST and HTTPS. It will fail if you try to use it via GET or HTTP. [auth.getMobileSession](/api/show/auth.getMobileSession) will return a `session key` in response to be used on subsequent calls. ### [#](#_2-1-session-lifetime) 2.1 Session Lifetime Session keys have an infinite lifetime by default. You are recommended to store the key securely. Users are able to revoke privileges for your application on their Last.fm settings screen, rendering session keys invalid. [#](#_3-make-authenticated-web-service-calls) 3. Make authenticated web service calls -------------------------------------------------------------------------------------- You can now sign your web service calls with a method signature, provided along with the session key you received in Section 2 and your API key. You will need to include all three as parameters in subsequent calls in order to be able to access services that require authentication. You can visit individual method call pages to find out if they require authentication. Your three authentication parameters are defined as: **sk** (Required) : The session key returned by [auth.getMobileSession](/api/show/auth.getMobileSession) service. **api\_key** (Required) : Your 32-character API key. **api\_sig** (Required) : Your API method signature, constructed as explained in [Section 4](#_4-sign-your-calls) [#](#_4-sign-your-calls) 4. Sign your calls -------------------------------------------- Construct your api method signatures by first ordering all the parameters sent in your call alphabetically by parameter name and concatenating them into one string using a `` scheme. So for a call to `auth.getMobileSession` you may have: **api_key**xxxxxxxx**method**auth.getMobileSession**password**xxxxxxx**username**xxxxxxxx Ensure your parameters are [utf8](http://www.utf-8.com) encoded. Now append your **secret** to this string. Finally, generate an [md5](http://en.wikipedia.org/wiki/MD5) hash of the resulting string. For example, for an account with a secret equal to 'mysecret', your api signature will be: api signature = md5("api_keyxxxxxxxxmethodauth.getMobileSession passwordxxxxxxxusernamexxxxxxxxmysecret") Where _md5()_ is an md5 hashing operation and its argument is the string to be hashed. The hashing operation should return a 32-character hexadecimal md5 hash. ← [Web How-To](/api/webauth) [Desktop How-To](/api/desktopauth) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-getinfo) artist.getInfo ==================================== Get the metadata for an artist. Includes biography, truncated at 300 characters. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.getinfo&artist=Cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.getinfo&artist=Cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the artist **lang** (Optional) : The language to return the biography in, expressed as an ISO 639 alpha-2 code. **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **username** (Optional) : The username for the context of the request. If supplied, the user's playcount for this artist is included in the response. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Cher bfcc6d75-a6a5-4bc6-8282-47aec8531818 http://www.last.fm/music/Cher http://userserve-ak.last.fm/serve/50/285717.jpg http://userserve-ak.last.fm/serve/85/285717.jpg http://userserve-ak.last.fm/serve/160/285717.jpg 1 196440 1599101 Madonna http://www.last.fm/music/Madonna http://userserve-ak.last.fm/serve/50/5112299.jpg http://userserve-ak.last.fm/serve/85/5112299.jpg> http://userserve-ak.last.fm/serve/160/5112299.jpg ... pop http://www.last.fm/tag/pop ... Thu, 13 Mar 2008 03:59:18 +0000 ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getCorrection](/api/show/artist.getCorrection) [artist.getSimilar](/api/show/artist.getSimilar) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-gettoptags) artist.getTopTags ========================================== Get the top tags for an artist on Last.fm, ordered by popularity. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.gettoptags&artist=cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.gettoptags&artist=cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the artist **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- pop http://www.last.fm/tag/pop ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getTopAlbums](/api/show/artist.getTopAlbums) [artist.getTopTracks](/api/show/artist.getTopTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-gettopalbums) artist.getTopAlbums ============================================== Get the top albums for an artist on Last.fm, ordered by popularity. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.gettopalbums&artist=cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.gettopalbums&artist=cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the artist **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **page** (Optional) : The page number to fetch. Defaults to first page. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Believe 61bf0388-b8a9-48f4-81d1-7eb02706dfb0 24486 http://www.last.fm/music/Cher/Believe ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getTags](/api/show/artist.getTags) [artist.getTopTags](/api/show/artist.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-gettoptracks) artist.getTopTracks ============================================== Get the top tracks by an artist on Last.fm, ordered by popularity [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.gettoptracks&artist=cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.gettoptracks&artist=cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the artist **autocorrect\[0|1\]** (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response. **page** (Optional) : The page number to fetch. Defaults to first page. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Believe 56325 23217 http://www.last.fm/music/Cher/_/Believe ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getTopTags](/api/show/artist.getTopTags) [artist.removeTag](/api/show/artist.removeTag) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-gettopartists) tag.getTopArtists ========================================== Get the top artists tagged by this tag, ordered by tag count. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.gettopartists&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.gettopartists&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **tag** (Required) : The tag name **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- ABBA d87e52c5-bb8d-4da8-b941-9f4928627dc8 http://www.last.fm/music/ABBA 1 ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getTopAlbums](/api/show/tag.getTopAlbums) [tag.getTopTags](/api/show/tag.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#geo-gettopartists) geo.getTopArtists ========================================== Get the most popular artists on Last.fm by country [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=geo.gettopartists&country=spain&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=spain&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=geo.gettopartists&country=spain&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=spain&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **country** (Required) : A country name, as defined by the ISO 3166-1 country names standard **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Coldplay 3199 cc197bad-dc9c-440d-a5b5-d52ba2e14234 http://www.last.fm/music/Coldplay 1 ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [chart.getTopTracks](/api/show/chart.getTopTracks) [geo.getTopTracks](/api/show/geo.getTopTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#auth-getmobilesession) auth.getMobileSession ================================================== Create a web service session for a user. Used for authenticating a user when the password can be inputted by the user. Accepts email address as well, so please use the username supplied in the output. Only suitable for standalone mobile devices. See the authentication how-to for more. You must use HTTPS and POST in order to use this method. [#](#params) Params -------------------- **password** (Required) : The password in plain text. **username** (Required) : The last.fm username or email address. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- MyLastFMUsername d580d57f32848f5dcf574d1ce18d78b2 0 DEPRECATED BEHAVIOUR This method has other parameters which are now deprecated and should not be used. A previous version of **auth.getMobileSession** accepted an **authToken** parameter in place of **password**, where authToken was defined as: authToken = md5(username + md5(password)) We recommend all clients update to the latest version as support for **authToken** will be removed in the future. [#](#errors) Errors -------------------- * **4** : You must use POST in order to use this method. * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.search](/api/show/artist.search) [auth.getSession](/api/show/auth.getSession) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#chart-gettopartists) chart.getTopArtists ============================================== Get the top artists chart [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=chart.gettopartists&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=chart.gettopartists&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **page** (Optional) : The page number to fetch. Defaults to first page. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- The Beatles 1550293 114106 b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d http://www.last.fm/music/The+Beatles 1 http://userserve-ak.last.fm/serve/34/880929.jpg http://userserve-ak.last.fm/serve/64/880929.jpg http://userserve-ak.last.fm/serve/126/880929.jpg http://userserve-ak.last.fm/serve/252/880929.jpg http://userserve-ak.last.fm/serve/500/880929/The+Beatles.jpg ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [auth.getToken](/api/show/auth.getToken) [chart.getTopTags](/api/show/chart.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-getweeklychartlist) tag.getWeeklyChartList ==================================================== Get a list of available charts for this tag, expressed as date ranges which can be sent to the chart services. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.getweeklychartlist&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.getweeklychartlist&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.getweeklychartlist&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.getweeklychartlist&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **tag** (Required) : The tag name **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getTopTracks](/api/show/tag.getTopTracks) [track.addTags](/api/show/track.addTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-addtags) track.addTags ================================== Tag an album using a list of user supplied tags. [#](#params) Params -------------------- **artist** (Required) : The artist name **track** (Required) : The track name **tags** (Required) : A comma delimited list of user supplied tags to apply to this track. Accepts a maximum of 10 tags. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getWeeklyChartList](/api/show/tag.getWeeklyChartList) [track.getCorrection](/api/show/track.getCorrection) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-search) artist.search ================================== Search for an artist by name. Returns artist matches sorted by relevance. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=artist.search&artist=cher&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=cher&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=artist.search&artist=cher&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=cher&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **limit** (Optional) : The number of results to fetch per page. Defaults to 30. **page** (Optional) : The page number to fetch. Defaults to first page. **artist** (Required) : The artist name **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- 386 0 20 Cher bfcc6d75-a6a5-4bc6-8282-47aec8531818 www.last.fm/music/Cher http://userserve-ak.last.fm/serve/50/342437.jpg http://userserve-ak.last.fm/serve/160/342437.jpg 1 ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.removeTag](/api/show/artist.removeTag) [auth.getMobileSession](/api/show/auth.getMobileSession) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#library-getartists) library.getArtists ============================================ A paginated list of all the artists in a user's library, with play counts and tag counts. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=library.getartists&api\_key=YOUR\_API\_KEY&user=joanofarctan&format=json](http://ws.audioscrobbler.com/2.0/?method=library.getartists&api_key=YOUR_API_KEY&user=joanofarctan&format=json) **XML:** [/2.0/?method=library.getartists&api\_key=YOUR\_API\_KEY&user=joanofarctan](http://ws.audioscrobbler.com/2.0/?method=library.getartists&api_key=YOUR_API_KEY&user=joanofarctan) [#](#params) Params -------------------- **user** (Required) : The user whose library you want to fetch. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number you wish to scan to. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Dream Theater 1346 0 28503ab7-8bf2-4666-a7bd-2644bfc7cb1d http://www.last.fm/music/Dream+Theater 1 http://userserve-ak.last.fm/serve/50/95853.jpg http://userserve-ak.last.fm/serve/85/95853.jpg http://userserve-ak.last.fm/serve/160/95853.jpg ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [geo.getTopTracks](/api/show/geo.getTopTracks) [tag.getInfo](/api/show/tag.getInfo) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-getsimilar) tag.getSimilar ==================================== Search for tags similar to this one. Returns tags ranked by similarity, based on listening data. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.getsimilar&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.getsimilar&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.getsimilar&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.getsimilar&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **tag** (Required) : The tag name **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- high energy http://www.last.fm/tag/high energy 1 ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getInfo](/api/show/tag.getInfo) [tag.getTopAlbums](/api/show/tag.getTopAlbums) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-gettopalbums) tag.getTopAlbums ======================================== Get the top albums tagged by this tag, ordered by tag count. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.gettopalbums&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.gettopalbums&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **tag** (Required) : The tag name **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Overpowered http://www.last.fm/music/Róisín+Murphy/Overpowered Róisín Murphy 4c56405d-ba8e-4283-99c3-1dc95bdd50e7 http://www.last.fm/music/Róisín+Murphy ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getSimilar](/api/show/tag.getSimilar) [tag.getTopArtists](/api/show/tag.getTopArtists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-search) track.search ================================ Search for a track by track name. Returns track matches sorted by relevance. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=track.search&track=Believe&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=track.search&track=Believe&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=track.search&track=Believe&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=track.search&track=Believe&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **limit** (Optional) : The number of results to fetch per page. Defaults to 30. **page** (Optional) : The page number to fetch. Defaults to first page. **track** (Required) : The track name **artist** (Optional) : Narrow your search by specifying an artist. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- 25329 0 20 Believe Disturbed http://www.last.fm/music/Disturbed/_/Believe 1 66068 ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.scrobble](/api/show/track.scrobble) [track.unlove](/api/show/track.unlove) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-gettoptags) track.getTopTags ======================================== Get the top tags for this track on Last.fm, ordered by tag count. Supply either track & artist name or mbid. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=track.gettoptags&artist=radiohead&track=paranoid+android&api\_key=YOUR...](http://ws.audioscrobbler.com/2.0/?method=track.gettoptags&artist=radiohead&track=paranoid+android&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=track.gettoptags&artist=radiohead&track=paranoid+android&api\_key=YOUR...](http://ws.audioscrobbler.com/2.0/?method=track.gettoptags&artist=radiohead&track=paranoid+android&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **track** (Required (unless mbid)\] : The track name **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the track **autocorrect\[0|1\]** (Optional) : Transform misspelled artist and track names into correct artist and track names, returning the correct version instead. The corrected artist and track name will be returned in the response. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- pop 97 www.last.fm/tag/pop dance 88 www.last.fm/tag/dance ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.getTags](/api/show/track.getTags) [track.love](/api/show/track.love) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-removetag) track.removeTag ====================================== Remove a user's tag from a track. [#](#params) Params -------------------- **artist** (Required) : The artist name **track** (Required) : The track name **tag** (Required) : A single user tag to remove from this track. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.love](/api/show/track.love) [track.scrobble](/api/show/track.scrobble) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getfriends) user.getFriends ====================================== Get a list of the user's friends on Last.fm. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getfriends&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getfriends&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getfriends&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getfriends&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The last.fm username to fetch the friends of. **recenttracks** (Optional) : Whether or not to include information about friends' recent listening in the response. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- eartle Michael Coffey http://userserve-ak.last.fm/serve/34/45718509.jpg http://userserve-ak.last.fm/serve/64/45718509.jpg http://userserve-ak.last.fm/serve/126/45718509.jpg http://userserve-ak.last.fm/serve/252/45718509.jpg http://www.last.fm/user/eartle 7737850 UK 29 m 1 45366 4 0 2007-09-13 15:22 subscriber ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.updateNowPlaying](/api/show/track.updateNowPlaying) [user.getInfo](/api/show/user.getInfo) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#auth-gettoken) auth.getToken ================================== Fetch an unathorized request token for an API account. This is step 2 of the authentication process for desktop applications. Web applications do not need to use this service. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=auth.gettoken&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=auth.gettoken&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=auth.gettoken&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=auth.gettoken&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- cf45fe5a3e3cebe168480a086d7fe481 [#](#errors) Errors -------------------- * **8** : There was an error granting the request token. Please try again later * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [auth.getSession](/api/show/auth.getSession) [chart.getTopArtists](/api/show/chart.getTopArtists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#geo-gettoptracks) geo.getTopTracks ======================================== Get the most popular tracks on Last.fm last week by country [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=geo.gettoptracks&country=spain&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=geo.gettoptracks&country=spain&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=geo.gettoptracks&country=spain&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=geo.gettoptracks&country=spain&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **country** (Required) : A country name, as defined by the ISO 3166-1 country names standard **location** (Optional) : A metro name, to fetch the charts for (must be within the country specified) **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Violet Hill 1055 http://www.last.fm/music/Coldplay/_/Violet+Hill 1 Coldplay cc197bad-dc9c-440d-a5b5-d52ba2e14234 http://www.last.fm/music/Coldplay ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [geo.getTopArtists](/api/show/geo.getTopArtists) [library.getArtists](/api/show/library.getArtists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#chart-gettoptags) chart.getTopTags ======================================== Get the top artists chart [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=chart.gettoptags&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=chart.gettoptags&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=chart.gettoptags&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=chart.gettoptags&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **page** (Optional) : The page number to fetch. Defaults to first page. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- rock http://www.last.fm/tag/rock 309437 3064604 1 Sun, 24 Oct 2010 17:40:33 +0000 Rock music is a genre of music started in America. It h... Rock music is a genre of music started in America. It has its roots in 1940s and 1950s rock and roll and rockabilly, which evolved from blues, country music and other influences. According to the All Music Guide, “In its pu... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [chart.getTopArtists](/api/show/chart.getTopArtists) [chart.getTopTracks](/api/show/chart.getTopTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-gettags) track.getTags ================================== Get the tags applied by an individual user to a track on Last.fm. To retrieve the list of top tags applied to a track by all users use track.getTopTags. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=track.getTags&api\_key=YOUR\_API\_KEY&artist=AC/DC&track=Hells+Bells&use...](http://ws.audioscrobbler.com/2.0/?method=track.getTags&api_key=YOUR_API_KEY&artist=AC/DC&track=Hells+Bells&user=RJ&format=json) **XML:** [/2.0/?method=track.getTags&api\_key=YOUR\_API\_KEY&artist=AC/DC&track=Hells+Bells&use...](http://ws.audioscrobbler.com/2.0/?method=track.getTags&api_key=YOUR_API_KEY&artist=AC/DC&track=Hells+Bells&user=RJ) [#](#params) Params -------------------- **artist** (Required (unless mbid)\] : The artist name **track** (Required (unless mbid)\] : The track name **mbid** (Optional) : The musicbrainz id for the track **autocorrect\[0|1\]** (Optional) : Transform misspelled artist and track names into correct artist and track names, returning the correct version instead. The corrected artist and track name will be returned in the response. **user** (Optional) : If called in non-authenticated mode you must specify the user to look up **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- swedish http://www.last.fm/tag/swedish ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.getSimilar](/api/show/track.getSimilar) [track.getTopTags](/api/show/track.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-gettoptracks) tag.getTopTracks ======================================== Get the top tracks tagged by this tag, ordered by tag count. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.gettoptracks&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.gettoptracks&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **tag** (Required) : The tag name **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Stayin' Alive http://www.last.fm/music/Bee+Gees/_/Stayin'+Alive 1 Bee Gees bf0f7e29-dfe1-416c-b5c6-f9ebc19ea810 http://www.last.fm/music/Bee+Gees ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getTopTags](/api/show/tag.getTopTags) [tag.getWeeklyChartList](/api/show/tag.getWeeklyChartList) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#auth-getsession) auth.getSession ====================================== Fetch a session key for a user. The third step in the authentication process. See the authentication how-to for more information. [#](#params) Params -------------------- **token** (Required) : A 32-character ASCII hexadecimal MD5 hash returned by step 1 of the authentication process (following the granting of permissions to the application by the user) **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- MyLastFMUsername d580d57f32848f5dcf574d1ce18d78b2 0 [#](#errors) Errors -------------------- * **4** : Invalid authentication token supplied * **14** : This token has not been authorized * **15** : This token has expired * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [auth.getMobileSession](/api/show/auth.getMobileSession) [auth.getToken](/api/show/auth.getToken) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-scrobble) track.scrobble ==================================== Used to add a track-play to a user's profile. Scrobble a track, or a batch of tracks. Tracks are passed to the service using array notation for each of the below params, up to a maximum of 50 scrobbles per batch \[0<=i<=49\]. If you are only sending a single scrobble the array notation may be ommited. Note: Extra care should be taken while calculating the signature when using array notation as the parameter names MUST be sorted according to the ASCII table (i.e., artist\[10\] comes before artist\[1\]). It is important to not use the corrections returned by the now playing service as input for the scrobble request, unless they have been explicitly approved by the user. Parameter names are case sensitive. [#](#params) Params -------------------- **artist\[i\]** (Required) : The artist name. **track\[i\]** (Required) : The track name. **timestamp\[i\]** (Required) : The time the track started playing, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone. **album\[i\]** (Optional) : The album name. **context\[i\]** (Optional) : Sub-client version (not public, only enabled for certain API keys) **streamId\[i\]** (Optional) : The stream id for this track received from the radio.getPlaylist service, if scrobbling Last.fm radio **chosenByUser\[i\]** (Optional) : Set to 1 if the user chose this song, or 0 if the song was chosen by someone else (such as a radio station or recommendation service). Assumes 1 if not specified **trackNumber\[i\]** (Optional) : The track number of the track on the album. **mbid\[i\]** (Optional) : The MusicBrainz Track ID. **albumArtist\[i\]** (Optional) : The album artist - if this differs from the track artist. **duration\[i\]** (Optional) : The length of the track in seconds. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- Example for a single scrobble sent: Test Track Test Artist 1287140447 Example for 2 scrobbles sent: Test Track 0 Test Artist 0 1287141093 Test Track 1 Test Artist 1 1287141093 [#](#attributes) Attributes ---------------------------- * **accepted** : Number of accepted scrobbles * **code** : Ignored message codes: * 1: Artist was ignored * 2: Track was ignored * 3: Timestamp was too old * 4: Timestamp was too new * 5: Daily scrobble limit exceeded * **corrected** : '1', if this track, artist or album name was automatically corrected, '0' otherwise * **ignored** : Number of ignored scrobbles (see ignoredMessage for details) [#](#errors) Errors -------------------- * **16** : The service is temporarily unavailable, please try again. * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.removeTag](/api/show/track.removeTag) [track.search](/api/show/track.search) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-love) track.love ============================ Love a track for a user profile. [#](#params) Params -------------------- **track** (Required) : A track name (utf8 encoded) **artist** (Required) : An artist name (utf8 encoded) **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **8** : Operation Failed - Server Error. Please try again later. * **6** : Invalid track name supplied * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.getTopTags](/api/show/track.getTopTags) [track.removeTag](/api/show/track.removeTag) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-updatenowplaying) track.updateNowPlaying ==================================================== Used to notify Last.fm that a user has started listening to a track. Parameter names are case sensitive. [#](#params) Params -------------------- **artist** (Required) : The artist name. **track** (Required) : The track name. **album** (Optional) : The album name. **trackNumber** (Optional) : The track number of the track on the album. **context** (Optional) : Sub-client version (not public, only enabled for certain API keys) **mbid** (Optional) : The MusicBrainz Track ID. **duration** (Optional) : The length of the track in seconds. **albumArtist** (Optional) : The album artist - if this differs from the track artist. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- Test Track Test Artist [#](#attributes) Attributes ---------------------------- * **code** : Ignored message codes: * 1: Artist was ignored * 2: Track was ignored * 3: Timestamp was too old * 4: Timestamp was too new * 5: Daily scrobble limit exceeded * **corrected** : '1', if this track, artist or album name was automatically corrected, '0' otherwise [#](#errors) Errors -------------------- * **16** : The service is temporarily unavailable, please try again. * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.unlove](/api/show/track.unlove) [user.getFriends](/api/show/user.getFriends) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#artist-removetag) artist.removeTag ======================================== Remove a user's tag from an artist. [#](#params) Params -------------------- **artist** (Required) : The artist name **tag** (Required) : A single user tag to remove from this artist. **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [artist.getTopTracks](/api/show/artist.getTopTracks) [artist.search](/api/show/artist.search) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#chart-gettoptracks) chart.getTopTracks ============================================ Get the top tracks chart [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=chart.gettoptracks&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=chart.gettoptracks&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **page** (Optional) : The page number to fetch. Defaults to first page. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Dark Fantasy 124394 42141 http://www.last.fm/music/Kanye+West/_/Dark+Fantasy 0 Kanye West 164f0d73-1234-4e2c-8743-d77bf2191051 http://www.last.fm/music/Kanye+West ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [chart.getTopTags](/api/show/chart.getTopTags) [geo.getTopArtists](/api/show/geo.getTopArtists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-getsimilar) track.getSimilar ======================================== Get the similar tracks for this track on Last.fm, based on listening data. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=track.getsimilar&artist=cher&track=believe&api\_key=YOUR\_API\_KEY&forma...](http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=cher&track=believe&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=track.getsimilar&artist=cher&track=believe&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=cher&track=believe&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **track** (Required (unless mbid)\] : The track name **artist** (Required (unless mbid)\] : The artist name **mbid** (Optional) : The musicbrainz id for the track **autocorrect\[0|1\]** (Optional) : Transform misspelled artist and track names into correct artist and track names, returning the correct version instead. The corrected artist and track name will be returned in the response. **limit** (Optional) : Maximum number of similar tracks to return **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Ray of Light 10.95 http://www.last.fm/music/Madonna/_/Ray+of+Light 1 Madonna 79239441-bfd5-4981-a70c-55c3f15c1287 http://www.last.fm/music/Madonna http://cdn.last.fm/coverart/50x50/1934.jpg http://cdn.last.fm/coverart/130x130/1934.jpg http://cdn.last.fm/coverart/130x130/1934.jpg ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.getInfo](/api/show/track.getInfo) [track.getTags](/api/show/track.getTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-gettoptags) tag.getTopTags ==================================== Fetches the top global tags on Last.fm, sorted by popularity (number of times used) [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.getTopTags&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.getTopTags&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.getTopTags&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.getTopTags&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- rock 1994155 www.last.fm/tag/rock ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [tag.getTopArtists](/api/show/tag.getTopArtists) [tag.getTopTracks](/api/show/tag.getTopTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-getinfo) track.getInfo ================================== Get the metadata for a track on Last.fm using the artist/track name or a musicbrainz id. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=track.getInfo&api\_key=YOUR\_API\_KEY&artist=cher&track=believe&format=json](http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=YOUR_API_KEY&artist=cher&track=believe&format=json) **XML:** [/2.0/?method=track.getInfo&api\_key=YOUR\_API\_KEY&artist=cher&track=believe](http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=YOUR_API_KEY&artist=cher&track=believe) [#](#params) Params -------------------- **mbid** (Optional) : The musicbrainz id for the track **track** (Required (unless mbid)\] : The track name **artist** (Required (unless mbid)\] : The artist name **username** (Optional) : The username for the context of the request. If supplied, the user's playcount for this track and whether they have loved the track is included in the response. **autocorrect\[0|1\]** (Optional) : Transform misspelled artist and track names into correct artist and track names, returning the correct version instead. The corrected artist and track name will be returned in the response. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- 1019817 Believe http://www.last.fm/music/Cher/_/Believe 240000 1 69572 281445 Cher bfcc6d75-a6a5-4bc6-8282-47aec8531818 http://www.last.fm/music/Cher Cher Believe 61bf0388-b8a9-48f4-81d1-7eb02706dfb0 http://www.last.fm/music/Cher/Believe http://userserve-ak.last.fm/serve/34/8674593.jpg http://userserve-ak.last.fm/serve/64/8674593.jpg http://userserve-ak.last.fm/serve/126/8674593.jpg pop http://www.last.fm/tag/pop ... Sun, 27 Jul 2008 15:44:58 +0000 ... ... [#](#attributes) Attributes ---------------------------- * **duration** : In milliseconds * **fulltrack** : An attribute value of 1 indicates a full length preview is available for streaming * **streamable** : A tag value of 1 indicates a 30 second preview of this song is available for streaming [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.getCorrection](/api/show/track.getCorrection) [track.getSimilar](/api/show/track.getSimilar) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#tag-getinfo) tag.getInfo ============================== Get the metadata for a tag [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=tag.getinfo&tag=disco&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=tag.getinfo&tag=disco&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=tag.getinfo&tag=disco&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=tag.getinfo&tag=disco&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **lang** (Optional) : The language to return the wiki in, expressed as an ISO 639 alpha-2 code. **tag** (Required) : The tag name **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- disco http://www.last.fm/tag/disco 27199 114210 1 Thu, 19 Aug 2010 03:22:16 +0000 [#](#attributes) Attributes ---------------------------- * **reach** : The number of users that have used this tag * **streamable** : A value of '1' indicates this tag can be used as a radio station * **taggings** : The total number of times this tag has been used [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [library.getArtists](/api/show/library.getArtists) [tag.getSimilar](/api/show/tag.getSimilar) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-unlove) track.unlove ================================ UnLove a track for a user profile. [#](#params) Params -------------------- **track** (Required) : A track name (utf8 encoded) **artist** (Required) : An artist name (utf8 encoded) **api\_key** (Required) : A Last.fm API key. **api\_sig** (Required) : A Last.fm method signature. See [authentication](/api/authentication) for more information. **sk** (Required) : A session key generated by authenticating a user via the authentication protocol. [#](#auth) Auth ---------------- This service requires authentication. Please see our [authentication](/api/authentication) how-to. This is a **write** service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See [rest requests](/api/rest) for more information. [#](#sample-response) Sample Response -------------------------------------- [#](#errors) Errors -------------------- * **8** : Operation Failed - Server Error. Please try again later. * **6** : Invalid track name supplied * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.search](/api/show/track.search) [track.updateNowPlaying](/api/show/track.updateNowPlaying) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getinfo) user.getInfo ================================ Get information about a user profile. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getinfo&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getinfo&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Optional) : The user to fetch info for. Defaults to the authenticated user. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- 1000002 RJ Richard Jones http://www.last.fm/user/RJ http://userserve-ak.last.fm/serve/126/8270359.jpg UK 27 m 1 54189 4 0 2002-11-20 11:50 [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getFriends](/api/show/user.getFriends) [user.getLovedTracks](/api/show/user.getLovedTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#track-getcorrection) track.getCorrection ============================================== Use the last.fm corrections data to check whether the supplied track has a correction to a canonical track [#](#example-urls) Example URLs -------------------------------- **JSON:** \[/2.0/?method=track.getcorrection&artist=guns and...\](http://ws.audioscrobbler.com/2.0/?method=track.getcorrection&artist=guns and roses&track=Mrbrownstone&api\_key=YOUR\_API\_KEY&format=json) **XML:** \[/2.0/?method=track.getcorrection&artist=guns and...\](http://ws.audioscrobbler.com/2.0/?method=track.getcorrection&artist=guns and roses&track=Mrbrownstone&api\_key=YOUR\_API\_KEY) [#](#params) Params -------------------- **artist** (Required) : The artist name to correct. **track** (Required) : The track name to correct. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Mr. Brownstone www.last.fm/music/Guns+N%27+Roses/_/Mr.+Brownstone Guns N' Roses eeb1195b-f213-4ce1-b28c-8565211f8e43 http://www.last.fm/music/Guns+N%27+Roses [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [track.addTags](/api/show/track.addTags) [track.getInfo](/api/show/track.getInfo) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getlovedtracks) user.getLovedTracks ============================================== Get the last 50 tracks loved by a user. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getlovedtracks&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getlovedtracks&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user name to fetch the loved tracks for. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- The Glass Prison www.last.fm/music/Dream+Theater/_/The+Glass+Prison 18 Jul 2008, 08:58 Dream Theater 28503ab7-8bf2-4666-a7bd-2644bfc7cb1d http://www.last.fm/music/Dream+Theater ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getInfo](/api/show/user.getInfo) [user.getPersonalTags](/api/show/user.getPersonalTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getpersonaltags) user.getPersonalTags ================================================ Get the user's personal tags [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getpersonaltags&user=rj&tag=rock&taggingtype=artist&api\_key=YOUR...](http://ws.audioscrobbler.com/2.0/?method=user.getpersonaltags&user=rj&tag=rock&taggingtype=artist&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getpersonaltags&user=rj&tag=rock&taggingtype=artist&api\_key=YOUR...](http://ws.audioscrobbler.com/2.0/?method=user.getpersonaltags&user=rj&tag=rock&taggingtype=artist&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user who performed the taggings. **tag** (Required) : The tag you're interested in. **taggingtype\[artist|album|track\]** (Required) : The type of items which have been tagged **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- John Hammond d83e599c-2d5a-44ec-b727-587e1455b1b5 http://www.last.fm/music/John+Hammond 1 http://userserve-ak.last.fm/serve/34/255418.jpg http://userserve-ak.last.fm/serve/64/255418.jpg http://userserve-ak.last.fm/serve/126/255418.jpg http://userserve-ak.last.fm/serve/252/255418.jpg http://userserve-ak.last.fm/serve/_/255418/John+Hammond.jpg [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getLovedTracks](/api/show/user.getLovedTracks) [user.getRecentTracks](/api/show/user.getRecentTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getrecenttracks) user.getRecentTracks ================================================ Get a list of the recent tracks listened to by this user. Also includes the currently playing track with the nowplaying="true" attribute if the user is currently listening. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getrecenttracks&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getrecenttracks&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **limit** (Optional) : The number of results to fetch per page. Defaults to 50. Maximum is 200. **user** (Required) : The last.fm username to fetch the recent tracks of. **page** (Optional) : The page number to fetch. Defaults to first page. **from** (Optional) : Beginning timestamp of a range - only display scrobbles after this time, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone. **extended** (0|1) (Optional) : Includes extended data in each artist, and whether or not the user has loved each track **to** (Optional) : End timestamp of a range - only display scrobbles before this time, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Aretha Franklin Sisters Are Doing It For Themselves www.last.fm/music/Aretha+Franklin/_/Sisters+Are+Doing+It+For+Themselves 9 Jun 2008, 17:16 1 ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getPersonalTags](/api/show/user.getPersonalTags) [user.getTopAlbums](/api/show/user.getTopAlbums) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getweeklytrackchart) user.getWeeklyTrackChart ======================================================== Get a track chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent track chart for this user. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getweeklytrackchart&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getweeklytrackchart&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The last.fm username to fetch the charts of. **from** (Optional) : The date at which the chart should start from. See User.getWeeklyChartList for more. **to** (Optional) : The date at which the chart should end on. See User.getWeeklyChartList for more. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Dirk Leyers Wellen 3 http://www.last.fm/music/Dirk+Leyers/_/Wellen ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getWeeklyChartList](/api/show/user.getWeeklyChartList) API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getweeklyalbumchart) user.getWeeklyAlbumChart ======================================================== 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 album chart for this user. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getweeklyalbumchart&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getweeklyalbumchart&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getweeklyalbumchart&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getweeklyalbumchart&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The last.fm username to fetch the charts of. **from** (Optional) : The date at which the chart should start from. See User.getChartsList for more. **to** (Optional) : The date at which the chart should end on. See User.getChartsList for more. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- David Hudson Bedarra dc30face-71db-413a-bcae-06accbd64aae 10 http://www.last.fm/music/David+Hudson+and+Friends/Bedarra ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getTopTracks](/api/show/user.getTopTracks) [user.getWeeklyArtistChart](/api/show/user.getWeeklyArtistChart) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-gettoptracks) user.getTopTracks ========================================== Get the top tracks listened to by a user. You can stipulate a time period. Sends the overall chart by default. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.gettoptracks&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.gettoptracks&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user name to fetch top tracks for. **period** (Optional) : overall | 7day | 1month | 3month | 6month | 12month - The time period over which to retrieve top tracks for. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Learning to Live 42 http://www.last.fm/music/Dream+Theater/_/Learning+to+Live 1 Dream Theater 28503ab7-8bf2-4666-a7bd-2644bfc7cb1d http://www.last.fm/music/Dream+Theater ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getTopTags](/api/show/user.getTopTags) [user.getWeeklyAlbumChart](/api/show/user.getWeeklyAlbumChart) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getweeklychartlist) user.getWeeklyChartList ====================================================== Get a list of available charts for this user, expressed as date ranges which can be sent to the chart services. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getweeklychartlist&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getweeklychartlist&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getweeklychartlist&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getweeklychartlist&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The last.fm username to fetch the charts list for. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getWeeklyArtistChart](/api/show/user.getWeeklyArtistChart) [user.getWeeklyTrackChart](/api/show/user.getWeeklyTrackChart) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # Login | Last.fm Login ===== Username or Email Password Let me in! [Forgot your username or password?](/settings/lostpassword) Don‘t have a profile? [Sign up for FREE](/join?next=/api/auth) API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) --- # Login | Last.fm Login ===== Username or Email Password Let me in! [Forgot your username or password?](/settings/lostpassword) Don‘t have a profile? [Sign up for FREE](/join?next=/api/accounts) API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) --- # Login | Last.fm Login ===== Username or Email Password Let me in! [Forgot your username or password?](/settings/lostpassword) Don‘t have a profile? [Sign up for FREE](/join?next=/api/account/create) API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) --- # API Docs | Last.fm [#](#user-gettopartists) user.getTopArtists ============================================ Get the top artists listened to by a user. You can stipulate a time period. Sends the overall chart by default. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.gettopartists&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.gettopartists&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user name to fetch top artists for. **period** (Optional) : overall | 7day | 1month | 3month | 6month | 12month - The time period over which to retrieve top artists for. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Dream Theater 1337 28503ab7-8bf2-4666-a7bd-2644bfc7cb1d http://www.last.fm/music/Dream+Theater 1 ... ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getTopAlbums](/api/show/user.getTopAlbums) [user.getTopTags](/api/show/user.getTopTags) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-gettopalbums) user.getTopAlbums ========================================== Get the top albums listened to by a user. You can stipulate a time period. Sends the overall chart by default. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.gettopalbums&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.gettopalbums&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user name to fetch top albums for. **period** (Optional) : overall | 7day | 1month | 3month | 6month | 12month - The time period over which to retrieve top albums for. **limit** (Optional) : The number of results to fetch per page. Defaults to 50. **page** (Optional) : The page number to fetch. Defaults to first page. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- Images and Words 174 f20971f2-c8ad-4d26-91ab-730f6dedafb2 http://www.last.fm/music/Dream+Theater/Images+and+Words Dream Theater 28503ab7-8bf2-4666-a7bd-2644bfc7cb1d http://www.last.fm/music/Dream+Theater ... ... ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getRecentTracks](/api/show/user.getRecentTracks) [user.getTopArtists](/api/show/user.getTopArtists) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#error-codes) Error Codes ============================== You may receive one of the following error codes from your webservices request. Some indicate errors you may encounter in development (e.g. "10: Invalid API key"), and some indicate errors you may encounter and need to handle in normal operation (e.g. "20: Not Enough Content") [#](#list-of-errors) List of errors ------------------------------------ * 1 : This error does not exist * 2 : Invalid service -This service does not exist * 3 : Invalid Method - No method with that name in this package * 4 : Authentication Failed - You do not have permissions to access the service * 5 : Invalid format - This service doesn't exist in that format * 6 : Invalid parameters - Your request is missing a required parameter * 7 : Invalid resource specified * 8 : Operation failed - Most likely the backend service failed. Please try again. * 9 : Invalid session key - Please re-authenticate * 10 : Invalid API key - You must be granted a valid key by last.fm * 11 : Service Offline - This service is temporarily offline. Try again later. * 12 : Subscribers Only - This station is only available to paid last.fm subscribers * 13 : Invalid method signature supplied * 14 : Unauthorized Token - This token has not been authorized * 15 : This item is not available for streaming. * 16 : The service is temporarily unavailable, please try again. * 17 : Login: User requires to be logged in * 18 : Trial Expired - This user has no free radio plays left. Subscription required. * 19 : This error does not exist * 20 : Not Enough Content - There is not enough content to play this station * 21 : Not Enough Members - This group does not have enough members for radio * 22 : Not Enough Fans - This artist does not have enough fans for for radio * 23 : Not Enough Neighbours - There are not enough neighbours for radio * 24 : No Peak Radio - This user is not allowed to listen to radio during peak usage * 25 : Radio Not Found - Radio station not found * 26 : API Key Suspended - This application is not allowed to make requests to the web services * 27 : Deprecated - This type of request is no longer supported * 29 : Rate Limit Exceded - Your IP has made too many requests in a short period, exceeding our API guidelines API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-getweeklyartistchart) user.getWeeklyArtistChart ========================================================== Get an artist chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent artist chart for this user. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.getweeklyartistchart&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.getweeklyartistchart&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The last.fm username to fetch the charts of. **from** (Optional) : The date at which the chart should start from. See User.getWeeklyChartList for more. **to** (Optional) : The date at which the chart should end on. See User.getWeeklyChartList for more. **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- David Hudson and Friends 80e577ba-841f-43ba-9f32-72e7c1692336 18 http://www.last.fm/music/David+Hudson+and+Friends ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getWeeklyAlbumChart](/api/show/user.getWeeklyAlbumChart) [user.getWeeklyChartList](/api/show/user.getWeeklyChartList) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # API Docs | Last.fm [#](#user-gettoptags) user.getTopTags ====================================== Get the top tags used by this user. [#](#example-urls) Example URLs -------------------------------- **JSON:** [/2.0/?method=user.gettoptags&user=rj&api\_key=YOUR\_API\_KEY&format=json](http://ws.audioscrobbler.com/2.0/?method=user.gettoptags&user=rj&api_key=YOUR_API_KEY&format=json) **XML:** [/2.0/?method=user.gettoptags&user=rj&api\_key=YOUR\_API\_KEY](http://ws.audioscrobbler.com/2.0/?method=user.gettoptags&user=rj&api_key=YOUR_API_KEY) [#](#params) Params -------------------- **user** (Required) : The user name **limit** (Optional) : Limit the number of tags returned **api\_key** (Required) : A Last.fm API key. [#](#auth) Auth ---------------- This service does **not** require authentication. [#](#sample-response) Sample Response -------------------------------------- rock 12 www.last.fm/tag/rock ... [#](#errors) Errors -------------------- * **2** : Invalid service - This service does not exist * **3** : Invalid Method - No method with that name in this package * **4** : Authentication Failed - You do not have permissions to access the service * **5** : Invalid format - This service doesn't exist in that format * **6** : Invalid parameters - Your request is missing a required parameter * **7** : Invalid resource specified * **8** : Operation failed - Something else went wrong * **9** : Invalid session key - Please re-authenticate * **10** : Invalid API key - You must be granted a valid key by last.fm * **11** : Service Offline - This service is temporarily offline. Try again later. * **13** : Invalid method signature supplied * **16** : There was a temporary error processing your request. Please try again * **26** : Suspended API key - Access for your account has been suspended, please contact Last.fm * **29** : Rate limit exceeded - Your IP has made too many requests in a short period ← [user.getTopArtists](/api/show/user.getTopArtists) [user.getTopTracks](/api/show/user.getTopTracks) → API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close --- # Page Not Found | Last.fm 404 - Page Not Found ==================== Whoops! Sorry, but this page doesn't exist. Why not use the links above or search to find what you're looking for? Alternatively, you could go back to [where you were](javascript:window.history.back();) or start again from the [home page](/) . [![Sad Marvin the robot](/static/images/marvin.05ccf89325af.png)](https://www.youtube.com/watch?v=oabcM9SOF-E) API Calls --------- Close Close Loading player… Previous Next Play Next Settings * Open in Spotify Web Player * Open on YouTube website * [Change playback source](/login?next=/settings/website) ### Scrobble from Spotify? Connect your Spotify account to your Last.fm account and scrobble everything you listen to, from any Spotify app on any device or platform. [Connect to Spotify](/settings/applications) [Dismiss](/nagbar/dismiss/cta/spotify-scrobbling-prompt?period=permanent) Close ---