Skip to content

Instantly share code, notes, and snippets.

@ayush
Created May 29, 2011 10:28
Show Gist options
  • Save ayush/997633 to your computer and use it in GitHub Desktop.
Save ayush/997633 to your computer and use it in GitHub Desktop.
Sample usage of musix-lib library
// instantiate the API
val api = new MusixMatch("YOUR_API_KEY")
// get artist lady gaga
val artists = api.findExactArtistsByName("lady gaga")
assert(artists.length > 0)
for (artist <- artists) {
println(artist)
}
// Get all albums of Tori Amos
val albums = api.getArtistAlbums("46")
assert(albums.length > 0)
println("Got " + albums.length + " albums")
for (album <- albums) {
println(album)
}
// Get lyrics for track Faith by George Michael
val lyrics = api.getLyrics("745388")
assert(lyrics != null && lyrics.body.length() > 0)
println(lyrics.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment