0

I'm using HttpBuilder (a Groovy HTTP library built on top of apache's httpclient) to sent requests to the last.fm API. The docs for this API say you should set the user-agent header to "something appropriate" in order to reduce your chances of getting blocked.

Any idea what kind of values would be deemed appropriate?

A.J. Brown
  • 913
  • 7
  • 14
Dónal
  • 185,044
  • 174
  • 569
  • 824

2 Answers2

1

The name of your application including a version number?

wizzardmr42
  • 1,634
  • 12
  • 22
1

I work for Last.fm. "Appropriate" means something which will identify your app in a helpful way to us when we're looking at our logs. Examples of when we use this information:

  • investigating bugs or odd behaviour; for example if you've found an edge case we don't handle, or are accidentally causing unusual load on a system
  • investigating behaviour that we think is inappropriate; we might want to get in touch to help your application work better with our services
  • we might use this information to judge which API methods are used, how often, and by whom, in order to do capacity planning or to get general statistics on the API eco-system.

A helpful (appropriate) User-Agent:

  • tells us the name and version of your application (preferably something unique and easy to find on Google!)
  • tells us the specific version of your application
  • might also contain a URL at which to find out more, e.g. your application's homepage

Examples of unhelpful (inappropriate) User-Agents:

  • the same as any of the popular web browsers
  • the default user-agent for your HTTP Client library (e.g. curl/7.10.6 or PEAR HTTP_Request)

We're aware that it's not possible to change the User-Agent sent when your application is browser-based (e.g. Javascript or Flash) and don't expect you to do so. (That shouldn't be a problem in your case.)

If you're using a 3rd party Last.fm API library, such as one of the ones listed at http://www.last.fm/api/downloads , then we would prefer it if you added extra information to the User-Agent to identify your application, but left the library name and version in there as well. This is immensely useful when tracking down bugs (in either our service or in the client libraries).

Ben XO
  • 1,089
  • 1
  • 11
  • 16