Skip to content
Tim Case edited this page Sep 1, 2013 · 3 revisions
  1. All methods can be derived by looking at the Echonest API Docs. All methods are represented using an "object_method" scheme so:

  2. The Echonest API describes what parameters are accepted for each method call. This wrapper will send any parameters passed in to the API.

    •  Echowrap.artist_news(:name => "Daft Punk, :start => 15, :high_relevance => true)
      ``` has parameters that correspond to the parameter listing for [news method of the Artist API](http://developer.echonest.com/docs/v4/artist.html#news).
      
    • Format parameter is always set to JSON as the wrapper expects to serialize JSON into objects.
    • Callback parameter is irrelevant because format will never be jsonp.
  3. Echonest API responses are parsed into Ruby objects. The parsed response objects are simple objects that wrap the data returned by Echonest and don't contain any high level processing. A listing of what data is returned can be seen by inspecting the response object's source code or looking at the usage responses below.

  4. Bucket is a parameter available on methods such as Echowrap#song_search and Echowrap#artist_search (and on other methods). The bucket parameter will cause different data to be returned with the method call.

    • No buckets specified:
    songs = Echowrap.song_search(:artist => 'Macklemore') 
    songs.title = "Thrift Shop"
    songs.first.audio_summary => #<Echowrap::AudioSummary:0x007f9f91b3e3f8>
    songs.first.audio_summary.key => nil
    songs.first.artist_location => #<Echowrap::Location:0x00e79g81b3e3f8>
    songs.first.artist_location.location => nil
    • One bucket specified:
    songs = Echowrap.song_search(:artist => 'Macklemore', :bucket => 'audio_summary') 
    songs.title = "Thrift Shop"
    songs.first.audio_summary => #<Echowrap::AudioSummary:0x007f9f91b3e3f8>
    songs.first.audio_summary.tempo => 125.013
    songs.first.artist_location => #<Echowrap::Location:0x00e79g81b3e3f8>
    songs.first.artist_location.location => nil
    • Multiple buckets specified:
    songs = Echowrap.song_search(:artist => 'Macklemore', :bucket => ['audio_summary', 'artist_location']) 
    songs.title = "Thrift Shop"
    songs.first.audio_summary => #<Echowrap::AudioSummary:0x007f9f91b3e3f8>
    songs.first.audio_summary.tempo => 125.013
    songs.first.artist_location => #<Echowrap::Location:0x00e79g81b3e3f8>
    songs.first.artist_location.location => "Seattle, WA, US"

Clone this wiki locally