Echo Nest API Overview

Overview

The Echo Nest API allows you to call methods that respond in JSON or XML. Individual methods are detailed in the menu on the left. You can call a method by using an HTTP GET to retrieve http://developer.echonest.com/api/v4/[type]/[method] along with method specific arguments.

Keys

You must have your own API key to make use of The Echo Nest API. To obtain a key, register for an account.

The example method calls in this set of documentation use a guest API key that is for demonstration purposes only and should not be used for any other application.

Ground Rules

We want to be as flexible as possible with our API and data feeds; if you have an interesting use of our platform, we want to help. Here are some basic ground rules that all developers should abide by when using the API and data feeds.

  • Use common sense. If you're unsure, ask us. - Our terms of service allow for most reasonable non-commercial uses. If you're doing something you think might be a problem or if you have any questions, just contact us at developer@echonest.com.
  • Read the Terms of Service. - Before you start developing anything using the Echo Nest API, you need to read and abide by the full Terms of Service.
  • Do not use the API or feeds for commercial use without talking to us. - The Echo Nest's API is free for non-commercial purposes. To use them commercially, talk to us and we will go over the licensing options. In either case, we request that you give us proper branding and attribution when using our data. (But be sure to see the commercial exception for song/identify in the next section). If you are a lone developer selling advertising that is barely covering your running costs, we consider that non-commercial. If you are a company writing paychecks, making plenty of money or driving a venture-capital-purchased MacBook Pro, you're probably commercial. For commercial use, we have standard terms & conditions that we can share with you. We want to be flexible and support many uses of the platform, so just contact us at developer@echonest.com if you have any questions about whether your use is commercial.
  • Commercial use of Song/Identify is OK. - As part of the free and open Echoprint music identfication system, we are making access to the song identification method when called without any bucket parameters be free for both non-commercial and commercial use. You will still need an API key to access the api method and calls will be rate limited (however, only severely high query rates should trigger the rate limit).
  • Credit. - Please give us due credit when using the Echo Nest API and feeds. Display an Echo Nest logo available on the logos page along with a link to http://the.echonest.com/ when displaying content provided by the API or feeds.
  • Don't do anything illegal. - Don't use the API or feeds in connection with anything that promotes or takes part in any products, services, or materials that we would consider malicious, hateful, or illegal.
  • Don't pretend the data is yours. - You may not sell, lease, share, transfer, or sublicense the API or feeds or access to the API/feeds to any other party than the API key holder. You can cache our data to lighten bandwidth and improve latency, but don't crawl/spider our API or data feeds and make a copy of our data to steal our mojo.
  • Help us manage server and bandwidth costs. - Don't use the API or feeds in a manner that exceeds reasonable request volume, or constitutes excessive or abusive usage as determined by The Echo Nest.
  • Respect the Terms of Service of our Partners. - Some of the data returned by the Echo Nest API may be subject to 3rd party terms of service. Make sure you understand and abide by these terms:

Encoding

Use UTF-8 encoding when sending arguments to API methods.

Authentication

Some API methods need to be authenticated. We use Oauth authentication for these requests. For these authenticated requests you must generate a cryptographic signature based upon your request, consumer key and shared secret. The authentication process can be a bit complicated, so it is recommended that you use a library (such as pyechonest or jEN) to handle all of the authentication details. To sign a request, you add a nonce parameter (a random string of characters that differs from call to call), a timestamp (the number of seconds since the epoch) and a signature which is generated by applying a cryptographic hash (such as SHA1) to your consumer key, shared secret and the base string portion of the request. A guide to signing requests can be found in The Oauth 1.0 Guide. Netflix also has an excellent description of how to sign requests in their Authentication oveview.

Methods that require authentication are:
sandbox/access

Rate Limits

API methods are subject to rate limits. In general, non-commercial users of our API can expect a rate limit of around 120 calls per minute. This may vary depending upon overall system activity. If we are under a light load we may increase the limit associated with your API key and conversely, if we are under heavy load we may reduce that limit. If you need a guaranteed API limit, contact us at developer@echonest.com. You can discover what your current rate limit and activity is by inspecting the response header that is returned with each API method call. There are three fields in the header associated with rate limits:

  • X-RateLimit-Limit - the current rate limit for this API key
  • X-RateLimit-Used - the number of method calls used on this API key this minute
  • X-RateLimit-Remaining - the estimated number of remaining calls allowed by this API key this minute

You can inspect the response header with the -i option to curl like so:

curl -i 'http://developer.echonest.com/api/v4/artist/profile?api_key=N6E4NIOVYMTHNDM8J&name=weezer'

This returns a response header with content like so:

HTTP/1.1 200 OK
Content-Length: 135
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 62
X-RateLimit-Used: 58

This indicates that the current rate limit is 120 calls per minute. In the current minute 58 calls have been made and we estimate that you will have 62 calls remaining for the current minute.

Identifiers

Many calls take ID of items (artists, songs, tracks, etc). IDs can be full formed Echo Nest IDs like music://id.echonest.com/~/AR/ARC51DL1187B9A9FED or can in abbreviated form such as ARC51DL1187B9A9FED. We also support other ID spaces through Project Rosetta stone.

Project Rosetta Stone

The Echo Nest API supports multiple ID spaces. You can use an ID from a supported ID space in place of an Echo Nest ID in any call that takes an Echo Nest ID. For example, you can get news for Radiohead using a Rdio ID like so:

http://developer.echonest.com/api/v4/artist/news?api_key=N6E4NIOVYMTHNDM8J&id=rdio-us-streaming:artist:r91318&format=json

Or using a 7Digital ID like so:

http://developer.echonest.com/api/v4/artist/news?api_key=N6E4NIOVYMTHNDM8J&id=7digital-US:artist:304&format=json

Similarly you can use a personal catalog foreign_id like so:

http://developer.echonest.com/api/v4/artist/news?api_key=N6E4NIOVYMTHNDM8J&id=CAXFDYO12E2688C130:artist:item-1&format=json

Methods that return Echo Nest IDs can also be used to retrieve IDs in a foreign ID space. For example, the following artist similarity call will return rdio artist IDs:

http://developer.echonest.com/api/v4/artist/similar?api_key=N6E4NIOVYMTHNDM8J&name=radiohead&format=json&bucket=id:rdio-us-streaming

Certain methods can be constrained to only return items that are members of the given ID space. For example, by setting the limit parameter to true, the following artist/similar call will limit results to those that fall in the 7Digital catalog:

http://developer.echonest.com/api/v4/artist/similar?api_key=N6E4NIOVYMTHNDM8J&name=radiohead&format=json&bucket=id:7digital-US&limit=true

Similarly, methods can be constrained to only return items that are members of a personal catalog. For example, the following call will limit similar artists to only those that are contained in the catalog CAABOUD13216257FC7:

http://developer.echonest.com/api/v4/artist/similar?api_key=N6E4NIOVYMTHNDM8J&name=radiohead&format=json&bucket=id:CAABOUD13216257FC7&limit=true
Currently supported ID spaces are:
  • 7Digital US artists - Example: 7digital-US:artist:142111
  • 7Digital US tracks - Example: 7digital-US:track:6372821
  • 7Digital UK artists - Example: 7digital-UK:artist:142111
  • 7Digital UK tracks - Example: 7digital-UK:track:6372821
  • 7Digital AU artists - Example: 7digital-AU:artist:142111
  • 7Digital AU tracks - Example: 7digital-AU:track:6372821
  • EMI Blue Note artists - Example: emi_bluenote:artist:116397124906
  • EMI Blue Note tracks - Example: emi_bluenote:track:EUEDD0029529
  • EMI Open Collection artists - Example: emi_open_collection:artist:123094
  • EMI Open Collection tracks - Example: emi_open_collection:track:EUEDD03057023
  • EMI artists- Example: emi_artists:artist:198648
  • EMI tracks- Example: emi_artists:track:EMIDD1342684
  • Facebook artists - Example: facebook:artist:6979332244
  • Free Music Archive artists - Example: fma:artist:3243
  • Free Music Archive tracks - Example: fma:track:11764
  • Playme artists - Example: playme:artist:1234
  • Playme tracks - Example: playme:track:554928
  • Rdio artists - Example: rdio-us-streaming:artist:r91318
  • Rdio songs - Example: rdio-us-streaming:song:t4438390
  • Twitter artists - Example: twitter:artist:justinbieber

Standard Parameters

These parameters are valid for all methods in the API

Parameter Required? Multiple? Values Description
api_key yes no N6E4NIOVYMTHNDM8J the developer API key
format no no json, jsonp, xml the format of the response
callback Required if format is jsonp no MyJSFunc the callback function for JSONP requests

Response Codes

Code Value
-1 Unknown Error
0 Success
1 Missing/ Invalid API Key
2 This API key is not allowed to call this method
3 Rate Limit Exceeded
4 Missing Parameter
5 Invalid Parameter

Resources

Visit our downloads for links to existing Echo Nest API-related code.

Discussion

Join our forums to provide feedback and discuss development with other developers.